/* Advantech AI Selector — shared styles for the wizard and the admin console. */

:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #dfe3e8;
  --line-soft: #eceff3;
  --ink: #1b2027;
  --ink-2: #5a636e;
  --ink-3: #8b949f;
  --brand: #d0021b;
  --brand-ink: #ffffff;
  --brand-soft: #fdeced;
  --ok: #1a7f4b;
  --ok-soft: #e7f5ed;
  --warn: #9a6300;
  --warn-soft: #fdf3e0;
  --bad: #b3261e;
  --bad-soft: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px -16px rgba(16,24,40,.28);
  --font: "Inter", "Noto Sans TC", "Noto Sans JP", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Microsoft JhengHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --surface: #191d23;
    --surface-2: #1f242b;
    --line: #2c333c;
    --line-soft: #242a31;
    --ink: #e8ebef;
    --ink-2: #a6b0bb;
    --ink-3: #78828d;
    --brand: #ff5f6d;
    --brand-ink: #24070a;
    --brand-soft: #33191c;
    --ok: #56cc8f;
    --ok-soft: #13291f;
    --warn: #e0ac54;
    --warn-soft: #2c2314;
    --bad: #ff8177;
    --bad-soft: #2e1817;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -18px rgba(0,0,0,.9);
  }
}

* { box-sizing: border-box; }

/* A class that sets `display` outranks the browser's own [hidden] rule, so the
   hidden attribute silently stops working on .board, .btn and friends. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- chrome */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 12px; font-weight: 640;
  letter-spacing: -.01em; text-decoration: none; color: inherit;
}
.brand .logo { height: 22px; width: auto; display: block; flex: none; }
.brand-rule { width: 1px; height: 22px; background: var(--line); flex: none; }

/* Official raster assets usually ship on a white background. Add
   class="logo logo--plate" to the <img> to sit them on a white card so they
   stay legible in the dark theme. */
.brand .logo--plate {
  background: #fff; padding: 4px 7px; border-radius: 6px; height: 30px;
}
.brand small { display: block; font-weight: 450; font-size: 12px; color: var(--ink-3); }
.spacer { flex: 1 1 auto; }

