:root {
  color-scheme: light;
  --paper: #f3ecdc;
  --paper-light: #fbf7ee;
  --paper-deep: #e8ddc8;
  --ink: #211d17;
  --muted: #746b5c;
  --faint: #9b907c;
  --line: rgba(58, 48, 33, 0.16);
  --honey: #a87a13;
  --sage: #748268;
  --danger: #9b5145;
  --font-latin: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-cjk: "Songti TC", "Songti SC", "Noto Serif TC", "Noto Serif CJK TC", STSong, serif;
  --shadow: 0 24px 70px rgba(64, 48, 27, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0, rgba(213, 182, 107, 0.17), transparent 26rem),
    var(--paper);
  font-family: var(--font-cjk);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 0.22em; }
a:hover { color: var(--honey); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 3px; }
::selection { background: rgba(213, 182, 107, 0.42); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}
.auth-card {
  width: min(480px, 100%);
  padding: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 247, 238, 0.92);
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2.2rem;
  font-family: var(--font-latin);
  font-size: 1.1rem;
  text-decoration: none;
}
.auth-brand img {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(168, 122, 19, 0.3);
  border-radius: 50%;
}
.auth-card h1 { margin: 0; font-size: 1.9rem; font-weight: 500; }
.auth-note { margin: 0.6rem 0 1.8rem; color: var(--muted); font-size: 0.88rem; }
.auth-note.compact { margin: 0.8rem 0 1.2rem; font-size: 0.76rem; line-height: 1.65; }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; margin: 0 0 1.4rem; padding: 0.25rem; border: 1px solid var(--line); border-radius: 5px; background: rgba(168, 122, 19, 0.04); }
.auth-mode-switch button { padding: 0.6rem; color: var(--muted); border: 0; border-radius: 3px; background: transparent; font-size: 0.8rem; cursor: pointer; }
.auth-mode-switch button[aria-selected="true"] { color: var(--honey); background: #fffaf0; box-shadow: 0 1px 4px rgba(33, 29, 23, 0.08); }
.repository-status { align-self: center; max-width: 220px; overflow: hidden; color: var(--muted); font-family: var(--font-latin); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.back-link { display: inline-block; margin-top: 1.6rem; color: var(--muted); font-size: 0.78rem; }
.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--honey);
  font-family: var(--font-latin);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0.7rem max(1.2rem, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(251, 247, 238, 0.9);
  backdrop-filter: blur(16px);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.admin-brand img { width: 38px; height: 38px; border-radius: 50%; }
.admin-brand span { display: grid; line-height: 1.25; }
.admin-brand strong { font-weight: 500; }
.admin-brand small { color: var(--muted); font-family: var(--font-latin); font-size: 0.66rem; }
.header-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); max-width: 1380px; margin: 0 auto; }
.admin-nav {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-self: start;
  padding: 2rem 1rem;
}
.admin-nav button {
  padding: 0.65rem 0.85rem;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.admin-nav button:hover { color: var(--ink); background: rgba(168, 122, 19, 0.06); }
.admin-nav button.is-active { color: var(--honey); background: rgba(168, 122, 19, 0.11); font-weight: 600; }
.admin-main { min-width: 0; padding: 2.4rem 2rem 4rem; }
.admin-view { animation: viewIn 0.24s ease-out; }
.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
}
.view-heading h1 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 500; }
.view-heading .muted { margin: 0.25rem 0 0; }
.muted { color: var(--muted); font-size: 0.8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: #fff8e8; background: var(--honey); border-color: var(--honey); }
.button.primary:hover { color: #fff8e8; background: #8f6810; border-color: #8f6810; }
.button.secondary { color: var(--honey); border-color: rgba(168, 122, 19, 0.35); background: rgba(168, 122, 19, 0.06); }
.button.secondary:hover { color: var(--honey); background: rgba(168, 122, 19, 0.11); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.ghost:hover { color: var(--ink); border-color: rgba(168, 122, 19, 0.4); }
.button.danger { color: var(--danger); border-color: rgba(155, 81, 69, 0.3); background: rgba(155, 81, 69, 0.05); }
.button.small { min-height: 32px; padding: 0.35rem 0.7rem; font-size: 0.72rem; }
.button.full { width: 100%; }
.text-button { padding: 0; color: var(--honey); border: 0; background: none; font-size: 0.76rem; cursor: pointer; }
.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-family: var(--font-latin);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.icon-button:hover { color: var(--ink); border-color: var(--honey); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(251, 247, 238, 0.72);
}
.metric strong { color: var(--honey); font-family: var(--font-latin); font-size: 2rem; font-weight: 500; line-height: 1.1; }
.metric span { color: var(--muted); font-size: 0.72rem; }
.notice { margin: 1rem 0; padding: 0.85rem 1rem; color: #7f5a20; border: 1px solid rgba(168, 122, 19, 0.26); border-radius: 4px; background: rgba(168, 122, 19, 0.08); font-size: 0.8rem; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.panel { padding: 1.3rem; border: 1px solid var(--line); border-radius: 5px; background: rgba(251, 247, 238, 0.72); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.panel h2, .panel h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--sage); transition: width 0.4s ease; }
.shelf-summary { display: grid; gap: 0.45rem; }
.shelf-summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; font-size: 0.75rem; }
.shelf-summary-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-summary-row span:last-child { color: var(--muted); }
.simple-list { display: grid; gap: 0.55rem; }
.simple-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--line); font-size: 0.8rem; }
.simple-list-row span:last-child { color: var(--faint); font-family: var(--font-latin); font-size: 0.72rem; }
.empty-state { padding: 2rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; font-size: 0.84rem; text-align: center; }

.shelf-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.9rem; }
.shelf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 205px;
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(251, 247, 238, 0.78);
}
.shelf-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; background: #a77c52; }
.shelf-card h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.shelf-card p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.75rem; }
.shelf-position { margin-top: 0.7rem; color: var(--faint); font-family: var(--font-latin); font-size: 0.68rem; letter-spacing: 0.04em; }
.shelf-card-stats { display: flex; gap: 1rem; margin: 1rem 0; font-size: 0.75rem; }
.shelf-card-stats strong { color: var(--honey); font-family: var(--font-latin); font-size: 1.1rem; font-weight: 500; }
.shelf-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.placeholder-badge { position: absolute; top: 0.8rem; right: 0.8rem; padding: 0.1rem 0.45rem; color: #8a5a1d; border-radius: 999px; background: rgba(168, 122, 19, 0.1); font-size: 0.62rem; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.filter-bar input, .filter-bar select { min-height: 38px; padding: 0.45rem 0.65rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-light); font-size: 0.78rem; }
.search-field { flex: 1 1 240px; }
.search-field input { width: 100%; }
.result-count { margin-left: auto; color: var(--faint); font-size: 0.72rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: rgba(251, 247, 238, 0.68); }
.data-table { width: 100%; min-width: 850px; border-collapse: collapse; font-size: 0.76rem; }
.data-table th { padding: 0.75rem 0.8rem; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(232, 221, 200, 0.28); font-weight: 500; text-align: left; white-space: nowrap; }
.data-table td { padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(168, 122, 19, 0.035); }
.book-title-cell { min-width: 230px; }
.book-title-cell strong { display: block; font-weight: 600; }
.book-title-cell small { display: block; max-width: 320px; margin-top: 0.15rem; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 0.25rem; white-space: nowrap; }
.row-actions button { min-width: 30px; height: 30px; padding: 0.15rem 0.4rem; border: 1px solid var(--line); border-radius: 3px; background: transparent; font-size: 0.7rem; cursor: pointer; }
.row-actions button:hover { border-color: var(--honey); }
.row-actions button:disabled { opacity: 0.3; cursor: default; }
.row-actions .delete-action:hover { color: var(--danger); border-color: var(--danger); }
.status-pill, .demo-pill { display: inline-flex; padding: 0.1rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.64rem; white-space: nowrap; }
.status-verified { color: #53644b; border-color: rgba(83, 100, 75, 0.3); background: rgba(83, 100, 75, 0.08); }
.status-needs-review, .status-unverified { color: #91661c; border-color: rgba(168, 122, 19, 0.28); background: rgba(168, 122, 19, 0.08); }
.status-demo, .demo-pill { color: #8a4f43; border-color: rgba(138, 79, 67, 0.25); background: rgba(138, 79, 67, 0.07); }

.ornament-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; }
.ornament-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0.9rem; padding: 1rem; border: 1px solid var(--line); border-radius: 5px; background: rgba(251, 247, 238, 0.75); }
.ornament-image { display: grid; place-items: center; width: 76px; height: 76px; overflow: hidden; border-radius: 50%; background: var(--paper-deep); }
.ornament-image img { width: 68px; height: 68px; object-fit: contain; }
.ornament-card h2 { margin: 0; font-size: 0.95rem; }
.ornament-card p { margin: 0.2rem 0; color: var(--muted); font-size: 0.7rem; }
.ornament-card .row-actions { margin-top: 0.6rem; }

.verification-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); gap: 1rem; align-items: start; }
.lookup-form { display: flex; gap: 0.6rem; margin: 1rem 0; }
.lookup-form input { flex: 1; min-width: 0; min-height: 42px; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-light); }
.lookup-message { margin: 0.7rem 0; color: var(--muted); font-size: 0.76rem; }
.lookup-message.error { color: var(--danger); }
.lookup-message.warning { padding: 0.7rem 0.8rem; color: #7f5a20; border-left: 2px solid var(--honey); background: rgba(168, 122, 19, 0.07); }
.candidate-list { display: grid; gap: 0.65rem; margin-top: 0.8rem; }
.candidate-list.compact { max-height: 250px; overflow-y: auto; }
.candidate-card { padding: 0.9rem; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 252, 245, 0.7); }
.candidate-card h3 { margin: 0 0 0.25rem; font-size: 0.9rem; }
.candidate-card p { margin: 0.2rem 0; color: var(--muted); font-size: 0.7rem; }
.candidate-card .candidate-source { color: var(--honey); font-family: var(--font-latin); font-size: 0.64rem; letter-spacing: 0.04em; }
.candidate-card .button { margin-top: 0.6rem; }
.check-list { margin: 1rem 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.78rem; }
.check-list li { margin-bottom: 0.55rem; padding-left: 0.25rem; }

