:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #5d6862;
  --paper: #f6f4ed;
  --surface: #fffdf8;
  --line: #d6d5cc;
  --accent: #1e6655;
  --accent-dark: #104438;
  --warning: #7b4d00;
  --danger: #9d2531;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.5; }
a { color: var(--accent-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, .button { display: inline-block; border: 1px solid var(--accent-dark); border-radius: 0.35rem; padding: 0.65rem 1rem; background: var(--accent-dark); color: #fff; cursor: pointer; text-decoration: none; }
.button-secondary { background: transparent; color: var(--accent-dark); }
button:hover, .button:hover { background: var(--accent); color: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #e3902f; outline-offset: 3px; }

.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 10; background: #fff; color: var(--ink); padding: 0.75rem; }
.skip-link:focus { top: 1rem; }
.site-header, .app-nav, main, footer { max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
.site-header { min-height: 4.5rem; display: flex; align-items: center; gap: 1.25rem; justify-content: space-between; }
.site-header nav, .app-nav, .button-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.wordmark { color: var(--ink); font-size: 1.25rem; font-weight: 800; text-decoration: none; letter-spacing: -0.04em; }
.scenario-picker { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.scenario-picker select { max-width: 13rem; padding: 0.35rem; }
.app-nav { padding-block: 0.75rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.app-nav a { padding: 0.4rem 0.2rem; text-decoration: none; }
.app-nav a[aria-current="page"] { color: var(--ink); border-bottom: 3px solid var(--accent); font-weight: 700; }
main { padding-block: 2.5rem 4rem; }
.hero { padding: clamp(2.5rem, 8vw, 6rem) 0; max-width: 50rem; }
h1, h2, h3 { line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 4.2rem); letter-spacing: -0.055em; margin: 0.25rem 0 1rem; }
h2 { margin-top: 0; }
.lede { font-size: clamp(1.1rem, 2vw, 1.4rem); max-width: 43rem; color: var(--muted); }
.eyebrow { margin: 0; color: var(--accent-dark); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.feature-grid, .card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.feature-grid article, .watch-card, .detail-card, .status-card, .notice { background: var(--surface); border: 1px solid var(--line); border-radius: 0.55rem; padding: 1.25rem; box-shadow: 0 2px 8px rgb(24 32 29 / 0.04); }
.notice { margin-top: 2rem; border-left: 5px solid var(--accent); }
.page-heading { margin-bottom: 1.5rem; max-width: 50rem; }
.page-heading h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.state-control { margin: 1.25rem 0; padding: 0.85rem; background: #ecebe4; border-radius: 0.4rem; }
.state-control summary { cursor: pointer; font-weight: 700; }
.state-control .button-row { margin-top: 0.75rem; }
.state-control .button { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
.status-card { max-width: 42rem; }
.centered { display: grid; min-height: 50vh; place-items: center; }
.status-error { border-left: 5px solid var(--danger); }
.status-warning { border-left: 5px solid var(--warning); }
.filters { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.6rem; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 0.55rem; padding: 1rem; margin-bottom: 1rem; }
.filters label { font-weight: 700; font-size: 0.9rem; }
.filters input, .filters select { width: 100%; border: 1px solid #89928c; border-radius: 0.3rem; padding: 0.55rem; background: #fff; }
.filters button { align-self: end; }
.muted, .private-notice { color: var(--muted); }
.tag-list { padding: 0; display: flex; gap: 0.4rem; flex-wrap: wrap; list-style: none; }
.tag-list li { background: #dceae3; border-radius: 99px; padding: 0.15rem 0.55rem; font-size: 0.85rem; }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.8rem; }
dt { color: var(--muted); font-size: 0.85rem; }
dd { margin: 0.15rem 0 0; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 38rem; border-collapse: collapse; background: var(--surface); }
caption { text-align: left; padding: 0.75rem 0; font-weight: 700; }
th, td { border: 1px solid var(--line); padding: 0.7rem; text-align: left; vertical-align: top; }
th { background: #e9eee9; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; padding-block: 1.5rem; }
.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: 44rem) {
  .site-header { align-items: flex-start; flex-direction: column; padding-block: 1rem; gap: 0.75rem; }
  .filters, .collection-form, .media-upload-form { grid-template-columns: 1fr; }
  .filters button { justify-self: start; }
  .media-upload-form label, .collection-form label[for="collection-notes"], .collection-form textarea, .collection-form button { grid-column: auto; }
}

.collection-list { display: grid; gap: 1rem; margin-top: 1rem; }
.collection-create { margin-bottom: 1.5rem; }
.collection-form, .media-upload-form { display: grid; gap: 0.65rem; }
.collection-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.collection-form label, .media-upload-form label { font-weight: 700; font-size: 0.9rem; }
.collection-form input, .collection-form textarea, .media-upload-form input { width: 100%; border: 1px solid #89928c; border-radius: 0.3rem; padding: 0.55rem; background: #fff; }
.collection-form textarea { resize: vertical; }
.collection-form label[for="collection-notes"], .collection-form textarea, .collection-form button { grid-column: 1 / -1; }
.collection-form button, .media-upload-form button { justify-self: start; }
.collection-media { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.media-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.media-heading h3 { margin: 0; }
.media-upload-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-top: 1rem; }
.media-upload-form label { grid-column: 1 / -1; }
.media-upload-form input { min-width: 0; }
.media-empty { color: var(--muted); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.media-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 0.45rem; background: #fff; }
.media-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #e9eee9; }
.media-card figcaption { display: grid; gap: 0.6rem; padding: 0.7rem; font-size: 0.82rem; color: var(--muted); }
.button-danger { border-color: var(--danger); background: var(--danger); }
.button-danger:hover { background: #791c25; }

.collection-create-form, .media-upload-form { display: grid; gap: 0.6rem; max-width: 38rem; padding: 1rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 0.55rem; }
.collection-create-form input, .media-upload-form input { max-width: 100%; }
.collection-list { display: grid; gap: 1rem; }
.collection-card h3 { margin-top: 1.5rem; }
.private-media-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.private-media-card { padding: 0.75rem; background: #f3f4ee; border: 1px solid var(--line); border-radius: 0.4rem; }
.private-media-card p { font-size: 0.85rem; overflow-wrap: anywhere; }
.private-media-image { display: block; width: 100%; max-height: 15rem; object-fit: cover; border-radius: 0.3rem; background: #e6e7df; }