.seg { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.seg button {
  border: 0; background: transparent; padding: 4px 10px; border-radius: 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 560; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 560; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- layout */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

.shell { max-width: 1600px; margin: 0 auto; padding: 0 24px; }
main.shell { padding-top: 22px; padding-bottom: 48px; }

/* Two layouts, chosen by the reader: "wide" puts the conditions in a bar above
   a full-width product grid; "split" is the earlier side-by-side view. */
.stage { display: block; }
.qcol { display: none; }

body[data-layout="split"] .stage {
  display: grid; grid-template-columns: 380px minmax(0, 1fr);
  gap: 22px; align-items: start;
}
body[data-layout="split"] .qcol {
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 112px; max-height: calc(100vh - 132px); overflow: auto;
  padding-right: 2px;
}
body[data-layout="split"] .conds { display: none; }
body[data-layout="split"] #btn-board { display: none; }
body[data-layout="split"] .condwrap { justify-content: flex-end; padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 1100px) {
  body[data-layout="split"] .stage { grid-template-columns: minmax(0, 1fr); }
  body[data-layout="split"] .qcol { position: static; max-height: none; }
}

.seg.layouts button { display: grid; place-items: center; padding: 4px 9px; }
.seg.layouts svg { width: 15px; height: 13px; display: block; }
.seg.layouts .lf { fill: currentColor; opacity: .32; }
.seg.layouts .ls { fill: currentColor; opacity: .85; }
.seg.layouts button[aria-pressed="true"] { color: var(--brand); background: var(--surface); }

/* question cards for the split layout */
.q { padding: 15px 16px; }
.q h2 { font-size: 14.5px; margin: 0 0 3px; letter-spacing: -.01em; }
.q .help { margin: 0 0 11px; font-size: 12.5px; color: var(--ink-2); }
.q .tag {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 7px; margin-left: 7px; vertical-align: 2px; font-weight: 500;
}

/* ------------------------------------------------------------ condition bar */

.condbar {
  position: sticky; top: 53px; z-index: 30;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.condwrap { display: flex; align-items: flex-start; gap: 14px; padding-top: 11px; padding-bottom: 11px; }
.conds { display: flex; flex-wrap: wrap; gap: 7px; flex: 1 1 auto; min-width: 0; }

.cond {
  display: inline-flex; align-items: baseline; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 999px; padding: 5px 13px; max-width: 100%;
}
.cond:hover { border-color: var(--ink-3); }
.cond[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cond .ck { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.cond .cv {
  font-size: 13px; font-weight: 560; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 22ch;
}
.cond.empty { border-style: dashed; background: transparent; }
.cond.empty .cv { font-weight: 450; color: var(--ink-3); }
.cond.lead { border-color: var(--brand); background: var(--brand-soft); }
.cond.lead .ck { color: color-mix(in srgb, var(--brand) 75%, var(--ink)); }
.cond.lead .cv { color: var(--brand); font-weight: 600; }

.sizebtn { flex: none; font-variant-numeric: tabular-nums; }
.sizebtn b { color: var(--brand); }

/* popover holding one question's options */
.pop {
  position: fixed; z-index: 60; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 48px -18px rgba(8, 10, 14, .45); width: min(560px, calc(100vw - 24px));
  padding: 16px 18px 18px; max-height: min(74vh, 620px); overflow: auto;
}
.pop h2 { font-size: 15px; margin: 0 0 3px; letter-spacing: -.01em; }
.pop .help { margin: 0 0 13px; font-size: 12.5px; color: var(--ink-2); }
.pop .tag {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 7px; margin-left: 7px; vertical-align: 2px; font-weight: 500;
}
.pop .clear { margin-top: 12px; }

.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  display: inline-flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 9px; padding: 7px 12px; cursor: pointer; text-align: left; max-width: 100%;
}
.pill:hover { border-color: var(--ink-3); }
.pill[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.pill .l { font-size: 13.5px; }
.pill .h { font-size: 11.5px; color: var(--ink-2); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 9px; }
.opt-card {
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 10px; padding: 11px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 7px;
}
.opt-card:hover { border-color: var(--ink-3); }
.opt-card[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.opt-card .l { font-size: 13px; font-weight: 560; line-height: 1.35; }
.opt-card .h { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }

svg.art { width: 100%; height: auto; display: block; }
svg.art-icon { width: 40px; height: 36px; }
.a-frame { fill: color-mix(in srgb, var(--ink) 4%, transparent); stroke: var(--line); }
.a-corner { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
.a-fill { fill: color-mix(in srgb, var(--ink) 55%, transparent); }
.a-bg { fill: color-mix(in srgb, var(--surface) 90%, transparent); }
.a-box { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 4 3; }
.a-stroke { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.opt-card .a-stroke { color: var(--ink-2); }
.opt-card[aria-pressed="true"] .a-stroke { color: var(--brand); }
.opt-card[aria-pressed="true"] .a-fill { fill: var(--brand); }

/* ------------------------------------------------- floating question board */

.board {
  position: fixed; z-index: 70;
  width: 430px; height: min(600px, 78vh);
  min-width: 300px; min-height: 160px;
  max-width: calc(100vw - 20px); max-height: calc(100vh - 20px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 26px 70px -22px rgba(8, 10, 14, .55), 0 2px 8px rgba(8, 10, 14, .12);
  resize: both;
}
.board.min { height: auto !important; min-height: 0; resize: none; }
.board.dragging { user-select: none; }

.board-head {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); cursor: grab; touch-action: none; flex: none;
}
.board.dragging .board-head { cursor: grabbing; }
.board.min .board-head { border-bottom: 0; }
.board-head strong { font-size: 13.5px; }
.board-head .btn { padding: 2px 9px; font-size: 14px; line-height: 1.2; }
.board-prog { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.grip {
  width: 11px; height: 14px; flex: none; opacity: .5;
  background-image: radial-gradient(currentColor 1px, transparent 1.2px);
  background-size: 5px 5px; color: var(--ink-3);
}

.board-body { padding: 4px 14px 14px; overflow: auto; flex: 1; }
.board.min .board-body { display: none; }

.bq { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.bq:last-child { border-bottom: 0; }
.bq h3 {
  font-size: 12px; margin: 0 0 6px; font-weight: 620;
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
}
.bq h3 .full { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.bq.done h3 { color: var(--ink); }
.bq.todo h3 { color: var(--ink-2); }
.bq.todo h3::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); flex: none; align-self: center;
}
.bopts { display: flex; flex-wrap: wrap; gap: 5px; }
.bopt {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 7px; padding: 3px 9px; font-size: 12px; text-align: left;
}
.bopt:hover { border-color: var(--ink-3); }
.bopt[aria-pressed="true"] {
  border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand); font-weight: 560;
}
.bopt svg.art { width: 30px; height: 21px; flex: none; }
.bopt svg.art-icon { width: 18px; height: 16px; flex: none; }

@media (max-width: 640px) {
  .board { width: calc(100vw - 20px); height: min(70vh, 560px); resize: none; }
}

/* ---------------------------------------------------------------- results */

.sechead {
  display: flex; align-items: baseline; gap: 10px;
  margin: 26px 0 13px; font-size: 15px; font-weight: 620; letter-spacing: -.01em;
}
.sechead:first-child { margin-top: 4px; }
.sechead .n { font-size: 13px; font-weight: 450; color: var(--ink-3); }
.sechead .why { font-size: 12.5px; font-weight: 450; color: var(--ink-2); }

.pgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 16px; align-items: stretch;
}

.pcard {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.pcard:hover { border-color: var(--ink-3); }
.pcard.blocked { opacity: .78; }
.pcard.blocked:hover { opacity: 1; }
/* the product link stretches over the whole card */
.pcard .plink { text-decoration: none; color: inherit; }
.pcard .plink::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pcard:hover .plink .nm { color: var(--brand); }
.pcard .pfoot { position: relative; z-index: 2; }

.shot {
  height: 168px; background: #fff; display: grid; place-items: center;
  border-bottom: 1px solid var(--line-soft); position: relative; overflow: hidden;
}
.shot img { max-width: 84%; max-height: 84%; object-fit: contain; display: block; }
.shot.empty::after {
  content: attr(data-sku); font-family: var(--mono); font-size: 13px;
  color: #9aa4b0; letter-spacing: .04em;
}
.rank {
  position: absolute; top: 9px; left: 9px; z-index: 1;
  background: var(--ink); color: var(--bg); border-radius: 999px;
  font-size: 11px; font-weight: 650; padding: 2px 8px; font-variant-numeric: tabular-nums;
}

.pbody { padding: 13px 15px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pcard .nm { font-weight: 620; font-size: 14px; line-height: 1.35; display: block; }
.pcard .sku { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; margin-top: 3px; }
.pcard .cat { font-size: 11.5px; color: var(--ink-3); }

.pspecs { display: flex; flex-wrap: wrap; gap: 5px; }
.pspecs span {
  font-size: 11px; border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 8px; color: var(--ink-2); background: var(--surface-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pspecs b { color: var(--ink); font-weight: 600; }

.score { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 3px; }
.bar { flex: 1; height: 5px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.pcard.blocked .bar i { background: var(--ink-3); }
.score .pct { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 32px; text-align: right; }

.blockers { font-size: 11.5px; color: var(--bad); line-height: 1.45; }
.perfnote {
  font-size: 11px; color: var(--ink-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.modfit { font-size: 11.5px; color: var(--ink-2); }
.modfit.ok { color: var(--ok); }

.pfoot {
  border-top: 1px solid var(--line-soft); padding: 9px 15px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.pfoot a { font-size: 11.5px; color: var(--ink-2); }
details.why summary {
  font-size: 11.5px; color: var(--ink-3); cursor: pointer; list-style: none;
}
details.why summary::-webkit-details-marker { display: none; }
details.why summary::before { content: "▸ "; }
details.why[open] summary::before { content: "▾ "; }
.reason { display: flex; gap: 7px; font-size: 11.5px; padding: 3px 0; align-items: baseline; }
.reason .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; margin-top: 4px; }
.reason.pass .dot { background: var(--ok); }
.reason.fail .dot { background: var(--bad); }
.reason.unknown .dot { background: var(--ink-3); opacity: .5; }
.reason .rk { color: var(--ink-2); }
.reason .rv { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3); text-align: right; }
.reason.fail .rv { color: var(--bad); }

.splash {
  border: 1px dashed var(--line); border-radius: 12px; padding: 26px 24px;
  color: var(--ink-2); font-size: 14px; line-height: 1.6; margin-bottom: 22px;
  background: var(--surface-2);
}
.splash strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 5px; letter-spacing: -.01em; }
.empty { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* -------------------------------------------------- sizing report (dialog) */

.metric { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.metric:last-child { border-bottom: 0; }
.metric .k { font-size: 13px; color: var(--ink-2); }
.metric .v { font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; text-align: right; }
.metric .v .u { font-weight: 450; font-size: 12px; color: var(--ink-3); margin-left: 3px; }
.metric .n { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.dlgsec { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 620; margin: 22px 0 6px; }
.dlgsec:first-child { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 9px; background: var(--surface-2); color: var(--ink-2);
}
.chip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.warnlist { display: flex; flex-direction: column; gap: 8px; }
.warnitem {
  font-size: 13px; line-height: 1.5; color: var(--ink);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 8px; padding: 9px 11px;
}

@media (max-width: 640px) {
  .shell { padding: 0 14px; }
  .condbar { position: static; }
  .cond .cv { max-width: 14ch; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 11px; }
  .shot { height: 118px; }
}

/* ---------------------------------------------------------------- admin */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  border: 0; background: transparent; padding: 9px 14px; cursor: pointer;
  font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 560; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
table.grid tr:hover td { background: var(--surface-2); }
table.grid td.num { font-variant-numeric: tabular-nums; text-align: right; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.field input[type=text], .field input[type=number], .field input[type=password],
.field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2);
}
.field textarea { min-height: 74px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.field.row { display: flex; align-items: center; gap: 8px; }
.field.row > span { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

dialog {
  border: 1px solid var(--line); border-radius: 12px; padding: 0;
  background: var(--surface); color: var(--ink); max-width: 860px; width: calc(100% - 32px);
  box-shadow: 0 24px 64px -24px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(8,10,14,.5); backdrop-filter: blur(2px); }
dialog .dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
dialog .dlg-head h2 { margin: 0; font-size: 16px; }
dialog .dlg-body { padding: 20px; max-height: min(68vh, 640px); overflow: auto; }
dialog .dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.attrgroup { border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 12px; }
.attrgroup > summary { padding: 10px 14px; cursor: pointer; font-weight: 560; font-size: 13.5px; }
.attrgroup > div { padding: 0 14px 12px; }
.multibox { display: flex; flex-wrap: wrap; gap: 6px; }
.multibox label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; background: var(--surface-2); cursor: pointer; }
.multibox input { margin: 0; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; box-shadow: var(--shadow); z-index: 90;
}
.muted { color: var(--ink-3); }
.err { color: var(--bad); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
/* never put display:flex on a <td> - it drops the cell out of table layout */
.rowbtns { display: flex; gap: 4px; justify-content: flex-end; }
table.grid td:has(> .rowbtns) { white-space: nowrap; width: 1%; }

@media print {
  .topbar, .btn, .seg, .pfoot { display: none !important; }
  .condbar { position: static; border: 0; }
  .cond { border-color: #ccc; }
  .pgrid { grid-template-columns: repeat(3, 1fr); }
  .pcard { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
