/* NOS Poster in the Nerds On Site look: NOS red #BF0000, navy #111827, white, Inter in heavy weights.
   Layout and touch targets from the Stitch design: crisp borders, 44px+ targets, readable in sunlight. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

:root {
  --red: #bf0000;
  --red-hover: #9a0000;
  --navy: #111827;
  --navy-2: #1f2937;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --on-red: #ffffff;
  --stop: #bf0000;
  --stop-bg: #fef2f2;
  --stop-line: #fca5a5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #fcd34d;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --af: #6d28d9;
  --af-bg: #f5f3ff;
  --chip-bg: #f3f4f6;
  --side-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120; --card: #111827; --text: #f9fafb; --text-2: #d1d5db; --muted: #9ca3af;
    --line: #1f2937; --line-strong: #374151;
    --red: #e11d1d; --red-hover: #f43f3f;
    --stop: #f87171; --stop-bg: #2a1215; --stop-line: #7f1d1d;
    --warn: #fbbf24; --warn-bg: #2a200c; --warn-line: #78350f;
    --ok: #34d399; --ok-bg: #0b2a1f;
    --af: #c4b5fd; --af-bg: #2e1a5c; --chip-bg: #1f2937;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
body.app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* brand: "NERDS ON SITE" in red caps over "Poster" */
.brand { display: inline-flex; flex-direction: column; line-height: 1; text-decoration: none; }
.brand-nos { font: 900 .78rem var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.brand-app { font: 900 1.35rem var(--font); letter-spacing: -.02em; color: #fff; }

/* phone: navy top bar + bottom tabs */
.top { display: flex; align-items: center; justify-content: space-between; padding: .6rem 16px; background: var(--navy); border-bottom: 3px solid var(--red); }
.top form { margin: 0; }
.top .link { color: #cbd5e1; }
body.plain .top .brand-app { color: #fff; }

.side { position: fixed; inset: auto 0 0 0; z-index: 10; background: var(--navy); padding-bottom: env(safe-area-inset-bottom); }
.side-brand, .side-foot { display: none; }
.side-links { display: grid; grid-template-columns: repeat(5, 1fr); }
.side-links a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; min-height: 60px; text-decoration: none; color: #9ca3af; font: 600 .72rem var(--font); }
.side-links svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-links a[aria-current="page"] { color: #fff; box-shadow: inset 0 3px 0 var(--red); background: var(--navy-2); }

/* tablet and up: menu on the left */
@media (min-width: 720px) {
  body.app { padding: 0 0 0 var(--side-w); }
  body.app .top { display: none; }
  .side { inset: 0 auto 0 0; width: var(--side-w); display: flex; flex-direction: column; border-right: 3px solid var(--red); padding: 0; }
  .side-brand { display: block; padding: 1.4rem 1.25rem 1.25rem; border-bottom: 1px solid var(--navy-2); }
  .side-brand .brand-nos { font-size: .85rem; }
  .side-brand .brand-app { font-size: 1.7rem; }
  .side-brand p { margin: .45rem 0 0; font: 600 .7rem var(--font); letter-spacing: .1em; text-transform: uppercase; color: #9ca3af; }
  .side-links { display: flex; flex-direction: column; gap: .2rem; padding: 1rem .75rem; }
  .side-links a { flex-direction: row; gap: .8rem; min-height: 48px; padding: 0 .9rem; border-radius: 8px; font-size: .98rem; color: #d1d5db; }
  .side-links a:hover { background: var(--navy-2); color: #fff; }
  .side-links a[aria-current="page"] { background: var(--red); color: #fff; box-shadow: none; }
  .side-foot { display: block; margin-top: auto; padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--navy-2); }
  .side-foot .link { color: #9ca3af; }
}

main { max-width: 820px; margin: 0 auto; padding: 1.25rem 16px 2rem; }
@media (min-width: 720px) { main { padding: 2rem 2rem 3rem; } }

h1 { font-size: 2rem; font-weight: 900; line-height: 1.15; letter-spacing: -.03em; margin: .25rem 0 1rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
h1 small { display: block; width: 100%; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); order: -1; }
h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; margin: 2rem 0 .75rem; display: flex; align-items: center; gap: .5rem; }
h3 { font-size: 1.08rem; font-weight: 800; line-height: 1.3; margin: 0; }
h3 a { color: inherit; text-decoration: none; }
section.card h2 { margin-top: 0; font-size: 1.1rem; }
.count { background: var(--red); color: var(--on-red); font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .05rem .6rem; }

.flash { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); padding: .6rem .8rem; border-radius: 8px; font-weight: 600; }
.empty { color: var(--muted); font-style: italic; }
.howto { color: var(--text-2); font-size: .9rem; margin: .6rem 0 0; }
.meta { font-size: .8rem; font-weight: 500; color: var(--muted); margin: .35rem 0; font-variant-numeric: tabular-nums; }
.rules { background: var(--chip-bg); border-left: 3px solid var(--navy); border-radius: 0 8px 8px 0; padding: .5rem .75rem; margin: .5rem 0; color: var(--text-2); font-size: .9rem; }

/* progress */
.progress { background: var(--navy); color: #fff; border-radius: 12px; padding: 1rem 1.1rem; }
.progress p { margin: 0 0 .6rem; color: #d1d5db; }
.progress b { color: #fff; font-weight: 900; font-size: 1.15rem; }
.progress-line b { color: var(--red); }
.bar { height: 8px; background: var(--navy-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--red); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; padding: 1rem 1.1rem; margin: .75rem 0; box-shadow: 0 1px 3px rgba(17, 24, 39, .06); }
.card.blocked { border-color: var(--stop-line); box-shadow: inset 5px 0 0 var(--stop); padding-left: 1.4rem; }
.card-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.card-head h3 { flex: 1 1 100%; }
.card.post .card-head h3 { flex: 1 1 auto; }
.blocker { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: #fff; background: var(--stop); border-radius: 4px; padding: .15rem .45rem; }
.inactive { opacity: .55; }
.badge { font-size: .74rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--chip-bg); color: var(--text-2); white-space: nowrap; }
.badge.af { color: var(--af); background: var(--af-bg); border-color: var(--af); }
.badge.muted { font-style: italic; }
.ext { text-decoration: none; font-size: 1.1rem; padding: 0 .3rem; }

.pick { display: grid; gap: .3rem; margin: .75rem 0 .5rem; }
.pick span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.warnings { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .4rem; }
.warnings li, .warnings span { display: block; padding: .5rem .75rem; border-radius: 8px; font-size: .88rem; font-weight: 600; line-height: 1.45; }
.warnings .stop { background: var(--stop-bg); color: var(--stop); border: 1px solid var(--stop-line); }
.warnings .stop::before { content: "⛔ "; }
.warnings .warn { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.warnings .warn::before { content: "⚠ "; }

details summary { cursor: pointer; }
.preview-wrap { border: 1px solid var(--line-strong); border-radius: 8px; margin: .5rem 0; }
.preview-wrap summary { padding: .65rem .75rem; font-size: .88rem; font-weight: 600; color: var(--text-2); min-height: 44px; }
.preview-wrap .preview { margin: 0 .5rem .5rem; }
.preview { white-space: pre-wrap; overflow-wrap: anywhere; font: .92rem/1.5 var(--font); background: var(--bg); padding: .75rem; border-radius: 8px; margin: .5rem 0 0; }
.image-note { font-size: .9rem; }
details.more { margin-top: 2rem; }
details.more > summary { font-weight: 700; padding: .75rem 0; }

/* buttons: NOS red, uppercase like their site */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .75rem; align-items: center; }
.form .actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.actions form { margin: 0; display: contents; }
button, .button { font: 700 .92rem var(--font); letter-spacing: .04em; text-transform: uppercase; border: 2px solid var(--red); border-radius: 6px; min-height: 48px; padding: .55rem 1rem; background: var(--red); color: var(--on-red); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
button:hover, .button:hover { background: var(--red-hover); border-color: var(--red-hover); }
button.secondary, .button.secondary { background: var(--card); color: var(--text); border-color: var(--navy); }
button.secondary:hover, .button.secondary:hover { background: var(--navy); color: #fff; }
.row-actions { display: flex; gap: .5rem; margin-top: .75rem; }
.edit-link { margin: .25rem 0 0; font-size: .9rem; font-weight: 600; }
.edit-link a { text-decoration: none; }
.edit-link a:hover { text-decoration: underline; }
/* A blocked post: the button stays available but stops looking inviting. */
button.danger { background: var(--card); color: var(--stop); border: 2px dashed var(--stop); }
button.danger:hover { background: var(--stop-bg); }
button.small, .button.small { min-height: 36px; padding: .25rem .75rem; font-size: .8rem; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: .25rem; min-height: 0; font-weight: 500; text-transform: none; letter-spacing: 0; }
h1 .button { margin-left: auto; }

/* forms */
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 700; }
.form label small, legend small { font-weight: 400; font-size: .8rem; color: var(--muted); }
.form label.check { display: flex; gap: .6rem; align-items: center; font-weight: 500; min-height: 44px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: 6px; padding: .6rem .75rem; min-height: 44px; width: 100%; max-width: 100%; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--red); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: -1px; }
textarea { resize: vertical; }
fieldset.days { border: 1px solid var(--line-strong); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 0 1rem; padding: .5rem .75rem; }
fieldset.days legend { font-weight: 700; padding: 0 .25rem; }
.thumb { max-width: 220px; border-radius: 8px; border: 1px solid var(--line); }

/* groups */
.card.group .joined { margin-top: .5rem; }
.card.group .joined label { display: flex; align-items: center; gap: .6rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card.group .joined select { width: auto; flex: 1; max-width: 14rem; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .95rem; }
.joined-joined { border-color: var(--ok); color: var(--ok); }
.joined-pending { border-color: var(--warn); color: var(--warn); }

/* lists */
ul.rows { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; }
ul.rows li { padding: .75rem 1rem; border-top: 1px solid var(--line); min-height: 44px; }
ul.rows li:first-child { border-top: 0; }
ul.rows li.done::before { content: "✓ "; color: var(--ok); font-weight: 800; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .5rem 0; }
.progress-line { color: var(--text-2); }
ul.log { list-style: none; padding: 0; margin: 0; }
ul.log li { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; }
ul.log .log-main { display: grid; }
ul.log .log-main a { text-decoration: none; color: var(--text); }
ul.log .enq { display: flex; align-items: center; gap: .5rem; }
ul.log .enq b { min-width: 1.5rem; text-align: center; font-variant-numeric: tabular-nums; }
ul.log form:last-child { grid-column: 1 / -1; }

.login { max-width: 420px; margin: 3rem auto; border-top: 4px solid var(--red); }
.login h1 { margin-top: 0; }
.checklist li, .card li { margin: .3rem 0; }
