/* Hội Vũ research library — card catalog. Design record: library/DESIGN.md */
:root {
  --ground: #e2e5e2; --drawer: #d3d8d4; --drawer-edge: #bcc3be; --card: #ffffff; --card-edge: #cfd4d0;
  --ink: #1b1f22; --muted: #4c545a; --faint: #5c646a;
  --red: #b8322a; --red-soft: #f6dcd8; --rule: #dbe4ee;
  --buff: #d9c89d; --buff-edge: #c2ae7c; --buff-ink: #3a311c; --brass: #9a7c42;
  --shadow: 0 1px 0 rgb(30 40 35 / 0.06), 0 3px 10px -4px rgb(30 40 35 / 0.18);
  --lift: 0 2px 0 rgb(30 40 35 / 0.05), 0 12px 24px -10px rgb(30 40 35 / 0.32);
  --sans: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --ground: #15181a; --drawer: #1e2326; --drawer-edge: #2c3337; --card: #22272b; --card-edge: #333a3f;
  --ink: #e9ebec; --muted: #a6aeb4; --faint: #868f96;
  --red: #e8705f; --red-soft: #4a2622; --rule: #2d3742;
  --buff: #5f5333; --buff-edge: #776943; --buff-ink: #f3e9cc; --brass: #bfa268;
  --shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 3px 10px -4px rgb(0 0 0 / 0.6);
  --lift: 0 2px 0 rgb(0 0 0 / 0.3), 0 14px 26px -10px rgb(0 0 0 / 0.75);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  caret-color: var(--red); }
::selection { background: var(--buff); color: var(--buff-ink); }
* { scrollbar-width: thin; scrollbar-color: var(--drawer-edge) transparent; }
h1, h2, h3, .brand { text-wrap: balance; }
p, li, dd, dt, .warn { text-wrap: pretty; }
.nw { white-space: nowrap; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 3px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono, .callno { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* --- top bar --------------------------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 52px; padding: 0 clamp(14px, 3vw, 32px); background: var(--ground); border-bottom: 1px solid var(--drawer-edge); }
.brand { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; }
.brand .b-short { display: none; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--drawer-edge); border-radius: 6px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; padding: 4px 11px; font: 500 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 32px; border: 1px solid var(--drawer-edge);
  border-radius: 6px; background: var(--card); color: var(--ink); }
.icon-btn:hover { border-color: var(--faint); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 2px; color: var(--muted);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; white-space: nowrap; }
.link-btn:hover { color: var(--ink); text-decoration-color: var(--red); }

main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 32px) 64px; }

/* --- masthead plate -------------------------------------------------------------------- */
.masthead { padding: 40px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 40px; align-items: end; }
.masthead h1 { margin: 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; max-width: 24ch; }
.masthead .sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 60ch; }
.accession { grid-column: 1 / -1; margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--drawer-edge);
  font: 400 13px/1.7 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.accession b { color: var(--ink); font-weight: 500; }
.notes { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 14px; color: var(--muted); }
.notes a { color: var(--ink); }
.notes .fmt { display: inline-flex; gap: 10px; }

/* --- cabinet: drawer fronts ------------------------------------------------------------ */
.cabinet { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 14px; border-radius: 10px;
  background: var(--drawer-edge); }
.drawer-front { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px 12px;
  border: 0; border-radius: 6px; background: var(--drawer); color: var(--ink); text-align: center;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), inset 0 -2px 0 rgb(0 0 0 / 0.06);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease); }
.drawer-front:hover { transform: translateY(-1px); }
.label { display: grid; gap: 2px; width: 100%; min-height: 58px; align-content: center; padding: 6px 8px; border-radius: 3px;
  background: var(--card); outline: 1.5px solid var(--brass); outline-offset: 2px; font-size: 13px; line-height: 1.3; font-weight: 500; flex: 1; }