.form-dialog {
  width: min(680px, calc(100vw - 2rem));
  max-height: 90vh;
  padding: 0;
  overflow: auto;
  color: var(--ink);
  border: 1px solid rgba(97, 70, 42, 0.42);
  border-radius: 7px;
  background: var(--paper-light);
  box-shadow: 0 40px 100px rgba(20, 13, 7, 0.38);
}
.form-dialog::backdrop { background: rgba(35, 28, 20, 0.56); backdrop-filter: blur(7px); }
.form-dialog form { padding: 1.5rem; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-size: 1.5rem; font-weight: 500; }
.dialog-actions { position: sticky; bottom: -1.5rem; display: flex; justify-content: flex-end; gap: 0.6rem; margin: 1.3rem -1.5rem -1.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: rgba(251, 247, 238, 0.96); backdrop-filter: blur(10px); }
.form-grid { display: grid; gap: 0.8rem; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 0.28rem; min-width: 0; }
.field > span { color: var(--muted); font-size: 0.72rem; }
.field input, .field select, .field textarea, .inline-lookup input {
  width: 100%;
  min-height: 38px;
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf7;
  font-size: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(168, 122, 19, 0.6); outline: 0; box-shadow: 0 0 0 3px rgba(168, 122, 19, 0.08); }
.field input[type="color"] { padding: 0.2rem; }
.field.full { grid-column: 1 / -1; }
.checkbox-field { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.76rem; }
.checkbox-field input { accent-color: var(--honey); }
.form-error { margin: 0.8rem 0 0; padding: 0.55rem 0.7rem; color: var(--danger); border: 1px solid rgba(155, 81, 69, 0.25); border-radius: 3px; background: rgba(155, 81, 69, 0.06); font-size: 0.76rem; }

