/* NB FAE 知識庫 — same look as the NB FAE Case Summary site; light/dark, desktop + phone */
:root {
  --red: #d71920; --red-ink: #b3121a; --red-soft: #fdecec; --red-line: #f6c9cb;
  --bg: #f4f5f7; --card: #ffffff; --ink: #17181c; --ink-2: #4a4d55; --muted: #80838c;
  --line: #e4e6ea; --tile: #f3f4f6; --field: #ffffff; --field-line: #d5d8de;
  --ok: #18794e; --ok-soft: #e6f4ec; --warn: #a15c00; --warn-soft: #fff3df; --blue: #1d5bd8; --blue-soft: #e8efff;
  --mark: #ffe58a; --mark-ink: #17181c;
  --shadow: 0 1px 2px rgba(16,18,24,.05), 0 6px 24px rgba(16,18,24,.06);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #ff4d55; --red-ink: #ff7a80; --red-soft: #3a1618; --red-line: #5c2427;
    --bg: #111215; --card: #1a1c20; --ink: #eceef2; --ink-2: #c3c6cd; --muted: #8d919a;
    --line: #2b2e34; --tile: #23262b; --field: #15171a; --field-line: #363a41;
    --ok: #5ad19a; --ok-soft: #12301f; --warn: #f0b45c; --warn-soft: #33260f; --blue: #7aa5ff; --blue-soft: #18233d;
    --mark: #6b5310; --mark-ink: #fff3cc;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 30px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --red: #ff4d55; --red-ink: #ff7a80; --red-soft: #3a1618; --red-line: #5c2427;
  --bg: #111215; --card: #1a1c20; --ink: #eceef2; --ink-2: #c3c6cd; --muted: #8d919a;
  --line: #2b2e34; --tile: #23262b; --field: #15171a; --field-line: #363a41;
  --ok: #5ad19a; --ok-soft: #12301f; --warn: #f0b45c; --warn-soft: #33260f; --blue: #7aa5ff; --blue-soft: #18233d;
  --mark: #6b5310; --mark-ink: #fff3cc;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 30px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--red); min-height: 1.4em; margin: 10px 0 0; font-size: 14px; }
.stack > * + * { margin-top: 14px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
mark { background: var(--mark); color: var(--mark-ink); border-radius: 3px; padding: 0 1px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--field-line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; height: 44px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px; font-weight: 600; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chip { display: inline-flex; align-items: center; gap: 6px; text-align: left; border: 1px solid var(--line); background: var(--tile); border-radius: 999px; padding: 4px 11px;
  margin: 4px 4px 0 0; cursor: pointer; font-size: 13px; text-decoration: none; color: var(--ink-2); }
.chip:hover { border-color: var(--red-line); background: var(--red-soft); }
.chip.on { border-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 700; }
.chip .n { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.chip.on .n { color: var(--red); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 500px at 85% -10%, var(--red-soft), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-title { margin: 6px 0 22px; font-size: 26px; line-height: 1.25; }
.fld { display: block; }
.fld > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input, select, textarea { width: 100%; border: 1px solid var(--field-line); background: var(--field); border-radius: 10px; padding: 9px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
input[type=radio], input[type=checkbox] { width: auto; accent-color: var(--red); }
.note-box { background: var(--warn-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.info-box { background: var(--blue-soft); color: var(--ink); border-left: 3px solid var(--blue); border-radius: 0 10px 10px 0; padding: 9px 14px; font-size: 13.5px; }

/* ---------- brand / topbar ---------- */
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--red); color: #fff;
  font: 800 11px/1 Arial, sans-serif; letter-spacing: .02em; flex: none; }
.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; margin-bottom: 18px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 20px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.topnav a:hover { background: var(--tile); }
.topnav a.on { color: var(--red); background: var(--red-soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--tile); cursor: pointer; font-weight: 700; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  text-decoration: none; cursor: pointer; font-size: 14px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--tile); }
.bottom-tabs { display: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 96px; }

/* ---------- hero card ---------- */
.hero { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--red) 22%, transparent), transparent 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 6px 0 4px; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
.hero .sub { margin: 0; color: var(--muted); font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tile { background: var(--tile); border-radius: 12px; padding: 10px 14px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- search ---------- */
.bigsearch { display: flex; gap: 10px; margin-top: 18px; }
.bigsearch .search { flex: 1; }
.search { position: relative; }
.search input { padding-left: 42px; height: 50px; font-size: 16px; border-radius: 12px; }
.search svg { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; }
.bigsearch .btn { height: 50px; padding: 0 22px; border-radius: 12px; font-size: 15px; }
.search-help { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.search-help code { font-family: var(--mono); background: var(--tile); padding: 0 5px; border-radius: 4px; }
.results-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; margin-top: 22px; align-items: start; }
.facets { position: sticky; top: 84px; display: grid; gap: 14px; max-height: calc(100vh - 100px); overflow: auto; padding-bottom: 8px; }
.facet h3 { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.facet .chip { margin: 4px 4px 0 0; }
.facet .more { font-size: 12.5px; color: var(--blue); background: none; border: 0; cursor: pointer; padding: 4px 0; }
.facet-list { display: grid; gap: 2px; }
.facet-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: none; border-radius: 8px;
  padding: 5px 8px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.facet-list button:hover { background: var(--card); }
.facet-list button.on { background: var(--red-soft); color: var(--red); font-weight: 700; }
.facet-list button .n { color: var(--muted); font-size: 12px; flex: none; }
.facet-list button.sub { padding-left: 22px; font-size: 13px; }
.result-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.result-bar .count { font-weight: 700; }
.result-bar select { width: auto; height: 36px; padding: 4px 10px; margin-left: auto; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.active-filters .chip { margin: 0; background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.results { display: grid; gap: 10px; }
.result { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; box-shadow: var(--shadow); }
.result:hover { border-color: var(--red-line); }
.result .r-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.result h2 { margin: 6px 0 4px; font-size: 17px; line-height: 1.4; }
.result .snip { margin: 0; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.result .r-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.result .r-meta b { color: var(--ink-2); font-weight: 600; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-card { background: var(--card); border: 1px dashed var(--field-line); border-radius: var(--radius); }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--tile); color: var(--ink-2); }
.badge.k-case { background: var(--red-soft); color: var(--red); }
.badge.k-spec { background: var(--blue-soft); color: var(--blue); }
.badge.k-notice { background: var(--warn-soft); color: var(--warn); }
.badge.k-doc { background: var(--ok-soft); color: var(--ok); }
.badge.Open { background: var(--blue-soft); color: var(--blue); }
.badge.Close { background: var(--ok-soft); color: var(--ok); }
.badge.Audit { background: var(--warn-soft); color: var(--warn); }
.badge.sev-重大 { background: var(--red-soft); color: var(--red); }
.cid { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.tagline { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 6px; background: var(--tile); color: var(--ink-2); text-decoration: none; }
a.tag:hover { background: var(--red-soft); color: var(--red); }

/* ---------- category browse ---------- */
.section-h { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.section-h h2 { margin: 0; font-size: 19px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cat-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; text-align: left; font-weight: 600; font-size: 14px; }
.cat-card:hover { border-color: var(--red-line); background: var(--red-soft); }
.cat-card .n { font-size: 13px; color: var(--muted); font-weight: 700; }

/* ---------- article view / form ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.art-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.art-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 22px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.card-h .sub { font-weight: 500; color: var(--muted); font-size: 13px; }
.card-b { padding: 14px 18px; }
.block { padding: 14px 18px; border-top: 1px solid var(--line); }
.block:first-child { border-top: 0; }
.block h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.block .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.block .txt a { color: var(--blue); }
.side dl { margin: 0; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px 10px; font-size: 13.5px; }
.side dt { color: var(--muted); font-weight: 600; }
.side dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.side .cid { white-space: normal; overflow-wrap: anywhere; }
.facet-toggle { display: none; }
.mail { border-top: 1px solid var(--line); padding: 10px 18px; font-size: 13.5px; }
.mail:first-child { border-top: 0; }
.mail .m-sub { font-weight: 600; overflow-wrap: anywhere; }
.mail .m-meta { color: var(--muted); font-size: 12.5px; }
.mail pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.55 var(--font); background: var(--tile); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; max-height: 420px; overflow: auto; }
.rev { display: flex; justify-content: space-between; gap: 8px; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 13px; }
.rev:first-child { border-top: 0; }
.rev button { flex: none; }

.frow { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 14px 18px; border-top: 1px solid var(--line); }
.frow:first-child { border-top: 0; }
.frow > .lab { font-weight: 700; font-size: 14px; padding-top: 8px; }
.frow > .lab .req { color: var(--red); margin-left: 2px; }
.frow > .lab .hint { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 4px; white-space: pre-line; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.links-edit { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px; }
.savebar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 16px; margin-top: 16px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.savebar .state { margin-right: auto; font-size: 13px; color: var(--muted); }

/* ---------- import ---------- */
.imp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 210px; padding: 20px;
  border: 2px dashed var(--field-line); border-radius: var(--radius); background: var(--card); cursor: pointer; text-align: center; color: var(--ink-2); }
.drop:hover, .drop.over { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.drop svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop strong { font-size: 16px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.paste-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.paste-card textarea { flex: 1; min-height: 150px; font-size: 13px; }
.paste-card .row { display: flex; gap: 8px; justify-content: flex-end; }
.imp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 10px; }
.imp-bar .sum { font-weight: 700; margin-right: auto; }
.imp-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.imp-item.is-skip { opacity: .6; }
.imp-item.is-dup { opacity: .7; }
.imp-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--tile); }
.imp-h .subj { font-weight: 700; overflow-wrap: anywhere; flex: 1 1 320px; min-width: 0; }
.imp-h .acts { display: flex; gap: 6px; align-items: center; }
.imp-h select { width: auto; height: 32px; padding: 2px 8px; font-size: 13px; }
.imp-meta { padding: 8px 16px 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.imp-b { padding: 12px 16px 16px; display: grid; gap: 10px; }
.imp-b .grid3 .fld > span, .imp-b .grid2 .fld > span { font-size: 12px; }
.imp-b textarea { min-height: 70px; font-size: 13.5px; }
.imp-note { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.imp-note.new { background: var(--ok-soft); color: var(--ok); }
.imp-note.upd { background: var(--blue-soft); color: var(--blue); }
.imp-note.dup { background: var(--tile); color: var(--muted); }
.imp-note.warn { background: var(--warn-soft); color: var(--warn); }
.imp-note.err { background: var(--red-soft); color: var(--red); }
.diff { display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr); gap: 0; font-size: 12.5px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.diff > div { padding: 5px 8px; border-top: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.diff > .h { background: var(--tile); font-weight: 700; color: var(--muted); border-top: 0; }
.diff .old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); }
.diff .new { color: var(--ink); background: color-mix(in srgb, var(--ok-soft) 70%, transparent); }
details.raw summary { cursor: pointer; font-size: 13px; color: var(--blue); }
details.raw pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 var(--font); background: var(--tile); padding: 10px; border-radius: 10px; max-height: 300px; overflow: auto; }
.done-list { display: grid; gap: 6px; }
.done-list a { color: var(--blue); }

/* ---------- admin ---------- */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.add-user { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr auto; gap: 10px; align-items: end; padding: 16px; border-bottom: 1px solid var(--line); }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--tile); padding: 10px 14px; white-space: nowrap; }
table.users td { padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.users select { padding: 5px 8px; }

/* ---------- dialog / toast ---------- */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
dialog.wide { width: min(900px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10,12,16,.45); }
.dlg { padding: 22px 24px; max-height: calc(100vh - 60px); overflow: auto; }
.dlg h2 { margin: 0 0 4px; font-size: 20px; }
.dlg .row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .results-layout, .art-grid { grid-template-columns: minmax(0, 1fr); }
  .facets { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); display: none;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 4px; }
  .facets.show { display: grid; }
  .results-layout { gap: 12px; }
  .facet-toggle { display: inline-flex; }
  .add-user { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topnav, .brand-text { display: none; }
  .wrap { padding: 16px 12px 96px; }
  .hero { padding: 20px 18px; }
  .hero h1 { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-hero .sub, .search-hero .tiles { display: none; }
  .search-hero h1 { font-size: 22px; }
  .bigsearch .btn { padding: 0 14px; }
  .imp-grid, .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .frow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .frow > .lab { padding-top: 0; }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row input:first-child { grid-column: 1 / -1; }
  .diff { grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); }
  table.users { display: block; overflow-x: auto; white-space: nowrap; }
  .bottom-tabs { display: grid; grid-template-columns: repeat(var(--tabs, 3), 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-tabs a { text-align: center; padding: 12px 4px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink-2); }
  .bottom-tabs a.on { color: var(--red); }
  .savebar { bottom: 58px; }
}