.label > span:first-child { text-wrap: balance; }
.label .count { font: 400 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.label .count b { color: var(--red); font-weight: 500; }
.pull { width: 38%; height: 7px; border-radius: 0 0 6px 6px; background: var(--brass); opacity: 0.75; }
.drawer-front[aria-pressed="true"] { transform: translateY(5px); box-shadow: var(--lift); background: var(--card); }
.drawer-front[aria-pressed="true"] .label { outline-color: var(--red); }
.drawer-front.is-empty { opacity: 0.55; }

/* --- request line ---------------------------------------------------------------------- */
.request { display: grid; gap: 12px; margin: 28px 0 0; }
.search { display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); padding: 4px 2px; }
.search .ic { width: 22px; height: 22px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; font-size: 19px; outline: none; }
.search input::placeholder { color: var(--faint); }
.search:focus-within { border-color: var(--red); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; }
.filters select { appearance: none; border: 1px solid var(--drawer-edge); border-radius: 6px; background: var(--card)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%23808a90' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E")
  no-repeat right 8px center / 16px; padding: 6px 30px 6px 10px; }
.check { display: inline-flex; gap: 7px; align-items: center; }
.filter-end { display: inline-flex; align-items: center; gap: 14px; white-space: nowrap; }
#quality { border-bottom: 1px solid var(--drawer-edge); padding-right: 6px; }
#quality button[aria-pressed="true"] { margin-bottom: -1px; border-bottom: 1px solid var(--buff); }
.check input { accent-color: var(--red); width: 15px; height: 15px; }

/* --- open drawer: guide card + index cards --------------------------------------------- */
.drawer { margin-top: 8px; }
.guide { position: relative; display: flex; justify-content: flex-end; align-items: end; gap: 16px; margin: 52px 0 18px;
  padding: 14px 18px 10px; border-radius: 4px; background: var(--buff); color: var(--buff-ink); border: 1px solid var(--buff-edge); }
.guide .tab { position: absolute; left: 18px; bottom: calc(100% - 1px); margin: 0; max-width: calc(100% - 36px); padding: 7px 18px 4px;
  border-radius: 7px 7px 0 0; background: var(--buff); border: 1px solid var(--buff-edge); border-bottom: 0;
  font-size: 19px; line-height: 1.25; font-weight: 600; }
.guide p { margin: 0; font: 400 13px/1.5 var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px 16px; }
.card { --pad: 18px; position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0 0 14px; border-radius: 4px;
  background: var(--card); border: 1px solid var(--card-edge); box-shadow: var(--shadow); }
.card > * { padding-inline: var(--pad); }
.card-head { display: flex; align-items: center; gap: 10px; height: 36px; margin: 0 0 12px;
  border-bottom: 2px solid var(--red); font: 500 13px var(--mono); font-variant-numeric: tabular-nums; }
.card-head .callno { font-weight: 600; font-size: 14px; }
.card-head .year { color: var(--muted); }
.card-head .qual { margin-left: auto; padding: 1px 7px; border-radius: 3px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid var(--card-edge); color: var(--muted); }
.qual.q-full-text { color: var(--ink); border-color: var(--ink); }
.qual.q-abstract, .qual.q-excerpt {
  background: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--faint) 28%, transparent) 3px 4px); }
.card h2 { margin: 0; font-size: 16.5px; line-height: 1.35; font-weight: 600; }
.card h2 a { text-decoration: none; }
.card h2 a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.card .orig { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.card .by { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.card .note { margin: 10px 0 0; padding-top: 1px; font-size: 14.5px; line-height: 24px;
  background: repeating-linear-gradient(to bottom, transparent 0 23px, var(--rule) 23px 24px); }
.card .shelf { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--faint); }
.card > :nth-last-child(2) { margin-bottom: 12px; }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding-top: 10px;
  border-top: 1px dashed var(--card-edge); font-size: 13px; margin-inline: var(--pad); padding-inline: 0; }
