/* BGNU Library — design tokens first, then layout, then components. */
:root {
  --navy-900: #0c2747; --navy-800: #123760; --navy-700: #173f6f; --navy-600: #25598f; --navy-100: #e3ecf6; --navy-50: #f0f5fa;
  --brass-600: #9a7420; --brass-500: #b58a2a; --brass-100: #f6ecd2;
  --bg: #f5f4f0; --surface: #fff; --surface-2: #faf9f6; --ink: #17212b; --ink-2: #4a5866; --ink-3: #7a8794; --line: #e3e0d8; --line-2: #eeece6;
  --ok: #1f7a55; --ok-bg: #e3f4ec; --warn: #8a5f0b; --warn-bg: #fbf0d3; --bad: #a82f2f; --bad-bg: #fbe6e4; --info: #25598f; --info-bg: #e3ecf6;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(20,39,58,.06), 0 4px 14px rgba(20,39,58,.05); --shadow-lg: 0 10px 40px rgba(12,39,71,.18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --focus: 0 0 0 3px rgba(37,89,143,.35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1722; --surface: #16202e; --surface-2: #1a2636; --ink: #e8edf3; --ink-2: #b4c0cd; --ink-3: #8593a2; --line: #2a384a; --line-2: #223044;
    --navy-100: #1c3452; --navy-50: #17263a; --brass-100: #3a2f15;
    --ok-bg: #12382a; --warn-bg: #3b2e0e; --bad-bg: #421b1b; --info-bg: #17304d; --ok: #55c795; --warn: #e6b24e; --bad: #f08a8a; --info: #7db4e8;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--navy-600); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.muted { color: var(--ink-3); } .small { font-size: .85rem; } .strong { font-weight: 650; } .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy-700); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; } .skip:focus { left: 8px; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 1rem; } .stack-sm > * + * { margin-top: .5rem; }
.grid { display: grid; gap: 1rem; } .cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0,1fr); } }

