:root {
  color-scheme: dark;
  --ink: #f3f0e6;
  --muted: #a7aa9e;
  --dim: #73786e;
  --surface: #151914;
  --surface-raised: #1b211a;
  --line: rgba(231, 236, 218, 0.12);
  --line-strong: rgba(231, 236, 218, 0.22);
  --accent: #d8ff74;
  --accent-deep: #a8d43b;
  --danger: #ff8c79;
  --success: #8ed9ad;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(216, 255, 116, 0.09), transparent 30rem),
    #0d100d;
  color: var(--ink);
  line-height: 1.55;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(17deg, transparent 0 19px, rgba(255, 255, 255, .018) 20px),
    repeating-linear-gradient(93deg, transparent 0 31px, rgba(255, 255, 255, .012) 32px);
}

a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header,
.page-shell,
footer {
  position: relative;
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 22px;
}

.brand-name {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: Georgia, serif;
  line-height: 1;
}
.brand-the { font-size: 15px; }
.brand-vault { font-size: 34px; letter-spacing: -.04em; }

.account { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }
.account form { margin: 0; }
.text-button, .muted-link, .back-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  cursor: pointer;
}
.text-button:hover, .muted-link:hover, .back-link:hover { color: var(--ink); text-decoration-color: currentColor; }

.page-shell { min-height: calc(100vh - 176px); padding-block: 64px 90px; }

h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
h1 { font-size: clamp(42px, 6vw, 76px); line-height: .98; }
h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; }
h3 { font-size: 18px; margin-bottom: 6px; }
p { color: var(--muted); }

.eyebrow, .kicker {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(27, 33, 26, .95), rgba(17, 21, 17, .95));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .75fr);
  gap: clamp(50px, 8vw, 120px);
  align-items: center;
  min-height: 620px;
}

.auth-intro { max-width: 650px; }
.auth-intro p { max-width: 540px; font-size: 18px; }
.auth-panel { padding: 38px; }
.auth-panel h2 { margin-bottom: 10px; }
.compact-panel { width: min(480px, 100%); text-align: center; }
.compact-panel .form-stack { text-align: left; }
.compact-panel > .muted-link { display: inline-block; margin-top: 20px; }

.form-stack { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: #d9dbd2; font-size: 13px; font-weight: 600; }
label small { color: var(--dim); font-weight: 400; }

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  background: #0f130f;
  color: var(--ink);
}
textarea { resize: vertical; }
input::placeholder { color: #656a61; }
input:focus, select:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(216, 255, 116, .1); }

.primary-button, .secondary-button {
  min-height: 46px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.primary-button { background: var(--accent); color: #151a0d; }
.primary-button:hover { background: #e4ff9d; transform: translateY(-1px); }
.primary-button:disabled,
.primary-button:disabled:hover {
  background: #34392f;
  color: var(--dim);
  cursor: not-allowed;
  opacity: .72;
  transform: none;
}
.secondary-button { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.secondary-button:hover { border-color: var(--accent-deep); color: var(--accent); }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.form-footnote { margin: 20px 0 0; text-align: center; font-size: 14px; }
.form-footnote a { color: var(--accent); }
.alert, .notice, .dev-note {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 14px;
}
.alert { border: 1px solid rgba(255, 140, 121, .28); background: rgba(255, 140, 121, .08); color: #ffc0b5; }
.notice { border: 1px solid rgba(142, 217, 173, .25); background: rgba(142, 217, 173, .08); color: #bceccb; }
.dev-note { border: 1px dashed var(--line-strong); color: var(--muted); }
.wide-alert { max-width: 760px; margin: 0 auto 30px; }
.code-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 24px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); letter-spacing: 4px; }
.code-input { text-align: center; font-size: 26px; letter-spacing: .28em; }
.centered-section { min-height: 620px; display: grid; place-items: center; }
.cf-turnstile { width: 100%; min-height: 65px; }
.admin-hero { min-height: 260px; }
.approval-list { display: grid; gap: 16px; }
.approval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px;
}
.approval-row h2 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 34px); }
.approval-row p { margin: 0; }
.approval-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.approval-actions form { margin: 0; }
.danger-button { border-color: rgba(255, 140, 121, .35); color: var(--danger); }

.dashboard-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: end;
  padding: 24px 0 64px;
}
.dashboard-hero h1 { margin-bottom: 14px; }
.dashboard-hero p { margin-bottom: 0; }
.allowance-card {
  width: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(216, 255, 116, .055);
}
.allowance-card span, .allowance-card small { display: block; color: var(--muted); }
.allowance-card span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.allowance-card strong { display: block; color: var(--accent); font-family: Georgia, serif; font-size: 64px; line-height: 1.05; }
.allowance-card small { margin-top: 8px; font-size: 12px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 54px 0 22px; }
.section-heading h2 { margin: 0; }
.request-list { border-top: 1px solid var(--line); }
.request-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto 100px;
  gap: 18px;
  align-items: center;
  padding: 17px 4px;
  border-bottom: 1px solid var(--line);
}
.poster-mini { width: 48px; height: 64px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: var(--surface-raised); color: var(--accent); font-family: Georgia, serif; font-size: 24px; }
.poster-mini img { width: 100%; height: 100%; object-fit: cover; }
.request-main h3 { margin: 0; }
.request-main p, .request-row time { margin: 0; color: var(--dim); font-size: 13px; }
.status { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.status-available { border-color: rgba(142, 217, 173, .35); color: var(--success); }
.status-failed, .status-rejected, .status-canceled { border-color: rgba(255, 140, 121, .35); color: var(--danger); }
.empty-state { padding: 70px 30px; text-align: center; }
.empty-state p { margin-bottom: 25px; }
.empty-glyph { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); font-size: 30px; font-weight: 200; }

