/* Fairfield County Scanner — broadsheet design system */
html, body { margin: 0; padding: 0; }
* { box-sizing: border-box; }

:root {
  --paper: #f7f4ee; --ink: #1c1b18; --muted: #757165; --faint: #9b968a;
  --rule: #e4e1d8; --rule2: #d2cec2; --card: #fffdf8; --chipbg: #efece4;
  --accent: #a32318; --c-fire: #c2362b; --c-ems: #1f7a4d; --c-police: #2a5fae; --c-mva: #b8860f;
  --bar: #1c1b18; --bartext: #cfccc2; --barbright: #f0eee8;
  --ok: #1f7a4d;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Libre Franklin', 'Public Sans', system-ui, sans-serif;
  --mono: 'Courier Prime', 'Courier New', ui-monospace, monospace;
}
[data-theme="dark"] {
  --paper: #171511; --ink: #ece7da; --muted: #a39d8e; --faint: #7b766a;
  --rule: #2b2820; --rule2: #3a352a; --card: #1e1b15; --chipbg: #262218;
  --accent: #e2604f; --c-fire: #e2604f; --c-ems: #43b07e; --c-police: #7aa0e0; --c-mva: #d9a23a;
  --bar: #0e0d0a; --bartext: #9c9788; --barbright: #ece7da;
  --ok: #43b07e;
}

body {
  background: var(--paper); color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: background .25s;
}
main { display: flex; flex-direction: column; flex: 1 0 auto; width: 100%; }
a { color: inherit; }
button { font-family: var(--sans); }