/* ── Staff shell ─────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy-900); color: #c6d4e4; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 18px 12px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; color: #fff; text-decoration: none !important; }
.brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 1px; }
.brand b { display: block; font-size: .98rem; letter-spacing: .01em; } .brand span { font-size: .74rem; color: #93a8c0; letter-spacing: .06em; text-transform: uppercase; }
.nav-group { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: #6f87a3; padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: #c6d4e4; font-size: .93rem; text-decoration: none !important; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; } .nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--brass-500); }
.nav .pill { margin-left: auto; background: var(--brass-500); color: #1b1405; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.side-foot .who { display: flex; gap: 10px; align-items: center; } .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-600); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: .82rem; flex: none; }
.side-foot button { background: none; border: 0; color: #93a8c0; cursor: pointer; padding: 6px 0 0; font: inherit; } .side-foot button:hover { color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .search { max-width: 460px; }
.btn.menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; } .page-head p { margin: 4px 0 0; color: var(--ink-2); }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0,1fr); } .side { position: fixed; inset: 0 auto 0 0; height: auto; width: 270px; max-width: 86vw; z-index: 40; transform: translateX(-102%); visibility: hidden; transition: transform .2s, visibility .2s; }
  body.nav-open .side { transform: none; visibility: visible; box-shadow: var(--shadow-lg); } body.nav-open .shell::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; } body.nav-open:has(.shell) { overflow: hidden; }
  .btn.menu-btn { display: inline-flex; } .content { padding: 18px 16px 50px; } .topbar { padding: 10px 16px; }
}

/* ── Public shell ────────────────────────────── */
.pub-head { background: var(--navy-800); color: #fff; }
.pub-head .in { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.pub-head .brand { padding: 0; } .pub-head nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pub-head nav a { color: #d4e0ee; padding: 7px 12px; border-radius: 8px; font-size: .92rem; text-decoration: none !important; } .pub-head nav a:hover, .pub-head nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 20px 70px; }
.hero { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; padding: 56px 20px 64px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 340px; height: 340px; border-radius: 50%; border: 56px solid rgba(181,138,42,.16); }
.hero .in { max-width: 820px; margin: 0 auto; position: relative; z-index: 1; text-align: center; } .hero h1 { font-family: var(--font-serif); font-size: 2.3rem; font-weight: 600; letter-spacing: -.02em; }
.hero p { color: #cfdcec; margin: 10px 0 24px; font-size: 1.05rem; }
.hero .searchbox { display: flex; background: #fff; border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); } .hero .searchbox input { border: 0; background: none; flex: 1; padding: 12px 16px; font-size: 1.05rem; color: #17212b; min-width: 0; } .hero .searchbox input:focus { outline: none; box-shadow: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; } .chip { background: rgba(255,255,255,.12); color: #fff; border-radius: 99px; padding: 5px 13px; font-size: .86rem; text-decoration: none !important; } .chip:hover { background: rgba(255,255,255,.22); }
.stats-inline { display: flex; gap: 28px; justify-content: center; margin-top: 26px; color: #cfdcec; font-size: .9rem; flex-wrap: wrap; } .stats-inline b { color: #fff; font-size: 1.3rem; display: block; font-family: var(--font-serif); }

/* ── Components ──────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .hd { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; } .card > .bd { padding: 18px; } .card > .ft { padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.flat { box-shadow: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .92rem; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none !important; transition: background .12s, border-color .12s, transform .05s; min-height: 38px; white-space: nowrap; }
.btn:active { transform: translateY(1px); } .btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy-700); color: #fff; } .btn-primary:hover { background: var(--navy-800); }
.btn-gold { background: var(--brass-500); color: #1b1405; } .btn-gold:hover { background: #c49a35; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); } .btn-ghost:hover { background: var(--surface-2); border-color: #cfcbc0; }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: transparent; } .btn-danger:hover { background: #f6d2cf; }
.btn-sm { padding: 5px 11px; font-size: .84rem; min-height: 30px; } .btn-lg { padding: 13px 24px; font-size: 1.02rem; min-height: 48px; } .btn[disabled] { opacity: .55; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.plain::before { display: none; }
label, .label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #cdc9bf; border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input, :root:not([data-theme="light"]) select, :root:not([data-theme="light"]) textarea { border-color: var(--line); } }
textarea { min-height: 90px; resize: vertical; } input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--navy-700); vertical-align: -3px; }
.field { margin-bottom: 14px; } .field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; } .field .err, .err { color: var(--bad); font-size: .83rem; margin-top: 4px; }
.check { display: flex; gap: 9px; align-items: center; font-weight: 500; font-size: .92rem; } .check label { margin: 0; font-weight: 500; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 15px; border-radius: var(--radius-sm); font-size: .93rem; margin-bottom: 14px; border: 1px solid transparent; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.info { background: var(--info-bg); color: var(--info); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; } .t th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; } .t tbody tr:hover { background: var(--surface-2); } .t tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; } .t td.num, .t th.num { text-align: right; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; } .tabs a { padding: 9px 15px; color: var(--ink-2); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; white-space: nowrap; } .tabs a:hover { color: var(--ink); } .tabs a[aria-current="page"] { color: var(--navy-700); border-color: var(--brass-500); }
.stat { padding: 16px 18px; display: block; color: inherit; text-decoration: none !important; position: relative; } .stat .n { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; } .stat .l { color: var(--ink-2); font-size: .86rem; margin-top: 3px; }
a.stat:hover { border-color: #cfcbc0; transform: translateY(-1px); } .stat.hot .n { color: var(--bad); } .stat.gold .n { color: var(--brass-600); }
.empty { text-align: center; padding: 38px 20px; color: var(--ink-3); } .empty svg { width: 38px; height: 38px; opacity: .5; margin-bottom: 8px; } .empty b { display: block; color: var(--ink-2); font-size: 1rem; margin-bottom: 2px; }
.list > * { padding: 12px 18px; border-bottom: 1px solid var(--line-2); } .list > *:last-child { border-bottom: 0; }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 22px; flex-wrap: wrap; } .pager a, .pager span { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; color: var(--ink); text-decoration: none !important; } .pager .on { background: var(--navy-700); color: #fff; border-color: var(--navy-700); } .pager .off { color: var(--ink-3); }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: var(--shadow-lg); max-width: min(520px, 94vw); width: 100%; background: var(--surface); color: var(--ink); } dialog::backdrop { background: rgba(12,39,71,.5); }
dialog .hd { padding: 18px 22px 0; } dialog .bd { padding: 12px 22px 8px; } dialog .ft { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.toast-host { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 90; max-width: min(420px, 92vw); } .toast { background: var(--navy-900); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; } .toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ── Catalogue ───────────────────────────────── */
.results-layout { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; } @media (max-width: 860px) { .results-layout { grid-template-columns: minmax(0,1fr); } }
.facets { padding: 16px; } .facets .field { margin-bottom: 12px; }
.book { display: grid; grid-template-columns: 78px 1fr auto; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); align-items: start; } .book:last-child { border-bottom: 0; }
.book h3 a { color: var(--ink); } .book h3 a:hover { color: var(--navy-600); }
.cover { width: 78px; height: 108px; border-radius: 4px 7px 7px 4px; overflow: hidden; background: linear-gradient(160deg, var(--navy-700), var(--navy-900)); color: #fff; display: grid; place-items: center; text-align: center; padding: 8px; font-family: var(--font-serif); font-size: .72rem; line-height: 1.2; box-shadow: 2px 3px 8px rgba(0,0,0,.18), inset 3px 0 0 rgba(255,255,255,.14); position: relative; }
.cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; } .cover.lg { width: 168px; height: 236px; font-size: 1rem; padding: 16px; }
.avail { text-align: right; min-width: 128px; } @media (max-width: 600px) { .book { grid-template-columns: 64px minmax(0,1fr); gap: 12px; padding: 14px; } .book .avail { grid-column: 2; text-align: left; min-width: 0; } .cover { width: 64px; height: 90px; } }
.meta-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: .93rem; } .meta-list dt { color: var(--ink-3); } .meta-list dd { margin: 0; } @media (max-width: 600px) { .meta-list { grid-template-columns: minmax(0,1fr); gap: 0; } .meta-list dd { margin-bottom: 8px; } }
.detail { display: grid; grid-template-columns: 200px 1fr; gap: 30px; } @media (max-width: 760px) { .detail { grid-template-columns: minmax(0,1fr); } }
.loc { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; } .loc svg { width: 16px; height: 16px; margin-top: 3px; color: var(--brass-600); flex: none; }

/* ── Desk ────────────────────────────────────── */
.desk { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; } @media (max-width: 1100px) { .desk { grid-template-columns: minmax(0,1fr); } }
.modes { display: inline-grid; grid-auto-flow: column; background: var(--line-2); padding: 4px; border-radius: 11px; gap: 3px; } .modes button { border: 0; background: none; font: inherit; font-weight: 650; padding: 8px 22px; border-radius: 8px; cursor: pointer; color: var(--ink-2); } .modes button[aria-pressed="true"] { background: var(--surface); color: var(--navy-700); box-shadow: var(--shadow); }
.scan { font-size: 1.25rem !important; padding: 14px 18px !important; min-height: 56px !important; font-family: ui-monospace, Menlo, monospace; letter-spacing: .02em; border-width: 2px !important; }
.step { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .step .no { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700); display: grid; place-items: center; font-weight: 700; font-size: .85rem; } .step.done .no { background: var(--ok); color: #fff; }
.result { border-radius: var(--radius); padding: 18px 20px; border: 1px solid transparent; } .result.ok { background: var(--ok-bg); color: var(--ok); } .result.bad { background: var(--bad-bg); color: var(--bad); } .result.warn { background: var(--warn-bg); color: var(--warn); }
.result .big { font-size: 1.2rem; font-weight: 700; } .result .due { font-size: 1.5rem; font-weight: 750; color: var(--ink); margin: 4px 0; letter-spacing: -.01em; }
.person { display: flex; gap: 14px; align-items: center; } .person .avatar { width: 48px; height: 48px; font-size: 1rem; background: var(--navy-700); }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 30; max-height: 340px; overflow: auto; margin-top: 4px; } .suggest button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-2); } .suggest button:hover, .suggest button:focus { background: var(--navy-50); }
.relative { position: relative; }
.log li { list-style: none; padding: 9px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: baseline; font-size: .9rem; } .log { margin: 0; padding: 0; }

/* ── Labels (print) ──────────────────────────── */
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .label-card { border: 1px dashed #aaa; border-radius: 4px; padding: 8px 10px; background: #fff; color: #000; text-align: center; break-inside: avoid; } .label-card .bar { height: 42px; margin: 4px 6px; } .label-card .bar svg { width: 100%; height: 100%; } .label-card .t1 { font-size: .72rem; font-weight: 700; line-height: 1.2; } .label-card .t2 { font-size: .68rem; letter-spacing: .08em; font-family: ui-monospace, monospace; }
@media print { .side, .topbar, .no-print, .toast-host { display: none !important; } .shell { display: block; } body { background: #fff; } .content { padding: 0; max-width: none; } .labels { gap: 4px; } }

/* ── Login ───────────────────────────────────── */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; } @media (max-width: 860px) { .login-shell { grid-template-columns: minmax(0,1fr); } .login-art { display: none; } }
.login-art { background: linear-gradient(150deg, var(--navy-900), var(--navy-600)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; } .login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 70px solid rgba(181,138,42,.18); }
.login-art h2 { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; max-width: 14em; }
.login-form { display: grid; place-items: center; padding: 30px 20px; } .login-form .box { width: 100%; max-width: 390px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .82rem; margin: 18px 0; } .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Filter bar (under the search box) ───────── */
.filterbar { padding: 14px 16px 12px; margin-bottom: 18px; }
.fb-search { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 4px 4px 4px 14px; background: var(--surface); } .fb-search:focus-within { border-color: var(--navy-600); box-shadow: var(--focus); }
.fb-search > svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; } .fb-search input { border: 0; box-shadow: none !important; background: none; padding: 9px 4px; font-size: 1.02rem; min-height: 42px; flex: 1; min-width: 0; } .fb-search input:focus { outline: none; }
.fb-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 12px; align-items: end; }
.fb-filters label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 3px; } .fb-filters select, .fb-filters input[type=number] { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.fb-year > div { display: flex; align-items: center; gap: 6px; } .fb-year span { color: var(--ink-3); }
.fb-avail { padding-bottom: 8px; }
.fb-active { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.chip-x { background: var(--navy-100); color: var(--navy-700); border-radius: 99px; padding: 3px 11px; font-size: .84rem; font-weight: 600; text-decoration: none !important; } .chip-x:hover { background: var(--navy-600); color: #fff; }

/* ── Pagination footer ───────────────────────── */
.pager-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 16px; align-items: center; margin-top: 16px; } .pager-bar .pager { margin-top: 0; } .pager-size { justify-self: end; display: flex; align-items: center; gap: 8px; } .pager-size label { margin: 0; font-weight: 500; } .pager-size .dd { min-width: 78px; }
@media (max-width: 760px) { .pager-bar { grid-template-columns: minmax(0,1fr); justify-items: center; } .pager-size { justify-self: center; } }

/* ── List / grid toggle ──────────────────────── */
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); } .viewtoggle button { all: unset; cursor: pointer; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-2); } .viewtoggle button svg { width: 16px; height: 16px; } .viewtoggle button + button { border-left: 1px solid var(--line); } .viewtoggle button[aria-pressed="true"] { background: var(--navy-700); color: #fff; } .viewtoggle button:focus-visible { box-shadow: inset var(--focus); }
.results[data-view="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; background: none; border: 0; box-shadow: none; }
.results[data-view="grid"] .book { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; align-items: stretch; } .results[data-view="grid"] .book:hover { transform: translateY(-2px); border-color: #cfcbc0; }
.results[data-view="grid"] .book > a:first-child { display: block; align-self: center; } .results[data-view="grid"] .cover { width: 132px; height: 184px; font-size: .85rem; padding: 12px; }
.results[data-view="grid"] .book .avail { text-align: left; min-width: 0; margin-top: auto; }
.table-view[hidden], .grid-view[hidden] { display: none !important; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; } .tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none !important; } .tile:hover { border-color: #cfcbc0; transform: translateY(-2px); } .tile .cover { align-self: center; width: 112px; height: 156px; }

/* ── Themed dropdown ─────────────────────────── */
.dd { position: relative; width: 100%; } .dd > select { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 0; top: 0; }
.dd-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; background: var(--surface); color: var(--ink); border: 1px solid #cdc9bf; border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px; font: inherit; line-height: 1.3; }
.dd-btn .dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dd-btn .dd-val.ph { color: var(--ink-3); } .dd-btn svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); transition: transform .15s; }
.dd-btn:hover { border-color: #a9a498; } .dd-btn:focus-visible, .dd.open .dd-btn { border-color: var(--navy-600); box-shadow: var(--focus); } .dd.open .dd-btn svg { transform: rotate(180deg); } .dd.disabled .dd-btn { opacity: .55; cursor: not-allowed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dd-btn { border-color: var(--line); } }
.dd-list { position: absolute; z-index: 60; left: 0; min-width: 100%; max-height: 280px; overflow: auto; margin: 4px 0 0; padding: 5px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); } .dd-list.up { bottom: 100%; margin: 0 0 4px; }
.dd-list li { padding: 8px 11px 8px 30px; border-radius: 7px; cursor: pointer; position: relative; font-size: .93rem; white-space: nowrap; color: var(--ink); } .dd-list li.active { background: var(--navy-50); } .dd-list li[aria-selected="true"] { font-weight: 650; color: var(--navy-700); } .dd-list li[aria-selected="true"]::before { content: ""; position: absolute; left: 11px; top: 50%; width: 5px; height: 9px; border: solid var(--brass-500); border-width: 0 2px 2px 0; transform: translateY(-65%) rotate(45deg); }
.dd-list li.placeholder { color: var(--ink-3); } .dd-list li[aria-disabled="true"] { opacity: .45; cursor: default; }
.fb-filters .dd-btn { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.pager-size .dd-btn { min-height: 32px; padding: 4px 10px; font-size: .85rem; }

.alert > svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.empty > svg, .btn > svg { max-width: 40px; }

/* ── Dashboard flow ──────────────────────────── */
.progress { height: 6px; background: var(--line-2); margin: 0; } .progress span { display: block; height: 100%; background: var(--brass-500); border-radius: 0 4px 4px 0; transition: width .3s; }
.steps { list-style: none; margin: 0; padding: 0; } .steps li { display: flex; gap: 12px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line-2); } .steps li:last-child { border-bottom: 0; }
.steps .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9c5b9; flex: none; display: grid; place-items: center; } .steps li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; } .steps .tick svg { width: 13px; height: 13px; stroke-width: 3; }
.steps li.done .strong { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.steps .num { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700); font-weight: 700; font-size: .85rem; display: grid; place-items: center; flex: none; }
@media (max-width: 900px) { .flow { grid-template-columns: minmax(0,1fr) !important; } }

