/* ============================================================
   LUNCHBOT — 樣式表
   桃紅外框 + 深色面板 + 等寬字（參考 AI 交易桌儀表板）。
   等級色（C/R/SR/SSR）由 .t-C/.t-R/.t-SR/.t-SSR 設 --rar，元件一律讀 var(--rar)。
   角色色由 --ac 帶入。低特效：<html data-lowfx="1"> 關掉所有動畫。
   ============================================================ */
:root {
    --frame: #ff4fa3;
    --frame-2: #ff7cc0;
    --bg: #0b0b10;
    --panel: #0d0d14;
    --panel-2: #14141e;
    --line: #23243a;
    --ink: #ecebf5;
    --ink-dim: #8a8aa3;
    --pink: #ff4fa3;
    --green: #2ee59d;
    --red: #ff3d57;
    --gold: #ffd23f;
    --warn: #ff5c6c;

    --rar-C: #e6edf7;
    --rar-R: #4fa3ff;
    --rar-SR: #b26bff;
    --rar-SSR: #ff8a2b;
    --rar: var(--rar-R);

    --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, "Noto Sans TC", monospace;
    --sans: "Noto Sans TC", "Space Grotesk", ui-sans-serif, system-ui, "Microsoft JhengHei", sans-serif;
    --display: "Space Grotesk", "Noto Sans TC", ui-sans-serif, sans-serif;
    --r: 6px;
}
.t-C   { --rar: var(--rar-C); }
.t-R   { --rar: var(--rar-R); }
.t-SR  { --rar: var(--rar-SR); }
.t-SSR { --rar: var(--rar-SSR); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; background: var(--frame); }
body {
    margin: 0; min-height: 100vh; background: var(--frame); color: var(--ink);
    font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
.mono { font-family: var(--mono); }
.dim { color: var(--ink-dim); }
.small { font-size: 11px; }
.gold { color: var(--gold); }
.pinkish { color: var(--pink); }
.grow { flex: 1; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.frame { max-width: 1480px; margin: 0 auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.panel { background: var(--panel); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.panel-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
    font-family: var(--mono); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.panel-head .dim, .panel-head .pinkish { font-weight: 600; text-transform: none; letter-spacing: 0; }

/* ── 頂部 ─────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--panel); border-radius: var(--r); padding: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mascot svg { display: block; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.01em; }
.brand-plus { color: var(--pink); font-weight: 700; font-size: 22px; }
.brand-sub { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--pink); }
.tagline { font-family: var(--mono); font-size: 10px; color: var(--ink-dim); letter-spacing: 0.12em; }
.rot-meter { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; }
.rot-label { color: var(--ink-dim); font-family: var(--mono); }
.meter { width: 150px; height: 12px; border: 1px solid #3a3b55; border-radius: 2px; padding: 1px; display: inline-block; }
.meter i {
    display: block; height: 100%; width: 0; transition: width 0.6s;
    background: repeating-linear-gradient(-45deg, var(--ink) 0 4px, #6b6b85 4px 7px);
}
.day-chip { font-size: 11px; color: var(--ink-dim); }
.remain-pill { font-size: 12px; border: 1px solid var(--line); border-radius: 3px; padding: 3px 8px; }
.remain-pill b { color: var(--pink); }
.clock { background: #000; border: 1px solid #2c2d44; border-radius: 3px; padding: 4px 10px; font-size: 18px; font-weight: 800; letter-spacing: 0.04em; }

.tabs { display: flex; align-items: center; gap: 4px; background: var(--panel); border-radius: var(--r); padding: 6px; overflow-x: auto; }
.tabs a, .tab-btn {
    text-decoration: none; padding: 6px 14px; border-radius: 4px; font-size: 13px; font-weight: 700;
    color: var(--ink-dim); background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tab-btn:hover { color: var(--ink); background: var(--panel-2); }
.tabs a.active { color: #0b0b10; background: var(--pink); }

.recall-bar {
    display: flex; align-items: center; gap: 10px; background: #1a0f18; border: 1px solid var(--pink);
    border-radius: var(--r); padding: 8px 12px;
}
.recall-tag { background: var(--pink); color: #000; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 2px; }
#recall-text { flex: 1; }
.recall-btn { background: var(--pink); color: #000; border: 0; border-radius: 3px; padding: 6px 12px; font-weight: 800; cursor: pointer; }
.recall-x { background: none; border: 0; color: var(--ink-dim); cursor: pointer; font-size: 14px; }

/* ── 角色卡 ───────────────────────────────────────────── */
.agents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.agent-card {
    position: relative; background: var(--panel); border-radius: var(--r); padding: 10px 12px 8px;
    cursor: pointer; border: 1px solid transparent; transition: border-color 0.2s, transform 0.2s; min-width: 0;
    outline: none;
}
.agent-card:hover, .agent-card:focus-visible { border-color: #2c2d44; }
.agent-card.active { border-color: var(--ac); box-shadow: 0 0 0 1px var(--ac), 0 0 24px -6px var(--ac); }
.ac-head { display: flex; align-items: center; gap: 8px; }
.ac-mascot svg { display: block; }
.ac-title { min-width: 0; flex: 1; }
.ac-name { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ac); line-height: 1.1; }
.ac-sub { font-size: 11px; color: var(--ink-dim); }
.ac-tag { font-size: 9px; color: var(--ac); border: 1px solid color-mix(in srgb, var(--ac) 60%, transparent); padding: 1px 5px; border-radius: 2px; align-self: flex-start; }
.ac-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; gap: 8px; }
.ac-label { font-size: 10px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-value { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-bar { height: 3px; background: #1c1d2c; margin: 6px 0; border-radius: 2px; overflow: hidden; }
.ac-bar i { display: block; height: 100%; width: 0; background: var(--ac); transition: width 0.5s; }
.ac-line { font-size: 11.5px; color: #c9c8da; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.ac-status { font-size: 10px; color: var(--ink-dim); }
.agent-card.active .ac-status { color: var(--ac); }
.agent-card.active .ac-status::after { content: '▍'; animation: blink 0.8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── 交易台主區 ──────────────────────────────────────── */
.desk-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; }
.scene-panel { padding: 10px 10px 6px; display: flex; flex-direction: column; }
.scene { position: relative; border: 1px solid #1d1e30; border-radius: 4px; overflow: hidden; background: #0a0b11; }
.scene-svg { display: block; width: 100%; height: auto; }
.mode-indicator { font-size: 10px; color: var(--ink-dim); border: 1px solid var(--line); padding: 2px 8px; border-radius: 2px; }
.mode-indicator.on { color: #000; background: var(--green); border-color: var(--green); }

/* 場景 SVG 文字與元件 */
.scene-svg text { font-family: var(--mono); }
.ticker { font-size: 10px; fill: var(--pink); letter-spacing: 0.04em; }
.under-ticker { font-size: 10.5px; fill: #9a9ab5; }
.wall-cap { font-size: 8.5px; fill: #8a8aa3; }
.wall-clock { font-size: 18px; font-weight: 800; fill: var(--green); }
.mandate-h { font-size: 8px; fill: var(--gold); font-weight: 800; }
.mandate { font-size: 8px; fill: #c9c8da; }
.prop-cap { font-size: 8.5px; fill: #9a9ab5; font-weight: 600; }
.prop-name { font-size: 9.5px; fill: var(--gold); font-weight: 800; }
.candles { opacity: 0.17; }
.threads line, .threads path { stroke: #cfd3ff; stroke-opacity: 0.22; stroke-width: 0.9; fill: none; }
.silk { stroke: #d9c6ff; stroke-opacity: 0.5; stroke-width: 1; }
.node { cursor: default; transition: opacity 0.35s; }
.node .dot { stroke: #05060a; stroke-width: 1.4; transition: r 0.4s, fill 0.35s; }
.node .halo { fill: none; stroke: transparent; stroke-width: 1.5; }
.node.dead { opacity: 0.35; }
.node.dead .dot { fill: #3a3c50 !important; }
.node.lit { opacity: 1; }
.node.killed { opacity: 0.22; }
.node.killed .dot { fill: #3a3c50 !important; }
.node.cand .halo { stroke: var(--pink); stroke-dasharray: 3 3; }
.node.pick .halo { stroke: var(--gold); }
.node.visit .halo { stroke: #fff; }
.node.winner .halo { stroke: var(--green); stroke-width: 2.5; animation: ping 1.1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ping { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.node-label { font-size: 9.5px; fill: #d9d8ea; paint-order: stroke; stroke: #05060a; stroke-width: 3px; }
.win-label { fill: var(--green); font-weight: 800; font-size: 11px; }
.spider .leg { transform-box: fill-box; transform-origin: 0 50%; }
.spider.walking .leg0, .spider.walking .leg2 { animation: legA 0.18s ease-in-out infinite alternate; }
.spider.walking .leg1, .spider.walking .leg3 { animation: legB 0.18s ease-in-out infinite alternate; }
@keyframes legA { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes legB { from { transform: rotate(10deg); } to { transform: rotate(-10deg); } }
.agent .mascot { transition: transform 0.2s; }
.agent .m-body { animation: bob 2.4s ease-in-out infinite; }
.agent:nth-child(odd) .m-body { animation-delay: -1.2s; }
.agent.hop .mascot { transform: translateY(-8px) scale(1.12); }
@keyframes bob { 50% { transform: translateY(-2px); } }
.bubble { transition: opacity 0.2s; }
.bubble-text { font-size: 10.5px; fill: #12121a; font-weight: 800; }
.desk.active .desk-bars rect { animation: bars 0.4s steps(2) infinite; }
@keyframes bars { 50% { opacity: 0.3; } }
.blink, .led1, .led3 { animation: blink 1.6s steps(1) infinite; }
.led2 { animation: blink 2.3s steps(1) infinite; }
.radar-wave { animation: ping 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.flame { animation: blink 0.3s steps(1) infinite; }

/* ── 下單區 ─────────────────────────────────────────── */
.ticket { display: flex; flex-direction: column; gap: 12px; }
.pick { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; background: var(--panel-2); }
.pick:not(.empty) { border-color: var(--rar); box-shadow: inset 3px 0 0 var(--rar); }
.pick-label { font-size: 10px; color: var(--ink-dim); letter-spacing: 0.08em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pick-name { font-size: 22px; font-weight: 900; margin: 4px 0 2px; word-break: break-all; }
.pick-empty { font-size: 15px; font-weight: 700; color: #b9b8cc; margin-top: 4px; }
.pick-meta { font-size: 12px; color: var(--ink-dim); }
.pick-meta.warn { color: var(--warn); }
.pick-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sec-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.sec-h .mono { font-size: 10px; font-weight: 600; }
.pool-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pool-seg.wide { grid-template-columns: repeat(6, 1fr); margin-bottom: 10px; }
.pool-btn {
    display: flex; justify-content: space-between; align-items: center; gap: 4px;
    background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 3px;
    padding: 6px 8px; cursor: pointer; font-size: 12px; font-weight: 700;
}
.pool-btn .pcount { color: var(--ink-dim); font-size: 11px; }
.pool-btn.on { border-color: var(--pc); box-shadow: inset 0 -2px 0 var(--pc); color: var(--pc); }
.pool-btn:hover { border-color: #3a3b55; }
.pool-meta { font-size: 10.5px; color: var(--ink-dim); margin-top: 6px; }
.order-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.buy {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: var(--green); color: #04150d; border: 0; border-radius: 4px; padding: 10px 6px;
    font-size: 17px; font-weight: 900; cursor: pointer; transition: filter 0.15s, transform 0.1s;
}
.buy small { font-family: var(--mono); font-size: 9.5px; font-weight: 700; opacity: 0.75; }
.buy.alt { background: var(--pink); color: #1a0010; }
.buy.bolt { grid-column: 1 / -1; background: transparent; color: var(--gold); border: 1px solid var(--gold); font-size: 14px; padding: 7px; flex-direction: row; gap: 10px; }
.buy:hover:not(:disabled) { filter: brightness(1.1); }
.buy:active:not(:disabled) { transform: translateY(1px); }
.buy:disabled { opacity: 0.35; cursor: not-allowed; }
.ticket-sec.grow-sec { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cand-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 300px; }
.cand-row { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 3px; padding: 6px 8px; border-left: 2px solid var(--rar); }
.cand-row.unavailable { opacity: 0.55; }
.cand-main { flex: 1; min-width: 0; }
.cand-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-sub { font-size: 11px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-acts { display: flex; gap: 3px; flex-shrink: 0; }

/* ── 走勢圖 ─────────────────────────────────────────── */
.rot-chart { width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg .grid-line { stroke: #1b1c2b; stroke-width: 1; }
.chart-svg .axis { font-family: var(--mono); font-size: 10px; fill: #5d5d78; }
.chart-svg .rot-line { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linejoin: round; }
.chart-svg .rot-dot { fill: var(--green); }
.chart-svg .bar { fill: var(--rar); opacity: 0.85; }
.chart-svg .bar.skip { fill: #4a4b60; }
.chart-svg .bar.miss { fill: var(--red); opacity: 0.6; }
.chart-svg .big-num { font-family: var(--display); font-size: 40px; font-weight: 700; fill: var(--green); }
.chart-svg .big-cap { font-family: var(--mono); font-size: 10px; fill: var(--ink-dim); letter-spacing: 0.1em; }
.chart-svg .big-sub { font-family: var(--mono); font-size: 11px; fill: #9a9ab5; }

/* ── 地圖 / thresholds.py ───────────────────────────── */
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-wrap { position: relative; }
.map { height: 340px; border-radius: 4px; background: #0a0b11; }
.map-hint {
    position: absolute; inset: auto 10px 26px 10px; z-index: 500; background: rgba(13, 13, 20, 0.92);
    border: 1px dashed var(--pink); border-radius: 4px; padding: 8px 10px; font-size: 12px;
}
.leaflet-container { font-family: var(--sans); background: #0a0b11; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #12121b; color: var(--ink); }
.leaflet-control-attribution { background: rgba(0, 0, 0, 0.6) !important; color: #888 !important; }
.leaflet-control-attribution a { color: #aaa !important; }
.map-pop .mp-name { font-weight: 900; font-size: 14px; }
.map-pop .mp-sub { font-size: 12px; color: #b9b8cc; }
.map-pop .mp-addr { font-size: 11px; color: var(--ink-dim); margin-top: 4px; }
.map-pop .mp-link { display: inline-block; margin-top: 6px; color: var(--pink); font-size: 12px; }
.office-pin span {
    display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--pink);
    border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(255, 79, 163, 0.35);
}
.code-panel { position: relative; }
.code-box { font-size: 12px; line-height: 1.75; }
.code-head { margin-top: 2px; }
.code-head .kw { color: var(--pink); font-weight: 800; }
.code-line { display: grid; grid-template-columns: 190px 70px 1fr; padding-left: 18px; }
.code-line .ck { color: #c9c8da; }
.code-line .cv { color: var(--green); font-weight: 800; }
.cc { color: #5d5d78; }
.code-foot { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.pipe-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pipe-chip { border: 1px solid #34354f; border-radius: 3px; padding: 1px 7px; font-size: 11px; color: #a9a8c0; transition: all 0.2s; }
.pipe-chip.on { background: var(--pink); border-color: var(--pink); color: #000; font-weight: 800; }
.pipe-chips .arrow { color: #4a4b60; }
.code-edit { position: absolute; bottom: 12px; right: 14px; }
.dark-tiles { filter: invert(1) hue-rotate(185deg) brightness(0.82) contrast(0.92) saturate(0.6); }

.foot { color: #2a0016; text-align: center; font-size: 12px; font-weight: 700; margin: 4px 0 0; }

/* ── 共用元件 ───────────────────────────────────────── */
.btn {
    background: var(--panel-2); color: var(--ink); border: 1px solid #2c2d44; border-radius: 4px;
    padding: 7px 14px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: #4a4b68; }
.btn.pink { background: var(--pink); color: #1a0010; border-color: var(--pink); }
.btn.warn { color: var(--warn); border-color: #4a2030; }
.btn.ghost { background: transparent; }
.chip-btn {
    background: transparent; color: #c9c8da; border: 1px solid #2c2d44; border-radius: 3px;
    padding: 3px 8px; font-size: 11.5px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.chip-btn:hover { border-color: #4a4b68; color: var(--ink); }
.chip-btn.good { color: var(--green); border-color: #1d4a3a; }
.chip-btn.warn { color: var(--warn); border-color: #4a2030; }
.empty-hint { color: var(--ink-dim); font-size: 12.5px; padding: 12px 4px; text-align: center; }
.gem { display: inline-block; width: 9px; height: 9px; transform: rotate(45deg); background: var(--rar); box-shadow: 0 0 6px var(--rar); flex-shrink: 0; border-radius: 1px; }
.gem.lg { width: 12px; height: 12px; }
.gem.none { background: #2a2b3d; box-shadow: none; }
.tier-chip {
    display: inline-flex; align-items: center; gap: 5px; border: 1px solid color-mix(in srgb, var(--rar) 55%, transparent);
    color: var(--rar); border-radius: 3px; padding: 0 6px; font-size: 11px; font-weight: 800; font-family: var(--mono);
    background: color-mix(in srgb, var(--rar) 8%, transparent); line-height: 1.7;
}
.tier-chip .sub { font-family: var(--sans); font-weight: 700; opacity: 0.85; }
.tier-chip .cnt { color: var(--ink); opacity: 0.8; }
button.tier-chip { cursor: pointer; }
.tier-chip.on { background: var(--rar); color: #000; }
.tier-chip.all { --rar: #c9c8da; }
.price { font-family: var(--mono); color: var(--rar); font-weight: 800; }
.badge-closed, .badge-dead {
    font-size: 10.5px; border-radius: 2px; padding: 0 6px; font-weight: 700; white-space: nowrap;
}
.badge-closed { color: var(--warn); border: 1px solid #4a2030; }
.badge-dead { color: #000; background: #8a8aa3; }

/* ── 卡池一覽 ───────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
    background: #08080d; color: var(--ink); border: 1px solid #2c2d44; border-radius: 4px; padding: 7px 10px; font-size: 13px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.toggle.block { display: block; margin: 8px 0; }
.tier-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.hint { font-size: 11.5px; color: var(--ink-dim); margin-bottom: 10px; }
.rest-list { display: flex; flex-direction: column; gap: 6px; }
.rest-row { display: flex; gap: 10px; align-items: flex-start; background: var(--panel-2); border-radius: 4px; padding: 9px 10px; border-left: 2px solid var(--rar); }
.rest-row > .gem { margin-top: 6px; }
.rest-row.unavailable { opacity: 0.6; }
.rest-main { flex: 1; min-width: 0; }
.rest-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rest-name { font-weight: 800; font-size: 14px; }
.rest-sub { font-size: 12px; color: var(--ink-dim); }
.rest-g { font-size: 11px; color: #9fa0c0; }
.rest-note { font-size: 12px; color: #c9c8da; }
.rest-map { font-size: 12px; color: var(--pink); }
.rest-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.price-seg { display: flex; align-items: center; gap: 2px; }
.price-seg button {
    background: transparent; color: var(--ink-dim); border: 1px solid #2c2d44; font-family: var(--mono);
    font-size: 11px; padding: 1px 6px; cursor: pointer; border-radius: 2px;
}
.price-seg button.on { background: var(--rar); color: #000; border-color: var(--rar); font-weight: 800; }
.price-seg button.g { box-shadow: inset 0 -2px 0 var(--green); }
.price-seg .lock { font-size: 11px; margin-left: 2px; }
.icon-row { display: flex; gap: 3px; }
.icon-btn {
    background: transparent; border: 1px solid #2c2d44; color: var(--ink-dim); border-radius: 3px;
    width: 28px; height: 26px; cursor: pointer; font-size: 12px; font-weight: 800;
}
.icon-btn:hover { color: var(--ink); border-color: #4a4b68; }
.icon-btn.on { color: var(--gold); border-color: #5a4a1a; }
.icon-btn[data-act=google].on { color: var(--green); border-color: #1d4a3a; }
.admin summary { cursor: pointer; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 12px 0; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-dim); }
.field.inline { margin: 10px 0; }
.field.wide { grid-column: span 2; }
.field.narrow input { width: 70px; }
.admin-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.meal-list { display: flex; flex-direction: column; gap: 4px; }
.meal-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--panel-2); border-radius: 3px; }
.meal-item.skipped { opacity: 0.5; }
.meal-date { width: 86px; font-size: 12px; color: var(--ink-dim); }
.meal-name { flex: 1; font-weight: 700; }
.meal-note { font-size: 12px; color: var(--ink-dim); }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat-tile { background: var(--panel-2); border-radius: 4px; padding: 10px; }
.st-num { font-size: 24px; font-weight: 800; }
.st-label { font-size: 11.5px; color: var(--ink-dim); }
.stat-tile.warn .st-num { color: var(--warn); }
.stat-tile.good .st-num { color: var(--green); }
.stat-tile.dead .st-num { color: #8a8aa3; }
.tier-stack { display: flex; height: 14px; border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.tier-stack span { background: var(--rar); }
.tier-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.rot-list { display: flex; flex-direction: column; gap: 4px; }
.rot-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rot-row.unavailable { opacity: 0.55; }
.rot-name { width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rot-bar { flex: 1; height: 6px; background: #1c1d2c; border-radius: 1px; overflow: hidden; }
.rot-fill { display: block; height: 100%; background: var(--rar); }
.rot-days { width: 74px; text-align: right; font-size: 12px; color: var(--ink-dim); }
.wk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk-cell { background: var(--panel-2); border-radius: 4px; padding: 8px; text-align: center; }
.wk-cell.hot { box-shadow: inset 0 0 0 1px var(--warn); }
.wk-name { font-size: 12px; color: var(--ink-dim); }
.wk-num { font-size: 22px; font-weight: 800; }
.wk-sub { font-size: 11px; color: var(--ink-dim); }
.tier-table { width: 100%; border-collapse: collapse; }
.tier-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tier-table .rate { text-align: right; font-weight: 800; }
.rule-list { margin: 0; padding-left: 18px; }
.rule-list li { margin: 4px 0; }

/* ── 覆蓋層 / 對話框 / 翻卡 ─────────────────────────── */
#overlay {
    position: fixed; inset: 0; z-index: 1000; background: rgba(5, 5, 9, 0.82); backdrop-filter: blur(4px);
    display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 12px;
}
.dialog {
    position: relative; width: min(560px, 100%); background: var(--panel); border: 1px solid var(--pink);
    border-radius: var(--r); padding: 20px 20px 16px; box-shadow: 0 0 0 6px rgba(255, 79, 163, 0.15);
}
.hairline { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--pink); border-radius: var(--r) var(--r) 0 0; }
.dialog-title { margin: 0 0 12px; font-size: 18px; font-weight: 900; }
.dialog-hint { font-size: 12px; color: var(--ink-dim); margin: 6px 0; }
.dialog-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 14px; }
.recall-daterow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.recall-wd { color: var(--ink-dim); }
.recall-existing { font-size: 12px; color: var(--gold); margin-bottom: 8px; }
.recall-suggest {
    width: 100%; background: var(--green); color: #04150d; border: 0; border-radius: 4px; padding: 12px; font-size: 16px; font-weight: 900; cursor: pointer;
}
.recall-or { text-align: center; color: var(--ink-dim); font-size: 12px; margin: 10px 0; }
.recall-search { width: 100%; margin-bottom: 8px; flex: 1; }
.recall-list { display: flex; flex-direction: column; gap: 3px; max-height: 340px; overflow-y: auto; }
.recall-opt {
    display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid transparent; color: var(--ink);
    border-radius: 3px; padding: 7px 10px; cursor: pointer; text-align: left; font-size: 13px;
}
.recall-opt:hover, .recall-opt.on { border-color: var(--pink); }
.recall-opt-name { flex: 1; font-weight: 700; }
.recall-opt-sub { font-size: 11px; color: var(--ink-dim); }
.wday-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0; }
.wday-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel-2); border-radius: 3px; padding: 6px 2px; font-size: 12px; cursor: pointer; }
.hours-status { font-size: 12px; color: #c9c8da; margin-top: 8px; }
.g-hours { margin: 8px 0; font-size: 12px; }
.g-hours summary { cursor: pointer; color: var(--green); }
.g-current { background: var(--panel-2); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; }
.settings-map { height: 280px; border-radius: 4px; margin: 6px 0; }
.import-text { width: 100%; height: 160px; }

.reveal { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 10px; }
.reveal-title { font-size: 14px; font-weight: 800; letter-spacing: 0.14em; color: var(--pink); }
.reveal-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; opacity: 0; transition: opacity 0.3s; }
.reveal-btns.show { opacity: 1; }
.gcard { perspective: 1000px; cursor: pointer; }
.gcard.big { width: 290px; height: 410px; }
.gcard.mini { width: 150px; height: 214px; }
.gcard-inner { position: relative; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.gcard.flipped .gcard-inner { transform: rotateY(180deg); }
.gcard-back, .gcard-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 8px; overflow: hidden; }
.gcard-back {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: repeating-linear-gradient(45deg, #15101a 0 10px, #1b1222 10px 20px); border: 2px solid var(--pink);
    box-shadow: 0 0 34px -4px var(--rar);
}
.back-cap { font-weight: 800; letter-spacing: 0.3em; color: var(--pink); font-size: 12px; }
.gcard-face {
    transform: rotateY(180deg); background: linear-gradient(180deg, color-mix(in srgb, var(--rar) 16%, #0d0d14), #0d0d14 55%);
    border: 2px solid var(--rar); padding: 14px; display: flex; flex-direction: column; gap: 6px; text-align: center;
    box-shadow: 0 0 40px -6px var(--rar);
}
.rar-bar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--rar); }
.gcard-top { display: flex; align-items: center; gap: 6px; justify-content: center; }
.rar-chip { background: var(--rar); color: #000; font-family: var(--mono); font-weight: 900; padding: 0 6px; border-radius: 2px; font-size: 12px; }
.rar-name { font-weight: 800; color: var(--rar); }
.gcard-emoji { font-size: 54px; margin-top: 10px; }
.gcard.mini .gcard-emoji { font-size: 32px; margin-top: 4px; }
.gcard-name { font-size: 22px; font-weight: 900; word-break: break-all; }
.gcard.mini .gcard-name { font-size: 14px; }
.gcard-sub { font-size: 12px; color: var(--ink-dim); }
.gcard-meta { font-size: 11px; color: var(--green); }
.gcard.mini .gcard-sub, .gcard.mini .gcard-meta { font-size: 10px; }
.gcard-warn { font-size: 12px; color: var(--warn); font-weight: 700; }
.gcard-note { font-size: 12px; color: #c9c8da; }
.gcard-map { font-size: 12px; color: var(--pink); margin-top: auto; }
.multi-grid { display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: 12px; justify-content: center; max-width: 840px; }
.multi-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.multi-cell > .chip-btn { visibility: hidden; }
.multi-cell.open > .chip-btn { visibility: visible; }

.human {
    position: fixed; right: 16px; bottom: 16px; z-index: 1100; background: var(--panel); border: 1px solid var(--pink);
    border-radius: var(--r); padding: 10px;
}
.human-h { font-size: 11px; color: var(--pink); margin-bottom: 6px; }
body.busy .agent-card { cursor: default; }

/* SweetAlert2 配色 */
.swal2-popup { border: 1px solid var(--pink) !important; border-radius: var(--r) !important; }
.swal2-input, .swal2-textarea { background: #08080d !important; color: var(--ink) !important; border-color: #2c2d44 !important; }

/* ── 響應式：電腦為主，手機能用 ─────────────────────── */
@media (max-width: 1400px) {
    .tagline { display: none; }
}
@media (max-width: 1180px) {
    .desk-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .agents { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
    .agent-card { flex: 0 0 210px; scroll-snap-align: start; }
    .bottom-grid { grid-template-columns: 1fr; }
    .rot-meter { margin-left: 0; }
    .ticket { order: -1; }
}
@media (max-width: 560px) {
    .frame { padding: 6px; gap: 6px; }
    .brand-name, .brand-sub { font-size: 20px; }
    .meter { width: 90px; }
    .clock { font-size: 14px; }
    .code-line { grid-template-columns: 1fr auto; }
    .code-line .cc { grid-column: 1 / -1; padding-left: 8px; }
    .field.wide { grid-column: auto; }
    .rest-row { flex-wrap: wrap; }
    .rest-side { width: 100%; flex-direction: row; justify-content: space-between; }
    .rot-name { width: 120px; }
    .pool-seg.wide { grid-template-columns: repeat(3, 1fr); }
    .gcard.big { width: 260px; height: 380px; }
}

/* ── 低特效：關掉所有動畫 ───────────────────────────── */
[data-lowfx="1"] *, [data-lowfx="1"] *::before, [data-lowfx="1"] *::after {
    animation: none !important; transition: none !important;
}
