/* 手機優先。字級與觸控目標都照一般人單手操作的尺寸設計，
   不做需要橫向捲動的寬表格。 */

:root {
  --fg: #111; --muted: #666; --line: #e3e3e3;
  --bg: #f7f7f8; --card: #fff;
  --green: #1a7f37; --green-bg: #eaf6ec; --green-line: #bfe3c6;
  --amber: #9a6700; --amber-bg: #fff6e5; --amber-line: #f0dcae;
  --red: #c92a2a; --red-bg: #fff5f2; --red-line: #f3c9bf;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 20px 16px calc(40px + env(safe-area-inset-bottom));
  font-family: system-ui, -apple-system, 'Segoe UI', 'Microsoft JhengHei',
    'PingFang TC', 'Noto Sans TC', sans-serif;
  line-height: 1.65;
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
}

.wrapper { max-width: 860px; margin: 0 auto; }

header { margin-bottom: 20px; }
h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.3px; }
.tagline { margin: 0; color: var(--muted); font-size: 14px; }
.ver { font-size: 12px; color: var(--muted); font-weight: 400; }

h2 { font-size: 17px; margin: 28px 0 10px; }
h3 { font-size: 15px; margin: 22px 0 10px; }

/* ---------------------------------------------------------------- 選檔 */

.pick {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px 20px; text-align: center;
}
.pick-btn {
  display: block; width: 100%; padding: 18px;
  border: 0; font-family: inherit; line-height: inherit;
  background: #111; color: #fff; border-radius: 12px;
  font-size: 17px; font-weight: 600; cursor: pointer;
}
.pick-btn:active { background: #333; }
.pick-btn:focus-visible { outline: 3px solid #4a76b8; outline-offset: 3px; }
.pick-hint { margin: 14px 0 0; font-size: 14px; color: #444; }
.privacy {
  margin: 16px 0 0; font-size: 13px; color: var(--green);
  background: var(--green-bg); border: 1px solid var(--green-line);
  border-radius: 10px; padding: 10px 12px; text-align: left;
}

.busy { text-align: center; padding: 40px 0; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--line); border-top-color: #111;
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.errbox {
  background: var(--red-bg); border: 1px solid var(--red-line);
  color: var(--red); border-radius: 12px; padding: 16px; margin-top: 16px;
  font-size: 14px;
}

/* ---------------------------------------------------------------- 結論 */

.hero {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; margin-bottom: 16px;
}
.hero.GREEN { background: var(--green-bg); border-color: var(--green-line); }
.hero.YELLOW { background: var(--amber-bg); border-color: var(--amber-line); }
.hero.RED { background: var(--red-bg); border-color: var(--red-line); }
.hero .status {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; margin-bottom: 10px;
}
.hero p { margin: 0; font-size: 15px; color: #333; }

.grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.card b { font-size: 12px; color: var(--muted); font-weight: 600; }
.card span { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.card small { color: var(--muted); font-size: 11px; }

.cols {
  display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 8px;
}
@media (min-width: 620px) { .cols { grid-template-columns: 1fr 1fr; } }
.box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px;
}
.box h3 { margin: 0 0 8px; font-size: 14px; }
.box ul { margin: 0; padding-left: 20px; }
.box li { margin: 5px 0; font-size: 13px; }
.yes h3 { color: var(--green); } .yes li::marker { content: '✓  '; }
.no h3 { color: var(--amber); } .no li::marker { content: '？  '; }

/* ---------------------------------------------------------------- 確認 */

.confirm {
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: 14px; padding: 18px; margin-bottom: 16px;
}
.confirm h3 { margin: 0 0 8px; color: var(--amber); }
.confirm p { margin: 0 0 12px; font-size: 14px; }
.confirm-btns { display: grid; gap: 8px; }
@media (min-width: 620px) { .confirm-btns { grid-template-columns: 1fr 1fr; } }

.btn {
  padding: 13px 16px; border-radius: 11px; font-size: 15px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font-family: inherit; cursor: pointer; font-weight: 500;
}
.btn:active { background: #f0f0f1; }
.btn.primary { background: #111; color: #fff; border-color: #111; }
.btn.wide { width: 100%; margin-top: 20px; }

/* 重新選擇帳單
   ------------
   之前是一顆純白按鈕，跟旁邊的白色卡片糊在一起，很容易被當成區塊標題滑過去。
   改成淡藍灰底加上比較明顯的外框，一眼就看得出是可以按的。
   不用紅色——這不是刪除，只是重新開始。 */
.btn.again {
  background: #eef2f7; border-color: #c3cede; color: #2f3d52;
  font-weight: 600;
}
.btn.again:hover { background: #e3eaf3; border-color: #aebdd2; }
.btn.again:active { background: #d8e2ee; }
.btn.again:focus-visible { outline: 2px solid #4a76b8; outline-offset: 2px; }
.btn.again small {
  display: block; margin-top: 3px;
  font-size: 12px; font-weight: 400; color: #5c6b80;
}
/* 上面那顆是 compact 版：只給一行字，不重複下面的說明 */
.again-top { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.again-top .btn.again { padding: 9px 14px; font-size: 13px; }
@media (max-width: 640px) {
  .again-top .btn.again { width: 100%; padding: 12px 14px; font-size: 14px; }
}
@media (min-width: 620px) {
  #again.btn.wide { width: auto; min-width: 280px; display: block; margin: 20px auto 0; }
}

/* 四個一樣大的按鈕會讓人以為四種格式一樣重要，其實不是：
   一般人要的是 Excel，CSV 偶爾用得到，HTML 適合直接閱讀與離線存檔。
   所以主按鈕放大，其餘往下收。 */
.actions { margin-top: 26px; }
.actions .btn.wide { margin-top: 4px; }
.actions .muted { margin: 6px 0 14px; }
.action-btns { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) {
  .action-btns { grid-template-columns: repeat(2, 1fr); }
}
.more-formats {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-top: 6px;
}
.more-formats > summary {
  cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600;
}
.more-formats .action-btns { margin-top: 12px; }
.more-formats .muted { margin: 10px 0 0; }

/* ---------------------------------------------------------------- 明細 */

.sum-ok {
  background: var(--green-bg); border: 1px solid var(--green-line);
  color: var(--green); border-radius: 12px; padding: 14px 16px;
  font-weight: 600; font-size: 15px;
}
.sum-warn {
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  color: var(--amber); border-radius: 12px; padding: 14px 16px;
  font-weight: 600; font-size: 15px;
}
.none {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; color: var(--green); font-size: 14px;
}

.atts { display: grid; gap: 12px; }
.att {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid #c9c9c9; border-radius: 14px; padding: 16px;
}
.att-short { border-left-color: var(--red); }
.att-unknown, .att-anomaly { border-left-color: #d9a300; }
.att-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; margin-bottom: 10px;
}
.att-head b { font-size: 16px; }
.att-head span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.att-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 14px;
}
.att-body div { display: flex; flex-direction: column; }
.att-body b { font-size: 12px; color: var(--muted); font-weight: 600; }
.att-body span { font-size: 15px; font-weight: 600; }
.att .gap { margin: 12px 0 0; color: var(--red); font-weight: 700; font-size: 15px; }
.att .why { margin: 12px 0 0; color: #555; font-size: 13px; }
.att-more { border: 0; background: transparent; padding: 10px 0 0; margin: 0; }
.att-more > summary { font-size: 12px; color: var(--muted); font-weight: 500; }

.allwrap {
  margin-top: 24px; background: var(--card); border: 2px solid #175fa7;
  border-radius: 18px; padding: 14px 16px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(23, 95, 167, .20);
}
.allwrap > summary {
  cursor: pointer; margin: -14px -16px 0; padding: 18px 18px;
  min-height: 64px; display: flex; align-items: center; gap: 12px;
  background: #175fa7; color: #fff;
  font-weight: 900; font-size: 18px; line-height: 1.35;
  list-style: none;
}
.allwrap > summary::-webkit-details-marker { display: none; }
.allwrap > summary::before {
  content: '＋'; flex: 0 0 32px; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #fff; color: #175fa7;
  font-size: 22px; font-weight: 900; line-height: 1;
}
.allwrap[open] > summary { margin-bottom: 14px; background: #124f8b; }
.allwrap[open] > summary::before { content: '−'; }
.allwrap-title { flex: 1 1 auto; min-width: 0; }
.allwrap-badge {
  flex: 0 0 auto; padding: 6px 10px; border-radius: 999px;
  background: #fff; color: #175fa7; font-size: 12px; font-weight: 800;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .allwrap > summary { flex-wrap: wrap; }
  .allwrap-badge { margin-left: 40px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; color: #333;
}
.chip.on { background: #111; color: #fff; border-color: #111; }

/* 排序與檢視控制 */
.grpnote { margin: 10px 0 0; }
.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 12px 0 4px;
}
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sort > span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.sort select {
  font-family: inherit; font-size: 14px; padding: 9px 12px; min-height: 42px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--fg); max-width: 100%;
}
.vchips { margin: 0; }
.chips .vchip { min-height: 38px; }
.none-rows { margin: 0; padding: 18px 14px; color: var(--muted); font-size: 14px; }

.thead, .trip > summary, .grp > summary {
  display: grid; gap: 8px; align-items: center; padding: 10px 12px;
  grid-template-columns: 1fr .78fr 1.25fr .78fr .92fr .8fr .8fr .92fr;
}
.thead {
  font-size: 12px; color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.rows { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trip, .grp {
  border: 0; border-bottom: 1px solid var(--line);
  /* 左側色帶掛在 .grp 本身，所以會自然地從組頭一路延伸到最後一張子單。
     單張也留同樣寬度的透明邊，兩者的文字才對得齊。 */
  border-left: 4px solid transparent;
  border-radius: 0; padding: 0; margin: 0;
}
.trip:last-child, .grp:last-child { border-bottom: 0; }
.thead { padding-left: 16px; }
.trip > summary, .grp > summary {
  cursor: pointer; font-size: 13px; font-weight: 400; list-style: none;
}
.trip > summary::-webkit-details-marker,
.grp > summary::-webkit-details-marker { display: none; }
.c-num { text-align: right; font-variant-numeric: tabular-nums; }
.c-res { text-align: right; font-size: 12px; }
.v-ok { color: var(--green); font-weight: 600; }
.v-bad { color: var(--red); font-weight: 700; }
.v-warn { color: var(--amber); font-weight: 600; }
/* 單張 / 疊單 N 筆
   ----------------
   顏色只是視覺分檔，永遠不是唯一線索：每一組都同時寫著「單張」或
   「疊單 N 筆」，而且 N 直接來自資料，不設上限。
   紅色一律留給少補與異常，疊單分類再怎麼樣都不能去搶它。 */
.c-tag {
  font-size: 12px; font-weight: 600; text-align: center;
  padding: 3px 8px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap; justify-self: start;
}
.thead .c-tag { padding: 0; border: 0; background: none; text-align: left; }
.t-single { background: #eef2f7; border-color: #d5dee9; color: #3f4c63; }
.t-stack2 { background: #fbeab8; border-color: #e6c76a; color: #6b4d00; }
.t-stackn { background: #e6dcf9; border-color: #c3aeea; color: #4a3184; }
.c-child {
  font-size: 11px; font-weight: 500; color: var(--muted);
  background: rgba(255, 255, 255, 0.72); border-color: rgba(0, 0, 0, 0.07);
}

/* 一整組從頭到尾都是同一個視覺身份
   ------------------------------
   之前只染組頭，子單又回到白底，結果疊單的最後一張和下一筆單張
   看起來像同一區塊。所以底色改成掛在整個 .grp 上：
   組頭深一階，子單淺一階，但都是同一個色系，
   而且左邊那條色帶會一路延伸到最後一張子單。 */
.grp-body { border-top: 1px solid rgba(0, 0, 0, 0.07); }
.grp-body .trip { border-bottom: 1px solid rgba(0, 0, 0, 0.06); border-left: 0; }
.grp-body .trip:last-child { border-bottom: 0; }
.grp-body .trip > summary { padding-left: 26px; }
.grp-body .trip > summary .c-when { color: #555; font-weight: 500; }

.grp > summary { font-weight: 500; }
.grp > summary .c-when { font-weight: 700; }
/* 一組結束就要看得出來結束了，下一筆才不會被讀成同一組 */
.grp { border-bottom: 3px solid #d8d8dd; }
.grp:last-child { border-bottom: 0; }

.grp[data-tier="stack2"] {
  background: #fdf6e0; border-left-color: #d9a520;
}
.grp[data-tier="stack2"] > summary { background: #f9ecc4; }
.grp[data-tier="stackn"] {
  background: #f4effc; border-left-color: #7c5cc4;
}
.grp[data-tier="stackn"] > summary { background: #e8ddf9; }

/* PDF 多單候選事件檢視：橘色=夾單候選，紫色=同分鐘多單。 */
.candwrap {
  margin: 18px 0 22px; border: 2px solid #d79a13; border-radius: 16px;
  overflow: hidden; background: #fffaf0; box-shadow: 0 6px 18px rgba(215,154,19,.14);
}
.candwrap > summary {
  list-style: none; cursor: pointer; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #f6c95f; color: #4d3500; font-weight: 900;
}
.candwrap > summary::-webkit-details-marker { display: none; }
.candwrap-title { font-size: 16px; }
.candwrap-badge {
  flex: 0 0 auto; padding: 5px 9px; border-radius: 999px;
  background: #6b4900; color: #fff; font-size: 12px; font-weight: 800;
}
.candwrap-note {
  margin: 0; padding: 10px 14px 0; color: #65542f; font-size: 13px; line-height: 1.55;
}
.candwrap-body { padding: 0 12px 12px; }

.cand-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 10px 0 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.cand-legend span {
  padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 800;
}
.cand-legend .leg-addon { background: #fbe7b2; color: #6b4900; }
.cand-legend .leg-same { background: #e8ddf8; color: #4b347f; }
.cand-legend small { flex-basis: 100%; color: var(--muted); line-height: 1.5; }

.cand {
  margin: 12px 0; border: 2px solid var(--line); border-left-width: 6px;
  border-radius: 14px; overflow: hidden; background: var(--card);
}
.cand > summary {
  cursor: pointer; list-style: none; display: grid;
  grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px;
}
.cand > summary::-webkit-details-marker { display: none; }
.cand-title { font-size: 16px; font-weight: 850; }
.cand-when { font-size: 13px; font-weight: 700; white-space: nowrap; }
.cand-why { grid-column: 1 / -1; font-size: 12px; line-height: 1.5; color: #5d5140; }
.cand-addon { border-left-color: #d79a13; }
.cand-addon > summary { background: #fff0c9; }
.cand-same { border-left-color: #8060c0; }
.cand-same > summary { background: #eee5fb; }
.cand-same .cand-why { color: #594777; }
.cand-proof {
  margin: 0; padding: 10px 14px 12px;
  background: rgba(255,255,255,.78);
  border-top: 1px solid rgba(0,0,0,.07);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.proof-row {
  display: grid; grid-template-columns: 74px minmax(0,1fr);
  gap: 4px 10px; padding: 4px 0; font-size: 13px; align-items: baseline;
}
.proof-row b { font-size: 12px; color: #555; }
.proof-row span:last-child { color: #555; }
.proof-verdict {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  font-size: 13px; font-weight: 850; line-height: 1.45;
  background: #fff3cf; color: #604200;
}
.cand-same .proof-verdict { background: #efe7fb; color: #4e367a; }
.cand-body { border-top: 1px solid rgba(0, 0, 0, .08); }
.cand-body .trip { border-left: 0; background: rgba(255,255,255,.72); }
.cand-body .trip:last-child { border-bottom: 0; }
.cand-body .trip > summary { padding-left: 16px; }
.c-role { font-size: 11px; font-weight: 800; }
.role-prior { background: #edf0f4; border-color: #d5dae2; color: #4e5868; }
.role-new { background: #f9df9e; border-color: #dcae38; color: #6a4800; }
.role-same { background: #e5d8f8; border-color: #bfa9e5; color: #4b347f; }

/* 有問題的組蓋掉疊單色：警示一定要比分類醒目 */
.grp[data-cat="short"] {
  background: var(--red-bg); border-left-color: var(--red);
}
.grp[data-cat="short"] > summary { background: #ffe7e0; }
.grp[data-cat="unknown"], .grp[data-cat="anomaly"] {
  background: var(--amber-bg); border-left-color: #d9a300;
}
.grp[data-cat="unknown"] > summary,
.grp[data-cat="anomaly"] > summary { background: #fdedcd; }

.trip[data-cat="short"] {
  border-left-color: var(--red); background: var(--red-bg);
}
.grp-body .trip[data-cat="short"] { box-shadow: inset 3px 0 0 var(--red); }

.tech {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 14px; padding: 12px 14px;
  /* 半透明白：展開的技術欄位會浮在所屬那一組的底色上，
     不會突然變成白色而看起來像是跳出了這一組 */
  background: rgba(255, 255, 255, 0.66);
  border-top: 1px solid rgba(0, 0, 0, 0.07); font-size: 12px;
}
.tech div { display: flex; flex-direction: column; }
.tech b { color: var(--muted); font-weight: 600; }
.tech span { word-break: break-all; }
.tech-note {
  margin: 0; padding: 0 14px 12px; background: rgba(255, 255, 255, 0.66);
  font-size: 12px; color: #555;
}
.att-more .tech { border: 1px solid var(--line); border-radius: 8px; }

/* 手機：表格改成卡片。
   不硬擠桌機那八欄——擠進去的結果是每一格都只剩三個字。
   改成一張一張的卡片，每個數字自己帶標籤，
   類型標籤跟時間並排放在最上面一行，一眼滑過去就知道疊了幾張。 */
@media (max-width: 640px) {
  .thead { display: none; }
  .rows { border-radius: 12px; }
  /* 兩個等寬欄，而且都允許縮到 0：
     用 auto 的話某一格的內容一長就把整列撐出畫面，手機會出現橫向捲動 */
  .trip > summary, .grp > summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 10px; padding: 12px 14px;
  }
  /* 標籤靠左、數字靠右，中間留一個絕不會被擠掉的間隔。
     用 grid 而不是 flex 的 space-between：後者在內容剛好填滿時
     間隔會歸零，標籤和金額就黏在一起了。 */
  .c-num {
    font-size: 14px; color: #222; font-weight: 600; min-width: 0;
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    gap: 10px; align-items: baseline; text-align: right;
  }
  .c-num::before {
    content: attr(data-l); color: var(--muted); font-weight: 400; font-size: 13px;
  }
  .c-when { font-weight: 700; font-size: 15px; grid-column: 1; min-width: 0; }
  .c-tag {
    grid-column: 2; justify-self: end; align-self: center;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  }
  .c-res {
    grid-column: 1 / -1; text-align: left; margin-top: 6px;
    padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px;
  }

  /* 手機上一整組就是一張卡片：同一個底色從組頭包到最後一張子單，
     組與組之間留白，滑過去不會把兩組看成一組。 */
  .rows { border: 0; border-radius: 0; overflow: visible; }
  .trip, .grp {
    border: 1px solid var(--line); border-left-width: 4px;
    border-radius: 12px; margin-bottom: 10px; overflow: hidden;
  }
  .trip:last-child, .grp:last-child { border-bottom: 1px solid var(--line); }
  .grp { border-bottom-width: 1px; margin-bottom: 18px; }
  .grp[data-tier="stack2"] { border-color: #e8cf8a; border-left-color: #d9a520; }
  .grp[data-tier="stackn"] { border-color: #cdbcee; border-left-color: #7c5cc4; }
  .grp[data-cat="short"], .trip[data-cat="short"] {
    border-color: var(--red-line); border-left-color: var(--red);
  }
  .grp[data-cat="unknown"], .grp[data-cat="anomaly"] {
    border-color: var(--amber-line); border-left-color: #d9a300;
  }
  .grp-body .trip {
    border: 0; border-radius: 0; margin: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  .grp-body { border-top: 0; }
  .grp-body .trip > summary { padding-left: 14px; }
  .grp-body .trip > summary .c-when { font-size: 13px; font-weight: 500; }

  .candwrap > summary { align-items: flex-start; }
  .candwrap-badge { white-space: nowrap; }
  .cand { margin-bottom: 16px; }
  .cand > summary { grid-template-columns: 1fr; gap: 3px; }
  .cand-when { white-space: normal; }
  .cand-why { grid-column: 1; }
  .cand-body .trip {
    border: 0; border-top: 1px solid rgba(0,0,0,.08);
    border-radius: 0; margin: 0;
  }
  .cand-body .trip:first-child { border-top: 0; }
  .cand-body .trip > summary { padding-left: 14px; }

  .controls { flex-direction: column; align-items: stretch; }
  .sort { flex-direction: column; align-items: stretch; gap: 5px; }
  .sort select { width: 100%; }
  .chips .vchip, .chips .chip { min-height: 40px; }
}

/* ---------------------------------------------------------------- 其他 */

.about {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 18px; margin-top: 18px;
}
.about > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.about-body { font-size: 14px; }
.about-body ul, .about-body ol { padding-left: 22px; }
.about-body li { margin: 6px 0; }

.muted { color: var(--muted); font-size: 13px; }
footer { margin-top: 30px; }

/* ---------------------------------------------------------- 使用前先知道 */

.before {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; margin-top: 16px;
}
.before h2 { margin: 0 0 10px; font-size: 16px; }
.ticks { margin: 0; padding: 0; list-style: none; }
.ticks li {
  font-size: 14px; margin: 8px 0; padding-left: 22px; position: relative;
}
.ticks li::before {
  content: '✓'; position: absolute; left: 0; color: var(--green);
  font-weight: 700;
}
.why { margin-top: 14px; }
.why > summary {
  cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500;
}
.why p { font-size: 13px; margin: 10px 0 0; }

/* ------------------------------------------------------------ 驗證範圍 */

.scope {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid #b8b8b8; border-radius: 12px;
  padding: 14px 16px; margin-top: 24px;
}
.scope h3 { margin: 0 0 6px; font-size: 14px; }
.scope p { margin: 0; font-size: 13px; color: #444; }

/* ------------------------------------------------------------ 支持開發 */

/* 刻意做得比稽核結果低調：沒有彈窗、沒有倒數、沒有強調色塊 */
.support {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; margin-top: 18px;
}
.support h2 { margin: 0 0 8px; font-size: 15px; }
.support p { font-size: 13px; margin: 6px 0; }
.support-price { font-weight: 600; color: #333; }
.support-btn { width: 100%; margin: 10px 0 8px; }
.support-btn:disabled {
  opacity: 0.55; cursor: not-allowed; background: var(--bg); color: var(--muted);
}

/* ------------------------------------------------------------ 服務資訊 */

.service-info {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; margin-top: 18px;
}
.service-info h2 { margin: 0 0 10px; font-size: 15px; }
.service-info dl {
  margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
  font-size: 13px;
}
.service-info dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.service-info dd { margin: 0; }

/* ------------------------------------------------ DEV 私人測試版專用樣式 */

/* DEV 橫幅。刻意用與正式版完全不同的暖橘色，
   讓人一眼就知道自己開的不是公開站，不必去讀網址列。 */
.devbar {
  margin: -20px -16px 18px;
  padding: 10px 16px calc(10px);
  background: repeating-linear-gradient(135deg,
    #7a2e00 0 14px, #8f3a06 14px 28px);
  color: #fff; font-size: 13px; line-height: 1.5;
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
}
.devbar b { font-size: 14px; letter-spacing: 0.5px; }
.devbar span { opacity: 0.92; }

.devtag {
  display: inline-block; vertical-align: 2px;
  background: #7a2e00; color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 1px 7px; border-radius: 6px; margin-left: 4px;
}

.devnote {
  margin: 0 0 12px; padding: 8px 12px; font-size: 13px;
  background: #fdf1e7; border: 1px solid #efc9a8; border-radius: 10px;
  color: #7a2e00;
}

.nav { margin: 8px 0 0; font-size: 14px; }
.nav a { color: #7a2e00; font-weight: 600; }

/* ------------------------------------------------ 接單紀錄頁 */

.note {
  margin: 12px 0; padding: 10px 14px; font-size: 14px;
  background: var(--green-bg); border: 1px solid var(--green-line);
  border-radius: 10px; color: #14532d;
}

.workday-rule, .summary, .limits, .pending {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin-top: 16px;
}
.workday-rule h2, .summary h2, .limits h2, .pending h3 {
  margin: 0 0 10px; font-size: 15px;
}
.workday-rule code, .pick-hint code, .empty code {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 5px; padding: 0 4px; font-size: 12px;
}

.kv {
  margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px;
  font-size: 13px;
}
.kv dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.totals dd { font-weight: 600; }

.day {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; margin-top: 12px; overflow: hidden;
}
.day > summary {
  cursor: pointer; padding: 14px 18px; font-size: 15px;
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  justify-content: space-between; align-items: baseline;
}
.day > summary .wd { font-weight: 600; }
.day > summary .n { color: var(--muted); font-size: 13px; }
.day-body { padding: 0 18px 16px; border-top: 1px solid var(--line); padding-top: 14px; }

.notes {
  margin: 12px 0 0; padding-left: 20px; font-size: 13px; color: var(--amber);
}

ol.times {
  margin: 14px 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 12px;
}
ol.times li {
  display: flex; gap: 10px; align-items: baseline;
  font-variant-numeric: tabular-nums; font-size: 13px;
  border-bottom: 1px dotted var(--line); padding: 3px 0;
}
ol.times .idx {
  color: var(--muted); font-size: 11px; min-width: 2.2em; text-align: right;
}
ol.times .t { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.issues {
  margin-top: 16px; padding: 12px 14px;
  background: var(--red-bg); border: 1px solid var(--red-line); border-radius: 10px;
}
.issues h4 { margin: 0 0 8px; font-size: 14px; color: var(--red); }
.issues ul { margin: 0; padding-left: 20px; font-size: 13px; }
.issues code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; overflow-wrap: anywhere;
}

.day-actions {
  margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 12px;
  align-items: center; font-size: 12px;
}
.btn.small { padding: 6px 12px; font-size: 13px; }

.pending { border-color: #efc9a8; background: #fdf8f4; }
.pending-state { margin: 0 0 8px; font-weight: 600; font-size: 15px; color: #7a2e00; }

.empty { padding: 18px 2px; }

/* ------------------------------------------------ DEMO 完整流程預覽 */

.demo-controls {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin-top: 16px;
}
.demo-controls h2 { margin: 0 0 10px; font-size: 15px; }

/* 警告要比任何數字都醒目。使用者不該有機會把 DEMO 當成核算結果。 */
.demo-warn {
  margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: #fff4e5; border: 2px solid #d97706; color: #7a2e00;
}
.demo-warn p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; }
.demo-warn p:last-child { margin-bottom: 0; }
.demo-warn-main { font-size: 15px !important; font-weight: 600; }
.demo-warn-more { font-weight: 600; }
.demo-warn-note { color: #92400e; }

/* 合成值一律加底線標記，讓人一眼看出哪些數字不是真的 */
.synthetic {
  border-bottom: 2px dotted #d97706; padding-bottom: 1px;
}

.demo-summary, .demo-orders {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; margin-top: 12px;
}
.demo-summary h3, .demo-orders h3 { margin: 0 0 4px; font-size: 16px; }
.demo-summary h4 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); }

.stats {
  margin: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.stats .stat {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  background: var(--bg);
}
.stats dt { font-size: 11px; color: var(--muted); }
.stats dd {
  margin: 2px 0 0; font-size: 16px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats .stat.ok { border-color: var(--green-line); background: var(--green-bg); }
.stats .stat.warn { border-color: var(--amber-line); background: var(--amber-bg); }
.stats .stat.headline { grid-column: 1 / -1; }
.stats .stat.headline dd { font-size: 24px; }

.demo-order {
  border: 1px solid var(--line); border-radius: 12px;
  margin-top: 8px; overflow: hidden; background: var(--bg);
}
.demo-order > summary {
  cursor: pointer; padding: 10px 14px; display: flex;
  gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.demo-order .tail {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}
.demo-order .amount {
  margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600;
}
.demo-order.ok { border-color: var(--green-line); }
.demo-order.warn { border-color: var(--amber-line); background: var(--amber-bg); }
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
}
.badge.ok { color: var(--green); border-color: var(--green-line); }
.badge.warn { color: var(--amber); border-color: var(--amber-line); }
.demo-order-body {
  padding: 12px 14px; border-top: 1px solid var(--line); background: var(--card);
  display: grid; gap: 12px;
}
.demo-order-body .kv dd small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.nocalc { margin: 0; }
.demo-foot { margin-top: 12px; font-size: 12px; }

/* DEMO 卡片標題：人看得懂的東西在前，識別碼收進技術詳細資料 */
.demo-order > summary {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title amount" "run badge";
  gap: 2px 10px; align-items: baseline;
}
.otitle {
  grid-area: title; font-weight: 600; font-size: 15px;
  overflow-wrap: anywhere;
}
.otitle .sep { color: var(--muted); font-weight: 400; margin: 0 1px; }
.demo-order .amount {
  grid-area: amount; margin-left: 0; font-size: 15px; white-space: nowrap;
}
.orun {
  grid-area: run; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.demo-order .badge { grid-area: badge; justify-self: end; align-self: center; }

.tech { margin-top: 4px; }
.tech > summary {
  cursor: pointer; font-size: 12px; color: var(--muted); padding: 4px 0;
}
.tech .kv { margin-top: 6px; font-size: 12px; }
.tech code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
}
.tech .kv dd small { margin-left: 6px; }
.namehint { margin: 0 0 10px; font-size: 12px; }

/* 有新版本的提示。放在最上面，但不擋住內容。 */
.sw-update {
  margin: -20px -16px 0; padding: 10px 16px;
  background: #1f2937; color: #fff; font-size: 13px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.sw-update .btn { background: #fff; color: #111; border-color: #fff; }

/* ------------------------------------------------ 每日統計換日時間 */

.setting {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin: 0 0 6px;
}
.setting label { font-weight: 600; font-size: 14px; }
.setting input[type="time"] {
  font: inherit; font-variant-numeric: tabular-nums;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--fg);
}
.warnbox {
  margin-top: 8px; padding: 8px 10px; font-size: 12px;
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: 8px; color: var(--amber);
}
.footnote { margin: 8px 0 0; font-size: 12px; }

/* ------------------------------------------------ 統計日／午夜分隔 */

.daysep {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 2px 6px; color: var(--muted); font-size: 12px;
}
.daysep::before, .daysep::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.daysep.major {
  font-weight: 600; color: #7a2e00; font-size: 13px; margin-top: 20px;
}
.daysep.major::before, .daysep.major::after { background: #efc9a8; }

/* ------------------------------------------------ 店名版面防護 */

/* 長店名最多兩行，而且不得把右側金額擠掉。
   無空格的超長字串（例如一整串英文店名）也必須斷得掉。 */
.otitle {
  min-width: 0;
  overflow-wrap: anywhere; word-break: break-word;
}
.mname {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; word-break: break-word;
}
.otitle .mtime { white-space: nowrap; }
.demo-order .amount { flex: none; }
.pending-amount { color: var(--amber); font-weight: 600; font-size: 13px; }


/* ---------------------------------------------------------------- 即時補差

   這一頁的讀者正站在路邊、單手拿手機。所以：
   金額要大到不用對焦、狀態燈只佔一行、其餘全部收起來。
   375px 是主要驗收寬度，不是「也要能看」的次要情境。 */

.content { margin: 0 0 18px; }

.nowcard {
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 14px;
}
.nowcard-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
}
.nowcard-title { font-size: 15px; margin: 0; color: var(--muted); font-weight: 600; }
.nowcard-sync { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.nowcard-label { margin: 12px 0 2px; font-size: 13px; color: var(--muted); }

/* 今天補多少。這是整頁唯一需要一眼看到的數字。
   用 tabular-nums，數字每 45 秒更新時位數才不會跳動。 */
.nowcard-amount {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
/* 還在等的時候不給數字。留白比一個假的 $0 好。 */
.nowcard-waiting {
  margin: 0; font-size: 22px; font-weight: 600; color: var(--amber);
  display: flex; align-items: center; gap: 8px;
}
.nowcard-counts { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.nowcard-kv { display: flex; gap: 18px; margin: 10px 0 0; flex-wrap: wrap; }
.nowcard-kv div { display: flex; gap: 6px; align-items: baseline; }
.nowcard-kv dt { font-size: 13px; color: var(--muted); margin: 0; }
.nowcard-kv dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.nowcard-stamp { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.nowcard .live-refresh { margin-top: 12px; font-size: 13px; padding: 6px 12px; }

.live-dot { width: 10px; height: 10px; border-radius: 50%;
            background: var(--muted); flex: none; }
.live-green { border-left-color: var(--green); }
.live-green .nowcard-sync .live-dot { background: var(--green); }
.live-green .nowcard-sync .live-label { color: var(--green); }
.live-amber { border-left-color: var(--amber); }
.live-amber .nowcard-sync .live-dot { background: var(--amber); }
.live-amber .nowcard-sync .live-label { color: var(--amber); }
.live-red { border-left-color: var(--red); background: var(--red-bg); }
.live-red .nowcard-sync .live-dot { background: var(--red); }
.live-red .nowcard-sync .live-label { color: var(--red); }
.live-grey { border-left-color: var(--line); }

/* 本期累計緊接今日，中間不插任何東西。 */
.period {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 14px;
}
.period h3 { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.period-amount {
  margin: 0 0 6px; font-size: 26px; font-weight: 700;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.period-note { font-size: 12px; }
.period-empty .muted { margin: 0; }

/* 異常。資料健康時整塊不出現，所以它一出現就是有事。 */
.exceptions {
  border: 1px solid var(--amber-line);
  background: var(--amber-bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.exceptions > summary { cursor: pointer; font-weight: 600; color: var(--amber); }
.exceptions-body { padding-top: 8px; }

/* 篩選。只做 UI 過濾，不動 matching state。 */
.filters { display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.filter {
  font: inherit; font-size: 13px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--fg); cursor: pointer;
}
.filter.on { border-color: var(--fg); font-weight: 600; }

/* 抽屜。預設收起，收起時整頁明顯變短。 */
.drawer {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 10px;
}
.drawer > summary {
  cursor: pointer; padding: 12px 14px; font-weight: 600;
  list-style: none;
}
.drawer > summary::after { content: ' ▾'; color: var(--muted); }
.drawer[open] > summary::after { content: ' ▴'; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer-body { padding: 0 14px 14px; }
.drawer-body h3 { font-size: 14px; margin: 16px 0 6px; }
.drawer .sub { margin-top: 12px; }
.drawer .sub > summary { cursor: pointer; font-size: 13px; color: var(--muted); }

.datasource {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-top: 14px;
}
.datasource > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.datasource-body { padding-top: 6px; }
.datasource-body .muted { font-size: 13px; }

/* DEMO 模式。整頁都是假資料，所以這條必須無法被忽略。 */
.demo-mode-bar {
  background: var(--amber-bg);
  border: 2px solid var(--amber);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: grid; gap: 6px;
}
.demo-mode-bar b { color: var(--amber); }
.demo-mode-bar .btn { justify-self: start; margin-top: 4px; }

@media (max-width: 420px) {
  .nowcard-amount { font-size: 34px; }
  .nowcard-top { flex-wrap: nowrap; }
  .nowcard-sync { font-size: 12px; }
}

/* 測試期橫幅。整頁最重要的一句話，所以它不可摺疊、不可關閉。 */
.prelive-bar {
  display: grid; gap: 6px;
  background: var(--amber-bg);
  border: 2px solid var(--amber);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.prelive-bar b { color: var(--amber); }
.prelive-bar .muted { font-size: 13px; }

/* 「報告排隊中」。它回答的是「我要不要現在回家處理」，所以不能藏。 */
.nowcard-autogen { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.nowcard-autogen.warn { color: var(--red); font-weight: 600; }

/* Live semantic colors are presentation only; matching/trust values stay unchanged. */
.live-orders .live-card { border-left-width: 4px; }
.live-orders .live-card > summary {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title amount" "run toggle";
  padding: 13px 12px; gap: 5px 8px;
}
.live-orders .live-card .orun { min-width: 0; overflow-wrap: anywhere; }
.live-orders .live-expand { grid-area: toggle; justify-self: end; color: var(--muted); }
.live-orders .live-card[open] > summary .live-expand { transform: rotate(180deg); }
.live-orders .live-tone-green { --tone-border: #478863; --tone-bg: #f8fcf9; --tone-amount: #167048; }
.live-orders .live-tone-orange { --tone-border: #ba6826; --tone-bg: #fff8f0; --tone-amount: #a34b08; }
.live-orders .live-tone-purple { --tone-border: #8555b5; --tone-bg: #f7f1fc; --tone-amount: #643197; }
.live-orders .live-tone-yellow { --tone-border: #99831b; --tone-bg: #fffdeb; --tone-amount: #79620c; }
.live-orders .live-card { border-color: var(--tone-border); background: var(--tone-bg); }
.live-orders .live-card > summary .amount,
.live-orders .live-card .live-group-total { color: var(--tone-amount); }
/* The group frame keeps its tone while expanded; children keep the neutral body. */
.live-orders .live-group-child { color: var(--fg); background: var(--card); }
@media (prefers-color-scheme: dark) {
  body[data-mode="live"] {
    color-scheme: dark;
    --fg: #f0f0f2; --muted: #b5b7bd; --line: #555761;
    --bg: #15171b; --card: #202227;
    --green: #86caa4; --green-bg: #182d23; --green-line: #6dae88;
    --amber: #efd08c; --amber-bg: #352b19; --amber-line: #bda447;
    --red: #ffaaaa; --red-bg: #382023; --red-line: #bd7478;
  }
  body[data-mode="live"] .live-tone-green { --tone-border: #6dae88; --tone-bg: #182d23; --tone-amount: #86caa4; }
  body[data-mode="live"] .live-tone-orange { --tone-border: #cb8e58; --tone-bg: #352619; --tone-amount: #ffbb80; }
  body[data-mode="live"] .live-tone-purple { --tone-border: #ab7dde; --tone-bg: #30203f; --tone-amount: #d5adff; }
  body[data-mode="live"] .live-tone-yellow { --tone-border: #bda447; --tone-bg: #302b16; --tone-amount: #ebd36c; }
  body[data-mode="live"] .live-orders .tech { background: var(--bg); }
}
.live-group-children { display: grid; gap: 0; min-width: 0; }
.live-group-child {
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  grid-template-areas: "name exact" "run run"; gap: 4px 8px;
  padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0;
}
.live-group-child:first-child { padding-top: 0; }
.live-group-child .mname { grid-area: name; min-width: 0; font-size: 14px; font-weight: 600; }
.live-group-child .orun { grid-area: run; }
.live-child-exact { grid-area: exact; color: #167048; font-weight: 600; white-space: nowrap; }
.live-group-summary { margin: 0; }
.live-group-total { font-weight: 700; }
/* Keep one visible group total: header while collapsed, summary while expanded. */
.live-group[open] > summary .live-group-header-amount { visibility: hidden; }
.live-orders .tech { display: block; min-width: 0; }
.live-orders .tech .kv { display: grid; }
.live-orders .tech code, .live-orders .tech dd { overflow-wrap: anywhere; min-width: 0; }
.live-orders .offer-line { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 400; color: var(--muted); }

/* Daily reading: amounts keep their column; merchant names use the remaining width. */
.live-group .otitle { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.live-group .amount { white-space: nowrap; align-self: start; }
.group-names-wide { display: none; }
.group-more { white-space: nowrap; }
.live-date-label { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 14px; }
.live-date-label select { font: inherit; min-height: 44px; padding: 8px 30px 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); }
.nowcard-updated { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.stale-warning { margin: 8px 0; padding: 10px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); font-size: 13px; line-height: 1.5; }
.daily-list { margin-top: 12px; border-top: 1px solid var(--line); }
.daily-list > summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.daily-row { display: grid; width: 100%; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 4px 8px; font: inherit; font-size: 14px; text-align: left; padding: 12px 0; min-height: 52px; border: 0; border-top: 1px solid var(--line); color: var(--fg); background: transparent; cursor: pointer; }
.daily-row strong { text-align: right; white-space: nowrap; }
.daily-row small { grid-column: 2 / -1; text-align: right; color: var(--muted); }
.summary-only { padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.live-orders .filters { flex-wrap: wrap; }
.live-orders .filter { min-height: 44px; }
@media (min-width: 680px) {
  .group-names-wide { display: inline; }
  .group-names-narrow { display: none; }
}
