/* On2NextNow — ONE stylesheet for the web app and the standalone HTML briefings.
   make_briefing.py inlines this file, so the saved briefing and the website match. */
:root {
  --bg: #0f1420; --panel: #171d2b; --panel2: #1d2536; --line: #28304a;
  --text: #e8ecf5; --muted: #8b95ad; --accent: #4f8cff;
  --high: #ff5c6c; --med: #ffb020; --low: #38c98f; --none: #6b7594;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---------- web-only chrome ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar-inner { max-width: 1000px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: .01em; }
.logo:hover { text-decoration: none; }
.tag { color: var(--muted); font-size: 13px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- briefing header ---------- */
header.top { border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 28px; }
.brand { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { font-size: 30px; margin: 8px 0 4px; line-height: 1.25; }
.sub { color: var(--muted); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 26px 0 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.stat .big { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.bar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; margin-top: 10px; background: var(--panel2); }
.bar span { display: block; }
.legend { font-size: 11px; color: var(--muted); margin-top: 6px; }
.toplist { margin-top: 4px; font-size: 13px; color: var(--muted); }
.toplist b { color: var(--text); }
details.how { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
details.how > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13.5px; list-style: none; }
details.how > summary::-webkit-details-marker { display: none; }
details.how > summary::before { content: "ⓘ  "; }
.how-body { margin-top: 10px; font-size: 13.5px; color: #c7cede; }
.how-body p { margin: 8px 0; }
.how-body b { color: var(--text); }

/* ---------- release card ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin: 16px 0; transition: border-color .2s; }
.card:hover { border-color: var(--accent); }
.card-head { display: flex; gap: 14px; align-items: flex-start; }
.num { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 4px; min-width: 24px; }
.num a { color: var(--muted); }
.card-title-wrap { flex: 1; min-width: 0; }
.card-title { margin: 0; font-size: 18px; line-height: 1.35; }
.card-title a { color: var(--text); }
.meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; letter-spacing: .03em; border: 1px solid; }
.badge.high   { background: rgba(255,92,108,.15);  color: var(--high);   border-color: rgba(255,92,108,.35); }
.badge.medium { background: rgba(255,176,32,.15);  color: var(--med);    border-color: rgba(255,176,32,.35); }
.badge.low    { background: rgba(107,117,148,.15); color: #a3acc2;      border-color: rgba(107,117,148,.35); }
.badge.none   { background: rgba(107,117,148,.15); color: var(--none);   border-color: rgba(107,117,148,.3); }
/* Colour = something to act on. Risk: red/amber, otherwise grey (no threat = no colour).
   Opportunity: green/blue, otherwise grey. Key figures stay green (highlighted numbers). */
/* Opportunity is good news: its own scale, so HIGH never looks like danger */
.badge.opp.high   { background: rgba(56,201,143,.15);  color: var(--low);    border-color: rgba(56,201,143,.35); }
.badge.opp.medium { background: rgba(79,140,255,.15);  color: var(--accent); border-color: rgba(79,140,255,.35); }
.badge.opp.low, .badge.opp.none { background: rgba(107,117,148,.15); color: var(--none); border-color: rgba(107,117,148,.3); }
.sectors { margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); padding: 3px 10px; border-radius: 20px; }
.chip.sector { color: #bcd0ff; border-color: #2f3d63; }
.chip.money { color: var(--low); border-color: rgba(56,201,143,.35); font-weight: 600; }
.summary { margin: 12px 0 6px; font-size: 15px; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.kf { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--low); border-radius: 8px; padding: 8px 12px; }
.kf-amt { display: block; font-size: 15px; font-weight: 700; color: var(--low); }
.kf-lbl { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
details.more { margin-top: 8px; }
details.more > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
.details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.drow { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(40,48,74,.5); }
.drow:last-child { border-bottom: none; }
.dlbl { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.dval { font-size: 14px; }
.dval ul { margin: 0; padding-left: 18px; }
.dval ul li { margin-bottom: 4px; }
.dval .chip { margin: 0 4px 4px 0; display: inline-block; }
footer.foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- web: briefings index ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 10px; }
.tile { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; color: var(--text); transition: border-color .2s; }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile-seg { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.tile-month { font-size: 21px; font-weight: 700; margin: 4px 0 10px; }
.tile-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.tile-nums b { color: var(--text); font-size: 15px; }
.tile-nums .r b { color: var(--high); }
.tile-nums .o b { color: var(--low); }
.month-h { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 30px 0 4px; }

/* ---------- web: filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 6px; }
.filters select, .filters input[type=search] {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font: inherit; font-size: 13.5px;
}
.filters input[type=search] { flex: 1; min-width: 180px; }
.filters button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.showing { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }

@media (max-width: 620px) {
  .card-head { flex-wrap: wrap; gap: 8px 10px; }
  .card-title-wrap { flex: 1 1 calc(100% - 40px); }
  .badges { flex-direction: row; flex-wrap: wrap; align-items: center; width: 100%; padding-left: 34px; }
  .card { padding: 16px; }
  .filters select { flex: 1 1 140px; }
  .drow { grid-template-columns: 1fr; gap: 2px; }
  h1 { font-size: 24px; }
}

/* ---------- web: login + user box ---------- */
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.userbox button { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.userbox button:hover { border-color: var(--accent); }
.login { max-width: 420px; margin: 30px auto 0; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.login-form input { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; }
.login-form input:focus { outline: none; border-color: var(--accent); }
.login-form button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; margin-top: 4px; }
.alert { margin-top: 18px; background: rgba(255,92,108,.12); border: 1px solid rgba(255,92,108,.35); color: #ffb3bb; border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* ---------- release type label (step 2) ---------- */
.rtype { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
         padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); background: var(--panel2); }
.rtype.rt-policy   { color: #ffd27a; border-color: rgba(255,176,32,.4); }
.rtype.rt-scheme   { color: #7fe0b5; border-color: rgba(56,201,143,.4); }
.rtype.rt-contract { color: #9cc0ff; border-color: rgba(79,140,255,.45); }
.rtype.rt-enforcement { color: #ffa3ad; border-color: rgba(255,92,108,.4); }

/* ---------- web: alerts page (Phase 3) ---------- */
.navlink { color: var(--text); font-size: 13px; margin-right: 6px; }
.notice { margin: 16px 0; background: rgba(56,201,143,.12); border: 1px solid rgba(56,201,143,.35); color: #9be7c6; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.alerts-form { margin-top: 18px; }
.alerts-form h3 { font-size: 16px; margin: 26px 0 10px; }
.toggle { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.checkgrid label { font-size: 14px; display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.checkgrid input, .toggle input { accent-color: var(--accent); margin-top: 3px; }
.filterbox { width: 100%; margin-bottom: 8px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 14px; }
.alerts-form button { margin-top: 22px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 26px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }

/* ---------- web: "What matters" home feed (Phase 5) ---------- */
.periods { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 12px; }
.periods a { font-size: 13.5px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.periods a.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.periods a:hover { text-decoration: none; border-color: var(--accent); }
.periods .aside-link { margin-left: auto; border: 0; color: var(--accent); }
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 8px; }
.sec-h { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.top-grid .mini { border-color: #34406a; background: linear-gradient(180deg, #1b2236, var(--panel)); }
.mini { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.mini:hover { border-color: var(--accent); }
.mini-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.mini-top .badge { font-size: 10px; padding: 2px 7px; }
.mini-title { display: block; color: var(--text); font-weight: 700; font-size: 15.5px; line-height: 1.35; }
.mini-sum { margin: 6px 0 0; font-size: 13.5px; color: #c7cede; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-fig { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.mini-fig b { color: var(--low); }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 18px 0; font-size: 14px; }
.small { font-size: 12.5px; }
.feed-side .filterbox { margin-bottom: 6px; }
.mdir { list-style: none; padding: 0; margin: 0; max-height: 460px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.mdir li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid rgba(40,48,74,.6); font-size: 13px; }
.mdir li:last-child { border-bottom: 0; }
.mdir a { color: var(--text); }
.mcount { color: var(--muted); white-space: nowrap; font-size: 12px; }
.mcount b { color: var(--high); font-weight: 600; }
.sector-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sector-chips .chip:hover { border-color: var(--accent); text-decoration: none; }
@media (max-width: 900px) {
  .feed-layout { grid-template-columns: 1fr; }
  .feed-side { order: 2; }
  .periods .aside-link { margin-left: 0; }
}
@media (max-width: 600px) {
  .topbar .tag, .userbox span { display: none; }
  .userbox .navlink { font-size: 13px; }
}