/* ── Help & guide ────────────────────────────── */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; } @media (max-width: 960px) { .doc-layout { grid-template-columns: minmax(0,1fr); } }
.doc-toc { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; padding: 14px; } .doc-toc h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.doc-toc a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); font-size: .9rem; text-decoration: none !important; } .doc-toc a:hover { background: var(--navy-50); color: var(--ink); } .doc-toc a.on { background: var(--navy-100); color: var(--navy-700); font-weight: 650; }
@media (max-width: 960px) { .doc-toc { position: static; max-height: none; } }
.doc section { margin-bottom: 36px; scroll-margin-top: 80px; } .doc h2 { font-size: 1.35rem; margin-bottom: 4px; } .doc h3 { font-size: 1.02rem; margin: 22px 0 6px; } .doc .lead { color: var(--ink-2); font-size: 1.02rem; margin-bottom: 14px; }
.doc p, .doc li { line-height: 1.6; } .doc ul, .doc ol { padding-left: 1.3rem; margin: 0 0 12px; } .doc li { margin-bottom: 5px; }
.doc ol.how { list-style: none; padding: 0; counter-reset: s; } .doc ol.how > li { counter-increment: s; position: relative; padding: 4px 0 12px 44px; } .doc ol.how > li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700); font-weight: 700; display: grid; place-items: center; font-size: .88rem; }
.callout { border-left: 4px solid var(--navy-600); background: var(--info-bg); color: var(--ink); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 14px 0; } .callout.tip { border-color: var(--ok); background: var(--ok-bg); } .callout.warn { border-color: var(--brass-500); background: var(--warn-bg); } .callout b:first-child { display: block; margin-bottom: 2px; }
.doc table.t { margin: 10px 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; } .doc .t td { vertical-align: top; }
.doc .for { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--brass-100); color: var(--brass-600); border-radius: 99px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; }
.doc-hero { background: linear-gradient(135deg, var(--navy-800), var(--navy-600)); color: #fff; border-radius: var(--radius); padding: 26px 28px; margin-bottom: 24px; } .doc-hero h1 { color: #fff; } .doc-hero p { color: #cfdcec; margin: 6px 0 14px; max-width: 46em; }
.doc-hero .searchbox { display: flex; background: #fff; border-radius: 10px; padding: 4px; max-width: 520px; } .doc-hero .searchbox input { border: 0; background: none; flex: 1; padding: 9px 12px; color: #17212b; min-height: 0; } .doc-hero .searchbox input:focus { outline: none; box-shadow: none; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 30px; } .quick a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: inherit; text-decoration: none !important; box-shadow: var(--shadow); } .quick a:hover { border-color: #cfcbc0; transform: translateY(-1px); } .quick b { display: block; margin-bottom: 2px; } .quick span { font-size: .87rem; color: var(--ink-2); }
.doc details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; margin-bottom: 8px; } .doc summary { cursor: pointer; padding: 12px 0; font-weight: 650; } .doc details[open] summary { border-bottom: 1px solid var(--line-2); margin-bottom: 10px; } .doc details > :last-child { margin-bottom: 14px; }
.doc .yes { color: var(--ok); font-weight: 700; } .doc .no { color: var(--ink-3); }
@media print { .doc-toc, .doc-hero .searchbox, .quick { display: none !important; } .doc-layout { display: block; } .doc details { border: 0; } .doc details > * { display: block !important; } }

/* ── Responsive ──────────────────────────────── */
.grid > *, .desk > *, .detail > *, .results-layout > *, .doc-layout > * { min-width: 0; }
.split { grid-template-columns: minmax(0,2fr) minmax(0,1fr); align-items: start; } .split.wide { grid-template-columns: minmax(0,3fr) minmax(0,2fr); }
@media (max-width: 900px) { .split, .split.wide { grid-template-columns: minmax(0,1fr); } }
.fb-toggle { display: none; } .pub-signout { display: inline; } .pub-head .btn.menu-btn { display: none; }
input[type=file] { max-width: 100%; } input { text-overflow: ellipsis; }

/* Public header: compact menu. Only collapsed when JS can open it again (.js is set in the layout head). */
@media screen and (max-width: 860px) {
  .pub-head .in { flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px; }
  .pub-head .brand { flex: 1 1 0; min-width: 0; } .pub-head .brand > div { min-width: 0; } .pub-head .brand span { display: block; line-height: 1.25; }
  .js .pub-head .btn.menu-btn { display: inline-flex; flex: none; width: 44px; height: 44px; padding: 0; background: rgba(255,255,255,.14); color: #fff; }
  .pub-head nav { flex: 0 0 100%; margin-left: 0; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 2px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14); }
  .js .pub-head nav { display: none; } .js body.nav-open .pub-head nav { display: flex; }
  .pub-head nav a { display: flex; align-items: center; min-height: 44px; } .pub-head nav form { display: block; } .pub-head nav .btn { width: 100%; min-height: 44px; }
}

/* Touch widths: every control at least 40px tall, staff drawer and tablets included */
@media screen and (max-width: 960px) {
  .btn, .btn-sm { min-height: 40px; } .btn-sm { padding: 6px 12px; } .btn.menu-btn { min-width: 40px; flex: none; }
  .nav a { min-height: 42px; } .side-foot button { min-height: 40px; }
  .tabs a { display: inline-flex; align-items: center; min-height: 40px; flex: none; }
  .pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 6px 10px; }
  .viewtoggle button { box-sizing: border-box; min-height: 40px; padding: 6px 12px; }
  .modes button { min-height: 40px; } .chip, .chip-x { display: inline-flex; align-items: center; min-height: 40px; } .chip-x { padding: 5px 13px; }
  .check { min-height: 40px; } .check input { flex: none; } .doc-toc a { display: flex; align-items: center; min-height: 40px; }
  .fb-filters select, .fb-filters input[type=number], .fb-filters .dd-btn, .pager-size .dd-btn { min-height: 40px; }
  .dd-list li { padding-top: 10px; padding-bottom: 10px; }
  .card > .hd a, .fb-active a.small, .link-list a, .row.between > a, p.small > a, .login-form p > a, .steps .grow > a, .t td > a.strong { display: inline-flex; align-items: center; min-height: 40px; }
  .book h3 a { display: block; padding: 10px 0; margin: -10px 0; } .t td.num .btn { margin: 2px 0; }
}