.search-hero { max-width: 850px; margin: 10px auto 65px; text-align: center; }
.search-hero .back-link { display: block; margin-bottom: 45px; text-align: left; }
.search-hero h1 { margin-bottom: 18px; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 34px; padding: 9px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.search-form input { border: 0; background: transparent; }
.search-form input:focus { box-shadow: none; }
.results-section { max-width: 920px; margin: 0 auto; }
.search-results { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.search-result { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 20px; background: #111510; }
.result-poster { width: 82px; aspect-ratio: 2 / 3; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--surface-raised); color: var(--dim); font-size: 11px; }
.result-poster img { width: 100%; height: 100%; object-fit: cover; }
.result-copy h3 { font-size: 21px; margin: 4px 0 6px; }
.result-copy p { margin: 0; font-size: 14px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.result-meta span + span::before { content: "·"; margin-right: 7px; }
.manual-panel { max-width: 760px; margin: 0 auto; padding: 34px; }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wide-field { grid-column: 1 / -1; }

.confirm-section { display: block; max-width: 900px; margin: 0 auto; }
.confirm-section > .back-link { display: inline-block; margin-bottom: 30px; }
.confirm-card { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; overflow: hidden; }
.confirm-poster { min-height: 470px; display: grid; place-items: center; background: #20271e; color: var(--accent); font-family: Georgia, serif; font-size: 70px; }
.confirm-poster img { width: 100%; height: 100%; object-fit: cover; }
.confirm-copy { padding: clamp(30px, 5vw, 56px); }
.confirm-copy h1 { font-size: clamp(40px, 5vw, 58px); margin-bottom: 15px; }
.confirm-copy > p { margin: 25px 0 30px; }
.confirm-form { border-top: 1px solid var(--line); padding-top: 24px; }
.confirm-actions { display: flex; justify-content: flex-end; align-items: center; gap: 22px; margin-top: 8px; }
.season-callout { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); }
.notes-callout { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.notes-callout span { display: block; margin-bottom: 5px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.notes-callout p { margin: 0; white-space: pre-wrap; }
.season-options { margin: 0; padding: 0; border: 0; }
.season-options legend { margin-bottom: 8px; color: #d9dbd2; font-size: 13px; font-weight: 600; }
.season-option-list {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #0f130f;
}
.season-option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.season-option:last-child { border-bottom: 0; }
.season-option input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--accent-deep); }

footer {
  min-height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

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

@media (max-width: 760px) {
  .site-header, .page-shell, footer { width: min(100% - 28px, 1160px); }
  .site-header { min-height: 78px; }
  .account > span { display: none; }
  .page-shell { padding-block: 38px 70px; }
  .auth-layout { grid-template-columns: 1fr; gap: 35px; min-height: 0; }
  .auth-intro h1 { font-size: 48px; }
  .auth-panel { padding: 27px; }
  .dashboard-hero { grid-template-columns: 1fr; align-items: start; padding-bottom: 25px; }
  .allowance-card { width: 100%; }
  .section-heading { align-items: stretch; flex-direction: column; margin-top: 36px; }
  .request-row { grid-template-columns: 48px 1fr auto; gap: 12px; }
  .request-row time { display: none; }
  .status { grid-column: 2 / 4; justify-self: start; }
  .search-form { grid-template-columns: 1fr; }
  .search-result { grid-template-columns: 70px 1fr; padding: 15px; gap: 15px; }
  .result-poster { width: 68px; }
  .search-result form { grid-column: 2; }
  .manual-grid { grid-template-columns: 1fr; }
  .wide-field { grid-column: auto; }
  .confirm-card { grid-template-columns: 1fr; }
  .confirm-poster { min-height: auto; max-height: 440px; aspect-ratio: 2 / 3; }
  .approval-row { align-items: stretch; flex-direction: column; }
  .approval-actions { justify-content: flex-end; }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
}