@keyframes fsPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(79,201,126,.5); } 50% { box-shadow: 0 0 0 5px rgba(79,201,126,0); } }
@keyframes fsRowIn { from { transform: translateY(-6px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes fsFlash { 0% { background: color-mix(in srgb, var(--accent) 16%, transparent); } 100% { background: transparent; } }
.maplibregl-ctrl-attrib { font-size: 9px !important; opacity: .7; }

/* ── utility bar ─────────────────────────────────────────── */
.fs-bar {
  background: var(--bar); color: var(--bartext);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 22px; font-family: var(--mono); font-size: 11.5px; flex-wrap: wrap;
}
.fs-bar-right { display: flex; align-items: center; gap: 10px; }
.fs-live { display: flex; align-items: center; gap: 7px; }
.fs-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4fc97e; animation: fsPulse 2s ease-in-out infinite; }
.fs-live-dot.off { background: var(--faint); animation: none; }
.fs-live b { color: var(--barbright); font-weight: 600; }
.fs-theme-btn {
  background: none; border: 1px solid rgba(255,255,255,.22); color: var(--barbright);
  border-radius: 6px; padding: 3px 9px; font-family: var(--mono); font-size: 11px; cursor: pointer;
}
.fs-admin-flag { background: var(--accent); color: #fff; border-radius: 5px; padding: 2px 8px; font-weight: 600; letter-spacing: .06em; }
.fs-bar a { color: var(--barbright); text-decoration: none; }

/* ── site banner ─────────────────────────────────────────── */
.fs-sitebanner {
  background: var(--accent); color: #fff; text-align: center;
  padding: 9px 22px; font-size: 13.5px; font-weight: 600; line-height: 1.4;
}

/* ── mastheads ───────────────────────────────────────────── */
.fs-wrap { max-width: 1140px; width: 100%; margin: 0 auto; padding: 0 22px; }
.fs-wrap-880 { max-width: 880px; width: 100%; margin: 0 auto; padding: 0 22px; }
.fs-wrap-780 { max-width: 780px; width: 100%; margin: 0 auto; padding: 0 22px; }
.fs-wrap-680 { max-width: 680px; width: 100%; margin: 0 auto; padding: 0 22px; }

.fs-masthead-big { padding-top: 30px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.fs-masthead-big .fs-title {
  font-family: var(--serif); font-size: clamp(28px, 5vw, 44px); font-weight: 900;
  line-height: 1; letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
}
.fs-masthead-big .fs-tagline { font-size: 13.5px; color: var(--muted); }
.fs-nav-big {
  margin-top: 12px; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule2);
  display: flex; justify-content: center; align-items: center; gap: clamp(18px, 4vw, 36px);
  padding: 11px 0; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.fs-recapline { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

.fs-masthead-compact { padding-top: 20px; }
.fs-masthead-compact .fs-mast-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-bottom: 1.5px solid var(--ink); padding-bottom: 12px;
}
.fs-masthead-compact .fs-title {
  font-family: var(--serif); font-size: 21px; font-weight: 900; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}
.fs-nav-compact {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 26px);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.fs-nav-link { color: var(--ink); text-decoration: none; cursor: pointer; }
.fs-nav-link:hover { color: var(--accent); }
.fs-nav-link.active { color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.fs-nav-more { color: var(--muted); cursor: pointer; position: relative; user-select: none; }
.fs-nav-more:hover { color: var(--accent); }
.fs-nav-more.active { color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.fs-more-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 230px;
  background: var(--card); border: 1px solid var(--rule2); border-radius: 10px;
  box-shadow: 0 12px 36px rgba(28,27,24,.18); padding: 6px; z-index: 50;
  text-align: left; text-transform: none; letter-spacing: 0; font-weight: 500;
}
.fs-more-item { display: block; padding: 9px 12px; border-radius: 7px; cursor: pointer; color: var(--ink); text-decoration: none; }
.fs-more-item:hover { background: var(--chipbg); color: var(--ink); }
.fs-more-item .t { font-size: 13.5px; font-weight: 700; }
.fs-more-item .d { font-size: 11.5px; color: var(--faint); }
.fs-more-item.current { background: var(--chipbg); }
.fs-more-item.current .t { color: var(--accent); }

/* ── page headers ────────────────────────────────────────── */
.fs-kicker {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.fs-h1 { margin: 0; font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); font-weight: 900; line-height: 1.1; text-wrap: pretty; }
.fs-sub { font-size: 15px; color: var(--muted); max-width: 640px; line-height: 1.5; }
.fs-sub a { color: var(--accent); font-weight: 700; text-decoration: none; }

/* ── section heads ───────────────────────────────────────── */
.fs-secthead { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; }
.fs-secthead .t { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.fs-secthead .line { flex: 1; height: 1px; background: var(--rule2); }
.fs-secthead .m { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ── chips & pills ───────────────────────────────────────── */
.fs-chip {
  border: 1px solid var(--rule2); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.fs-chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fs-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule2); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.fs-pill:hover { border-color: var(--accent); color: var(--accent); }
.fs-pill.quiet { background: none; color: var(--muted); }
.fs-btn-dark {
  background: var(--ink); color: var(--paper); border: none; border-radius: 999px;
  padding: 8px 20px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.fs-btn-danger {
  border: 1px solid var(--accent); background: none; color: var(--accent);
  border-radius: 999px; padding: 6px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.fs-btn-danger:hover { background: var(--accent); color: #fff; }
.fs-select {
  height: 30px; border: 1px solid var(--rule2); background: var(--card); color: var(--ink);
  border-radius: 7px; padding: 0 9px; font-size: 12.5px; font-family: var(--sans); cursor: pointer;
}
.fs-input {
  height: 42px; border: 1px solid var(--rule2); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 0 14px; font-size: 14px; font-family: var(--sans); outline: none;
}
.fs-input:focus { border-color: var(--accent); }
textarea.fs-input { height: auto; padding: 10px 14px; resize: vertical; }

/* ── incident / feed rows ────────────────────────────────── */
.fs-row { border-top: 1px solid var(--rule); cursor: pointer; animation: fsRowIn .25s ease-out; }
.fs-row:hover { background: color-mix(in srgb, var(--chipbg) 55%, transparent); }
.fs-row.flash { animation: fsFlash 2.4s ease-out; }
.fs-row-grid {
  display: grid; grid-template-columns: 60px 4px minmax(0,1fr) auto;
  gap: 0 14px; align-items: baseline; padding: 13px 2px;
}
.fs-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.fs-typebar { width: 4px; height: 14px; border-radius: 2px; align-self: center; }
.fs-headline { font-size: 15.5px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.fs-headline .sub { font-weight: 400; color: var(--muted); }
.fs-row-side { display: flex; align-items: center; gap: 10px; }
.fs-active-badge { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.fs-row-town { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.fs-row-detail { padding: 2px 2px 18px 78px; display: flex; flex-direction: column; gap: 11px; cursor: default; }
.fs-detail-text { font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 660px; text-wrap: pretty; }
.fs-unitsline { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.fs-quote {
  border-left: 3px solid var(--rule2); padding: 2px 0 2px 14px;
  font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--faint); max-width: 640px;
}
.fs-row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-progress { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; max-width: 380px; }
.fs-progress > div { height: 100%; width: 0%; background: var(--accent); }
.fs-empty { border-top: 1px solid var(--rule); padding: 28px 2px; font-size: 14px; color: var(--faint); font-style: italic; }
.fs-more-link { display: block; border-top: 1px solid var(--rule); padding-top: 14px; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: none; }

@media (max-width: 560px) {
  .fs-row-grid { grid-template-columns: 52px 4px minmax(0,1fr); }
  .fs-row-grid .fs-row-side { grid-column: 3; justify-content: flex-start; padding-top: 3px; }
  .fs-row-detail { padding-left: 2px; }
}

/* ── cards & stats ───────────────────────────────────────── */
.fs-card { border: 1px solid var(--rule2); background: var(--card); border-radius: 10px; padding: 16px 18px; }
.fs-statgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule2);
}
.fs-stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; border-left: 1px solid var(--rule); }
.fs-stat:first-child { border-left: none; padding-left: 0; }
.fs-stat .v { font-family: var(--serif); font-size: 26px; font-weight: 900; }
.fs-stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }

/* ── article (digest/about) ──────────────────────────────── */
.fs-article-meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); border-bottom: 1px solid var(--rule2); padding-bottom: 14px; }
.fs-lede { font-size: 16.5px; line-height: 1.65; color: var(--ink); text-wrap: pretty; }
.fs-pullquote { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule2); padding: 20px 0; display: flex; flex-direction: column; gap: 8px; }
.fs-pullquote .q { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.4; font-style: italic; text-wrap: pretty; }
.fs-pullquote .a { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.fs-pullquote .a a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ── footer ──────────────────────────────────────────────── */
.fs-footer {
  margin-top: auto; border-top: 1.5px solid var(--ink);
  max-width: 1140px; width: 100%; margin-left: auto; margin-right: auto;
  padding: 16px 22px 28px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}
.fs-footer a { color: var(--faint); text-decoration: none; }
.fs-footer a:hover { color: var(--accent); }
.fs-footer .links { display: flex; gap: 18px; }

/* ── charts (stats) ──────────────────────────────────────── */
.fs-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; border-bottom: 1px solid var(--rule2); }
.fs-bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.fs-bars .col > div { background: var(--ink); border-radius: 2px 2px 0 0; min-height: 2px; transition: height .4s; }
.fs-bars .col.max > div { background: var(--accent); }
.fs-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.fs-hbar { display: grid; grid-template-columns: 92px minmax(0,1fr) 34px; gap: 0 12px; align-items: center; padding: 6px 0; }
.fs-hbar .name { font-size: 13.5px; font-weight: 600; }
.fs-hbar .track { height: 14px; background: var(--chipbg); border-radius: 3px; overflow: hidden; }
.fs-hbar .track > div { height: 100%; background: var(--ink); border-radius: 3px; transition: width .4s; }
.fs-hbar .val { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.fs-segbar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; gap: 2px; }

/* ── chat ────────────────────────────────────────────────── */
.fs-chatbox { border: 1px solid var(--rule2); background: var(--card); border-radius: 10px; height: 440px; overflow-y: auto; display: flex; flex-direction: column; }
.fs-chatmsg { display: flex; flex-direction: column; gap: 3px; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.fs-chatmsg.mine { background: color-mix(in srgb, var(--chipbg) 55%, transparent); }
.fs-chatmsg .who { display: flex; align-items: baseline; gap: 9px; }
.fs-chatmsg .h { font-size: 13px; font-weight: 700; }
.fs-chatmsg.mine .h { color: var(--accent); }
.fs-chatmsg .t { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.fs-chatmsg .x { font-size: 14px; line-height: 1.5; color: var(--ink); text-wrap: pretty; overflow-wrap: break-word; }

/* ── admin ───────────────────────────────────────────────── */
.fs-admin-card { border: 1px solid var(--rule2); background: var(--card); border-radius: 12px; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.fs-admin-card .cardtitle { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.fs-admin-card .cardsub { font-size: 13px; color: var(--muted); line-height: 1.45; }
.fs-saved { font-size: 12.5px; font-weight: 700; color: var(--ok); }
.fs-error { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.fs-mono-note { font-family: var(--mono); font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.fs-table-row { display: grid; gap: 0 14px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--rule); }
.fs-out {
  background: var(--paper); border: 1px solid var(--rule2); border-radius: 8px;
  font-family: var(--mono); font-size: 11px; line-height: 1.55; padding: 10px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; color: var(--muted);
}
.fs-toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule2); background: transparent; color: var(--muted); border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.fs-toggle.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* misc */
.fs-tag {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  border: 1px solid currentColor; border-radius: 5px; padding: 1px 7px; white-space: nowrap;
}
.fs-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.fs-link { color: var(--accent); font-weight: 700; text-decoration: none; cursor: pointer; }
.fs-spin { display: inline-block; animation: fsSpin 1s linear infinite; }
@keyframes fsSpin { to { transform: rotate(360deg); } }