.book-dialog { width: min(1180px, calc(100vw - 2rem)); }
.book-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1.4rem; align-items: start; }
.form-section { margin-bottom: 1.3rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.form-section:last-child { margin-bottom: 0; border-bottom: 0; }
.form-section h3 { margin: 0 0 0.8rem; font-size: 0.88rem; }
.inline-lookup { display: flex; align-items: end; gap: 0.6rem; }
.inline-lookup .field { flex: 1; }
.spine-settings { position: sticky; top: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.spine-settings h3 { margin: 0 0 0.8rem; font-size: 0.88rem; }
.spine-settings .field { margin-top: 0.75rem; }
.spine-preview-stage { display: grid; place-items: end center; height: 240px; margin-bottom: 0.8rem; padding: 1rem; border-radius: 3px; background: linear-gradient(180deg, #e8dcc4, #d3c09d); box-shadow: inset 0 8px 20px rgba(70, 48, 26, 0.1); }
.spine-preview { display: flex; align-items: center; justify-content: center; width: 48px; height: 190px; padding: 8px; overflow: hidden; border: 1px solid rgba(33, 24, 15, 0.3); border-radius: 2px 2px 0 0; background: #8b9a7b; color: #fffaf0; box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.08), 4px 6px 10px rgba(46, 30, 15, 0.16); }
.spine-preview span { display: block; width: 100%; overflow: hidden; font-family: "Segoe Print", "Bradley Hand", "Kaiti SC", "STKaiti", KaiTi, cursive; font-size: 0.8rem; line-height: 1.4; text-align: center; writing-mode: vertical-rl; text-overflow: ellipsis; white-space: nowrap; }

.import-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1rem; align-items: start; }
.import-panel > .field, .import-panel > .button { margin-top: 0.8rem; }
.photo-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 1rem; }
.import-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.ocr-result-layout { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.ocr-preview { width: 100%; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-deep); }
.ocr-result-layout h3 { margin: 0 0 0.6rem; font-size: 0.9rem; }
.ocr-fields { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.3rem 0.7rem; margin: 0; font-size: 0.74rem; }
.ocr-fields dt { color: var(--muted); }
.ocr-fields dd { margin: 0; overflow-wrap: anywhere; }
.import-warnings { margin: 0.8rem 0; padding-left: 1.1rem; color: #7f5a20; font-size: 0.72rem; }
.ocr-text-details { margin-top: 1rem; color: var(--muted); font-size: 0.74rem; }
.ocr-text-details pre { max-height: 260px; overflow: auto; padding: 0.8rem; border: 1px solid var(--line); border-radius: 4px; background: rgba(232, 221, 200, 0.24); font-family: var(--font-cjk); font-size: 0.72rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.bulk-table-wrap { margin: 0.8rem 0; max-height: 430px; overflow: auto; }
.bulk-table { min-width: 620px; }
.bulk-table td:last-child { min-width: 170px; }
.import-row-error { color: var(--danger); }
.import-row-ok { color: #53644b; }

.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; max-width: min(430px, calc(100vw - 2.4rem)); padding: 0.75rem 1rem; color: #f4ecdc; border: 1px solid rgba(240, 220, 180, 0.2); border-radius: 5px; background: rgba(43, 34, 25, 0.96); box-shadow: 0 12px 30px rgba(25, 16, 9, 0.24); font-size: 0.78rem; }
.toast.error { border-color: rgba(220, 153, 140, 0.3); }

@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; padding: 0.7rem 1rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
  .admin-nav button { flex: 0 0 auto; }
  .admin-main { padding: 1.6rem 1rem 3rem; }
  .book-form-layout { grid-template-columns: 1fr; }
  .spine-settings { position: static; }
  .verification-layout { grid-template-columns: 1fr; }
  .import-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .photo-inputs, .ocr-result-layout { grid-template-columns: 1fr; }
  .ocr-preview { max-height: 200px; }
  .admin-header { align-items: flex-start; padding: 0.7rem 1rem; }
  .admin-brand small { display: none; }
  .header-actions .button[href] { display: none; }
  .repository-status { width: 100%; max-width: none; order: 3; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .view-heading { align-items: start; flex-direction: column; }
  .form-grid.two { grid-template-columns: 1fr; }
  .lookup-form, .inline-lookup { align-items: stretch; flex-direction: column; }
  .form-dialog form { padding: 1.1rem; }
  .dialog-actions { bottom: -1.1rem; margin: 1.1rem -1.1rem -1.1rem; padding: 0.9rem 1.1rem; }
  .auth-card { padding: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
