:root {
  color-scheme: light;
  --ink: #211e19;
  --muted: #6b6357;
  --paper: #f5f2ed;
  --line: #e0d9ce;
  --accent: #375847;
  --gold: #9f7945;
  --gold-soft: #dfc697;
  --display: Georgia, 'Times New Roman', serif;
  font: 15px/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #9b6c37;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.038em; margin-bottom: 12px; }
h2 { font-size: 1.26rem; letter-spacing: -.022em; margin-bottom: 11px; }
h3 { font-size: 1rem; margin-bottom: 8px; }
small { font-size: .8em; }
.masthead { background: #1c1a17; color: #f8f1e5; border-bottom: 1px solid #403829; }
.head-inner {
  width: min(1480px, 100% - 72px); min-height: 78px; margin-inline: auto; display: flex;
  align-items: center; justify-content: space-between; gap: 24px;
}
.masthead-brand { display: flex; align-items: center; gap: 15px; text-decoration: none; flex: 0 0 auto; }
.masthead-brand img { width: 57px; height: auto; display: block; filter: grayscale(1) invert(1); mix-blend-mode: screen; }
.masthead-wordmark { font-family: var(--display); font-size: 1.2rem; line-height: 1.1; letter-spacing: .035em; }
.masthead-wordmark small { display: block; margin-top: 4px; color: var(--gold-soft); font: 650 .59rem/1 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.masthead-nav { display: flex; gap: 8px; margin-left: auto; }
.masthead-nav a, .masthead-nav button { display: inline-block; text-decoration: none; color: #d7d0c3; padding: 8px 12px; border: 0; border-radius: 7px; font-size: .88rem; background: none; white-space: nowrap; }
.masthead-nav a:hover, .masthead-nav button:hover, .masthead-nav a[aria-current=page] { background: #302a22; color: #fff5e4; }
.masthead-account { position: relative; }
.masthead-account summary { padding: 8px 12px; color: #d7d0c3; border-radius: 7px; font-size: .88rem; white-space: nowrap; }
.masthead-account summary:hover, .masthead-account[open] summary { background: #302a22; color: #fff5e4; }
.masthead-account > div { position: absolute; top: calc(100% + 6px); right: 0; z-index: 4; min-width: 150px; padding: 5px; background: #1c1a17; border: 1px solid #554838; border-radius: 8px; box-shadow: 0 8px 24px #211e192b; }
.masthead-account a, .masthead-account button { width: 100%; text-align: left; }
.masthead-status { display: flex; align-items: center; gap: 7px; font-size: .72rem; color: #e2c797; border: 1px solid #554838; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.masthead-status i { width: 6px; height: 6px; border-radius: 100%; background: #cfad73; }
.page { width: min(1480px, 100% - 72px); margin: 26px auto 56px; }
.page:has(.admin-shell) { width: 100%; margin: 0; }
.page:has(.admin-shell) > .error { margin: 12px clamp(12px, 3vw, 36px); }
.app-loading { min-height: 30vh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.app-loading span { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.panel { background: #fffdfa; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.hint, .muted { color: var(--muted); }
.hint { margin-bottom: 15px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.primary, .light { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid var(--ink); border-radius: 7px; padding: 9px 13px; font-weight: 650; }
.primary { background: var(--ink); color: #fffaf0; }
.primary:hover:not(:disabled) { background: #3d352a; }
button:disabled { opacity: .45; cursor: default; }
.light { background: #fffdfa; color: var(--ink); border-color: var(--line); }
.light:hover:not(:disabled) { border-color: var(--gold); background: #f5efe5; }
.error { background: #fff1ec; color: #7f2417; border: 1px solid #efcdc0; padding: 13px 15px; border-radius: 8px; margin-bottom: 16px; }
label { font-size: .87rem; font-weight: 630; }
.field { display: grid; gap: 5px; min-width: 0; }
input, select { background: #fffdfa; color: var(--ink); border: 1px solid #cfc6b8; border-radius: 7px; padding: 8px 10px; min-width: 0; }
input[type=checkbox] { accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 7px; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); align-items: end; margin: 12px 0; }
.stack > * + * { margin-top: 13px; }
.notice { color: var(--accent); margin: 8px 0; font-weight: 630; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.table-wrap { overflow: auto; }
summary { cursor: pointer; font-weight: 680; }
@media (max-width: 800px) {
  .head-inner, .page { width: calc(100% - 28px); }
  .head-inner { min-height: 65px; gap: 12px; }
  .page { margin-top: 16px; }
  .masthead-brand { gap: 9px; }
  .masthead-brand img { width: 43px; }
  .masthead-wordmark { font-size: 1rem; }
  .masthead-nav { gap: 2px; }
  .masthead-nav a, .masthead-nav button, .masthead-account summary { padding: 7px 8px; }
}
@media (max-width: 520px) {
  .masthead-status { display: none; }
  .head-inner:has(.masthead-account) { flex-wrap: wrap; padding-block: 8px; gap: 4px 10px; }
  .masthead-nav:has(.masthead-account) { align-items: center; }
  .masthead-account summary { min-height: 44px; align-content: center; }
  .masthead-account > div { z-index: 5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