.card-foot .figs { font: 400 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.card-foot .refs { font: 500 12px var(--mono); color: var(--red); }
.card-foot .acts { display: flex; gap: 12px; margin-left: auto; }
.card-foot .acts a { color: var(--muted); }
.card-foot .acts a:hover { color: var(--ink); }
.hit-tab { position: absolute; left: 14px; top: -11px; padding: 2px 9px; border-radius: 4px 4px 0 0; background: var(--red); color: #fff;
  font: 500 11.5px var(--mono); font-variant-numeric: tabular-nums; }
[data-theme="dark"] .hit-tab { color: #1b0f0d; }
.last-tab { position: absolute; left: 14px; top: -11px; padding: 2px 9px; border-radius: 4px 4px 0 0; background: var(--ink); color: var(--card);
  font: 500 11px var(--mono); }
.snips { margin: 10px 0 0; padding-block: 0; list-style: none; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.snips li { padding: 6px 10px; margin: 6px 0 0; border-radius: 3px; background: color-mix(in srgb, var(--ground) 55%, var(--card)); }
mark { background: linear-gradient(to bottom, transparent 18%, color-mix(in srgb, #ffd84d 75%, transparent) 18% 88%, transparent 88%);
  color: inherit; padding: 0 1px; }
[data-theme="dark"] mark { background: linear-gradient(to bottom, transparent 18%, rgb(214 168 36 / 0.45) 18% 88%, transparent 88%); }
mark.cur { background: var(--red); color: #fff; border-radius: 2px; }
.list .empty { padding: 40px 0; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* filed behind: non-matching cards stay in the drawer as slim card edges */
.behind { margin-top: 30px; }
.behind h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.behind ol { margin: 0; padding: 0; list-style: none; }
.behind li a { display: flex; gap: 14px; align-items: baseline; padding: 7px 14px; margin-top: -1px; background: var(--card);
  border: 1px solid var(--card-edge); border-top: 2px solid color-mix(in srgb, var(--red) 55%, var(--card)); text-decoration: none;
  color: var(--muted); font-size: 13.5px; }
.behind li:first-child a { border-radius: 4px 4px 0 0; }
.behind li:last-child a { border-radius: 0 0 4px 4px; }
.behind li a:hover { color: var(--ink); position: relative; transform: translateX(4px); transition: transform 180ms var(--ease); }
.behind .callno { font-size: 12.5px; color: var(--ink); min-width: 3ch; }
.behind .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

::view-transition-group(*) { animation-duration: 360ms; animation-timing-function: var(--ease); }

/* --- viewer ----------------------------------------------------------------------------- */
#viewer { max-width: none; padding: 0; height: calc(100dvh - 52px); display: flex; flex-direction: column; }
#viewer[hidden] { display: none; }
.vbar { display: flex; align-items: center; gap: 18px; padding: 12px clamp(14px, 3vw, 28px); background: var(--card);
  border-bottom: 2px solid var(--red); }
.vbar .back { flex: none; }
.vtitle { flex: 1; min-width: 0; }
.vtitle h1 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
.vtitle h1 .callno { margin-right: 10px; font-size: 15px; font-weight: 600; color: var(--red); }
.vtitle p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.vnav { display: flex; gap: 6px; flex: none; }
.vtools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px clamp(14px, 3vw, 28px) 0;
  background: var(--ground); border-bottom: 1px solid var(--drawer-edge); }
.tabs { display: flex; gap: 4px; align-self: flex-end; }
.tabs button { border: 1px solid var(--drawer-edge); border-bottom: 0; border-radius: 6px 6px 0 0; background: var(--drawer);
  padding: 6px 14px 7px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--buff); border-color: var(--buff-edge); color: var(--buff-ink); font-weight: 600; }
.tabs button:disabled { opacity: 0.4; cursor: default; }
.find { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-bottom: 8px; padding: 0 8px; border: 1px solid var(--drawer-edge);
  border-radius: 6px; background: var(--card); }
.find .ic { width: 16px; height: 16px; color: var(--muted); }
.find input { width: 220px; border: 0; background: transparent; padding: 6px 0; outline: none; }
.wrap-btn { margin-bottom: 8px; padding: 5px 11px; border: 1px solid var(--drawer-edge); border-radius: 6px; background: var(--card); color: var(--muted);
  font-size: 13.5px; white-space: nowrap; }
.wrap-btn[aria-pressed="true"] { background: var(--buff); border-color: var(--buff-edge); color: var(--buff-ink); font-weight: 600; }
.wrap-btn[hidden] { display: none; }
.hits { margin-bottom: 8px; min-width: 64px; font: 400 12.5px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.vtools .icon-btn { margin-bottom: 8px; }
.panes { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; }
.pane { overflow: auto; min-width: 0; }
.pane.pdf { border-right: 1px solid var(--drawer-edge); background: var(--drawer); }
.pane.pdf iframe { width: 100%; height: 100%; border: 0; display: block; }
.pane.pdf .nopdf { max-width: 46ch; margin: 48px auto; padding: 0 24px; color: var(--muted); }
.pane.text { background: var(--card); container-type: inline-size; }
#text { max-width: 74ch; margin: 0 auto; padding: 26px clamp(18px, 4vw, 40px) 80px; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 400 15.5px/1.7 var(--sans); }
#text.layout { max-width: none; width: max-content; min-width: 100%; white-space: pre; overflow-wrap: normal; font: 400 13px/1.6 var(--mono); }
#text.layout.wrap { width: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
/* rendered markdown captures */
#text.md { white-space: normal; }
#text.md > :first-child { margin-top: 0; }
#text.md :is(h1, h2, h3, h4, h5, h6) { margin: 1.7em 0 0.5em; line-height: 1.3; font-weight: 600; text-wrap: balance; }
#text.md h1 { font-size: 23px; } #text.md h2 { font-size: 20px; } #text.md h3 { font-size: 17.5px; } #text.md :is(h4, h5, h6) { font-size: 15.5px; }
#text.md p { margin: 0 0 0.9em; }
#text.md :is(ul, ol) { margin: 0 0 0.9em; padding-left: 1.4em; } #text.md li { margin: 0.2em 0; }
#text.md li::marker { color: var(--faint); }
#text.md a { text-decoration-color: color-mix(in srgb, var(--red) 55%, transparent); }
#text.md table { display: block; max-width: 100%; overflow-x: auto; margin: 0 0 1.2em; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
#text.md :is(th, td) { padding: 6px 10px; border: 1px solid var(--card-edge); text-align: left; vertical-align: top; }
#text.md th { background: var(--ground); font-weight: 600; }
#text.md blockquote { margin: 0 0 1em; padding: 8px 14px; border-radius: 4px; background: color-mix(in srgb, var(--ground) 60%, var(--card)); }
#text.md code { padding: 1px 4px; border-radius: 3px; background: var(--ground); font: 13px var(--mono); }
#text.md pre { overflow-x: auto; padding: 10px 12px; border-radius: 4px; background: var(--ground); white-space: pre; }
#text.md pre code { padding: 0; background: none; }
#text.md hr { margin: 1.6em 0; border: 0; border-top: 1px solid var(--card-edge); }
/* Vietnamese UI: original | translation, paragraph-aligned */
#text.bi { max-width: 1120px; }
#text.bi .bi-head { position: sticky; top: 0; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 0 0 6px; padding: 8px 0;
  background: var(--card); border-bottom: 1px solid var(--card-edge); color: var(--muted); font-size: 12.5px; font-weight: 600; }
#text.bi .bi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 12px 0; border-bottom: 1px dashed var(--card-edge); }
#text.bi .bi-row.solo { grid-template-columns: 1fr; color: var(--muted); }
#text.bi:not(.md) .bi-row > div { white-space: pre-wrap; }
#text.bi .bi-row > div { text-wrap: pretty; }   /* plain-text pairs are divs, so they miss the paragraph rule: no orphan last lines */
#text.bi .bi-row > div > :last-child { margin-bottom: 0; }
#text.bi .num-flag { margin: 0 0 6px; padding: 4px 8px; border-radius: 3px; background: var(--red-soft); font-size: 12.5px; line-height: 1.45; }
@container (max-width: 820px) {   /* pairs stack whenever the text pane is narrow: phones and the split view alike */
  #text.bi .bi-head { display: none; }
  #text.bi .bi-row { grid-template-columns: 1fr; gap: 8px; }
  #text.bi .bi-vi { padding: 8px 10px; border-radius: 4px; background: color-mix(in srgb, var(--buff) 20%, var(--card)); }
}
#text.md .md-img::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4.5H4.5v11h11V12M11 4.5h4.5V9M15.5 4.5 9 11'/%3E%3C/svg%3E") center / contain no-repeat; }
.pane.info { display: none; padding: 28px clamp(18px, 4vw, 40px); }
.warn { display: none; max-width: 74ch; margin: 18px max(clamp(18px, 4vw, 40px), calc((100% - 74ch) / 2)) 0; padding: 10px 14px; border-radius: 4px; font-size: 13.5px;
  background: repeating-linear-gradient(135deg, var(--card) 0 6px, color-mix(in srgb, var(--buff) 45%, var(--card)) 6px 7px);
  border: 1px solid var(--buff-edge); color: var(--buff-ink); }
[data-theme="dark"] .warn { color: var(--ink); }
.warn.on { display: block; }
.panes[data-layout="pdf"] { grid-template-columns: 1fr; } .panes[data-layout="pdf"] .pane.text { display: none; }
.panes[data-layout="text"] { grid-template-columns: 1fr; } .panes[data-layout="text"] .pane.pdf { display: none; }
.panes[data-layout="info"] { grid-template-columns: 1fr; } .panes[data-layout="info"] .pane.pdf,
.panes[data-layout="info"] .pane.text { display: none; } .panes[data-layout="info"] .pane.info { display: block; }

/* the enlarged catalog card in the Card tab */
.info .card { max-width: 900px; margin: 0 auto; padding-bottom: 20px; }
.info .card > .card-head { margin-bottom: 4px; }
.info dl { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 18px; margin: 4px 0 0; }
.info dt { color: var(--muted); font-size: 13.5px; }
.info dd { margin: 0; overflow-wrap: anywhere; }
.info code { font: 12px var(--mono); color: var(--muted); }

/* --- adaptation -------------------------------------------------------------------------- */
@media (max-width: 1080px) { .cabinet { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .masthead { grid-template-columns: 1fr; }
  .notes { align-items: flex-start; }
  .cabinet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .drawer-front { padding: 7px 5px 5px; gap: 6px; }
  .label { min-height: 40px; padding: 4px 5px; font-size: 12px; line-height: 1.25; }
  .pull { height: 5px; }
  .notes { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  /* phone: quick lookup first — search sits above the cabinet so it is always in the first screen */
  #hub:not([hidden]) { display: flex; flex-direction: column; }
  #hub > * { min-width: 0; }
  .request { order: 1; margin: 0 0 18px; }
  .cabinet { order: 2; }
  .drawer { order: 3; }
  #viewer { height: auto; display: block; }
  .vbar { flex-wrap: wrap; }
  .vtitle { flex-basis: 100%; order: 3; }
  .vnav { margin-left: auto; }
  .find { margin-left: 0; }
  .find input { width: 150px; }
  .panes { grid-template-columns: 1fr; grid-template-rows: 60vh auto; }
  .pane.pdf { border-right: 0; border-bottom: 1px solid var(--drawer-edge); }
  .pane.text { max-height: 80vh; }
  .info dl { grid-template-columns: 1fr; gap: 2px; }
  .info dd { margin-bottom: 10px; }
}
@media (max-width: 480px) {
  .brand .b-long { display: none; } .brand .b-short { display: inline; }
  .masthead { padding: 18px 0 18px; }
  .masthead h1 { font-size: 24px; }
  .accession { margin-top: 12px; }
  .search input { font-size: 17px; }
  .card { --pad: 14px; }
  .tabs { flex: 1 1 100%; min-width: 0; } .tabs button { flex: 1; min-width: 0; padding-inline: 2px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
  .cabinet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-foot .acts { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-group(*) { transition: none !important; animation: none !important; }
}