/* Phones and small tablets */
@media screen and (max-width: 760px) {
  body { overflow-wrap: anywhere; } .t { overflow-wrap: normal; }
  input:not(.scan), textarea { font-size: 16px !important; } /* iOS zooms the page when a focused field is under 16px */
  .wrap { padding: 18px 16px 50px; }
  .btn { white-space: normal; text-align: center; } .t .btn, .topbar .btn { white-space: nowrap; } .topbar .btn { flex: none; } .badge { white-space: normal; } .t .badge { white-space: nowrap; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; } .page-head .row > .btn { flex: 1 1 auto; }
  .modes { display: grid; grid-auto-columns: minmax(0,1fr); } .modes button { padding: 8px 6px; }
  .card > .hd { flex-wrap: wrap; padding: 12px 14px; } .card > .bd, .card > form.bd { padding: 14px; } .card > .ft { padding: 12px 14px; } .list > * { padding: 12px 14px; } .steps li { padding: 12px 14px; }
  .alert > div { min-width: 0; } .step .no { flex: none; } .row > .field, form.row > div { min-width: 0; } form.row > div:not(.grow) { flex: 1 1 130px; }
  .t th, .t td { padding: 10px 12px; } .t:has(th:nth-child(4)) { min-width: 34rem; } .t input:not([type=checkbox]) { min-width: 140px; }
  .detail > div:first-child { justify-self: center; }
  .scan { font-size: 1.05rem !important; padding: 12px 14px !important; min-height: 48px !important; }
  .filterbar { padding: 12px; } .fb-search { gap: 6px; padding: 3px 3px 3px 10px; }
  .js .fb-toggle { display: flex; width: 100%; margin-top: 10px; } .js .fb-toggle[aria-expanded="false"] ~ .fb-filters { display: none; }
  .fb-filters { grid-template-columns: repeat(2, minmax(0,1fr)); } .fb-year, .fb-avail { grid-column: 1 / -1; } .fb-year input { min-width: 0; } .fb-avail { padding-bottom: 0; }
  .dd-list { width: 100%; } .dd-list li { white-space: normal; } .pager-size .dd-list { width: auto; } .pager-size .dd-list li { white-space: nowrap; }
  .pager-links { max-width: 100%; }
  dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto; } dialog .hd { padding: 16px 16px 0; } dialog .bd { padding: 10px 16px 6px; } dialog .ft { flex-wrap: wrap; padding: 12px 16px 16px; } dialog .ft .btn { flex: 1 1 auto; }
  .toast-host { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

@media screen and (max-width: 600px) {
  .hero { padding: 36px 16px 40px; } .hero h1 { font-size: 1.75rem; } .hero p { font-size: 1rem; margin-bottom: 18px; } .hero .searchbox input { padding: 10px; } .hero .searchbox .btn-lg { padding: 10px 16px; } .stats-inline { gap: 18px; }
  .doc-hero { padding: 20px 16px; } .cols-4:has(> .stat) { grid-template-columns: repeat(2, minmax(0,1fr)); } .stat { padding: 14px; } .labels { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .steps li { flex-wrap: wrap; } .steps li .grow { flex: 1 1 calc(100% - 40px); } .steps li .badge { margin-left: 38px; } .steps li .btn { margin-left: auto; }
}

@media screen and (max-width: 480px) {
  .topbar { gap: 10px; padding: 8px 12px; } .topbar .btn-gold { padding: 8px 12px; } .topbar .btn-gold svg { display: none; }
  .fb-filters { grid-template-columns: minmax(0,1fr); }
}
