:root {
  /* Brand palette: deep navy + bright yellow */
  --navy: #00316B;
  --navy-deep: #001F45;
  --navy-mid: #073763;
  --navy-soft: #E7EEF8;
  --yellow: #FFD400;
  --yellow-warm: #FECB0D;
  --yellow-soft: #FFF6CC;

  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --ink: #14213D;
  --ink-2: #44506A;
  --ink-3: #6B7690;
  --line: #E1E6EF;
  --accent: var(--navy);
  --accent-soft: var(--navy-soft);
  --chip-on-bg: var(--navy);
  --chip-on-ink: #FFFFFF;

  --sec-govt: #00316B;
  --sec-news: #B45309;
  --sec-research: #0F766E;
  --sec-global: #5B3FA8;
  --sec-govt-soft: #E7EEF8;
  --sec-news-soft: #FDF1E3;
  --sec-research-soft: #E3F4F1;
  --sec-global-soft: #EFEAF9;

  --shadow: 0 1px 2px rgba(0, 31, 69, .06), 0 4px 14px rgba(0, 31, 69, .06);
  --shadow-hover: 0 2px 4px rgba(0, 31, 69, .08), 0 10px 24px rgba(0, 31, 69, .10);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1324; --surface: #111C33; --ink: #E7ECF5; --ink-2: #B8C2D6; --ink-3: #8C97AE;
    --line: #22304D; --accent: #8DB8F2; --accent-soft: #1A2B4D; --navy-soft: #1A2B4D;
    --chip-on-bg: #FFD400; --chip-on-ink: #001F45;
    --sec-govt: #8DB8F2; --sec-news: #F2B26B; --sec-research: #6FD1C1; --sec-global: #B9A2EE;
    --sec-govt-soft: #1A2B4D; --sec-news-soft: #3A2A16; --sec-research-soft: #12322F; --sec-global-soft: #2A2245;
    --yellow-soft: #3A3315;
    --shadow: none; --shadow-hover: 0 0 0 1px #2E3F63;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1324; --surface: #111C33; --ink: #E7ECF5; --ink-2: #B8C2D6; --ink-3: #8C97AE;
  --line: #22304D; --accent: #8DB8F2; --accent-soft: #1A2B4D; --navy-soft: #1A2B4D;
  --chip-on-bg: #FFD400; --chip-on-ink: #001F45;
  --sec-govt: #8DB8F2; --sec-news: #F2B26B; --sec-research: #6FD1C1; --sec-global: #B9A2EE;
  --sec-govt-soft: #1A2B4D; --sec-news-soft: #3A2A16; --sec-research-soft: #12322F; --sec-global-soft: #2A2245;
  --yellow-soft: #3A3315;
  --shadow: none; --shadow-hover: 0 0 0 1px #2E3F63;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
button, input, select { font: inherit; color: inherit; }
.ic { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Masthead ---------- */
.masthead {
  position: relative; color: #fff; padding: 30px 0 34px;
  background:
    radial-gradient(1200px 300px at 85% -40%, rgba(255, 212, 0, .16), transparent 60%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, var(--navy-deep) 100%);
  overflow: hidden;
}
.masthead::after { /* faint pulse line motif */
  content: ""; position: absolute; right: -40px; top: 18px; width: 520px; height: 140px; opacity: .10; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 140'%3E%3Cpath d='M0 80h120l30-60 50 110 40-90 30 40h250' fill='none' stroke='%23FFD400' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.masthead-inner { position: relative; z-index: 1; display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.brand { display: flex; gap: 16px; align-items: flex-start; max-width: 720px; }
.brand-mark {
  display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 14px;
  background: var(--yellow); color: var(--navy); font-size: 30px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.brand-mark .ic { stroke-width: 2.6; }
.eyebrow { margin: 2px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); }
h1 {
  margin: 0; font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 800;
  font-size: clamp(28px, 4.4vw, 42px); line-height: 1.08; letter-spacing: -.02em;
}
h1 .hl { color: var(--yellow); }
.sub { margin: 10px 0 0; max-width: 600px; color: rgba(255, 255, 255, .85); }

.stats { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.stat {
  display: flex; flex-direction: column; justify-content: center; min-width: 96px; padding: 10px 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px;
}
.stat-n { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 800; font-size: 26px; line-height: 1.1; color: var(--yellow); }
.stat-l { font-size: 12px; color: rgba(255, 255, 255, .8); }
.updated { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .75); display: flex; gap: 6px; align-items: center; }
.masthead-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--yellow), var(--yellow-warm)); }

/* ---------- Tabs ---------- */
.tabs-bar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 rgba(0, 0, 0, .02); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 14px 14px 11px; cursor: pointer; color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.tab .ic { font-size: 17px; color: var(--ink-3); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--yellow); font-weight: 650; }
.tab[aria-selected="true"] .ic { color: var(--accent); }
.tab .n { font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.tab[aria-selected="true"] .n { background: var(--yellow-soft); color: var(--ink); }

/* ---------- Layout & filters ---------- */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 28px; padding-top: 26px; padding-bottom: 32px; }
.filters {
  position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  max-height: calc(100vh - 92px); overflow-y: auto;
}
.filter-group { display: flex; flex-direction: column; gap: 9px; }
.filter-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.search-box { position: relative; }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 16px; }
input[type="search"] {
  width: 100%; padding: 10px 12px 10px 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
input[type="search"]:focus, button:focus-visible { outline: 2px solid var(--yellow-warm); outline-offset: 1px; }

.segmented { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.segmented button { flex: 1; border: 0; background: none; padding: 8px 6px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--chip-on-bg); color: var(--chip-on-ink); font-weight: 600; }

/* Calendar */
.cal { border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 10px; background: var(--bg); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-title { font-weight: 650; font-size: 14px; }
.cal-nav {
  display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; color: var(--ink-2); font-size: 16px;
}
.cal-nav:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { font-size: 10.5px; font-weight: 700; color: var(--ink-3); padding: 2px 0 4px; }
.cal-day {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 8px; background: none; padding: 0;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}
.cal-day::after { /* dot = this day has updates */
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent);
}
.cal-day:hover:not(:disabled) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cal-day:disabled { color: var(--ink-3); font-weight: 400; opacity: .5; cursor: default; }
.cal-day:disabled::after { display: none; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--yellow-warm); }
.cal-day[aria-pressed="true"], .cal-day[aria-pressed="true"]:hover:not(:disabled) { background: var(--chip-on-bg); color: var(--chip-on-ink); box-shadow: none; }
.cal-day[aria-pressed="true"]::after { background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 11px 5px 9px; font-size: 13px; cursor: pointer; color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.chip .ic { font-size: 14px; color: var(--accent); }
.chip:hover { border-color: var(--accent); }
.chip .n { color: var(--ink-3); font-size: 11.5px; }
.chip[aria-pressed="true"] { background: var(--chip-on-bg); border-color: var(--chip-on-bg); color: var(--chip-on-ink); }
.chip[aria-pressed="true"] .ic { color: var(--yellow); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }
:root[data-theme="dark"] .chip[aria-pressed="true"] .ic { color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] .ic { color: var(--navy); } }

.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; text-transform: none; letter-spacing: 0; padding: 0; font-weight: 600; }
.reset {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  background: none; border: 1px dashed var(--line); border-radius: 10px; padding: 9px; cursor: pointer; color: var(--ink-2);
}
.reset:hover { border-color: var(--ink-3); color: var(--ink); }

/* ---------- Results ---------- */
.results-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.results-head .filter-toggle { margin-left: auto; }
.date-pill {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 4px 10px;
  background: var(--yellow-soft); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.date-pill .ic:last-of-type { color: var(--ink-3); }
.date-pill:hover .ic:last-of-type { color: var(--ink); }
#count { margin: 0; color: var(--ink-3); font-size: 14px; font-weight: 500; }
.filter-toggle { display: none; }
.day {
  display: flex; align-items: center; gap: 10px; margin: 26px 0 12px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase;
}
.day .ic { color: var(--accent); font-size: 15px; }
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day:first-child { margin-top: 6px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 12px; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card[data-section="govt"] { --sec: var(--sec-govt); --sec-soft: var(--sec-govt-soft); }
.card[data-section="news"] { --sec: var(--sec-news); --sec-soft: var(--sec-news-soft); }
.card[data-section="research"] { --sec: var(--sec-research); --sec-soft: var(--sec-research-soft); }
.card[data-section="global"] { --sec: var(--sec-global); --sec-soft: var(--sec-global-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; color: var(--sec); background: var(--sec-soft);
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; padding: 3px 9px 3px 7px; border-radius: 999px;
}
.badge .ic { font-size: 13px; }
.src { font-weight: 600; color: var(--ink-2); }
.card h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.38; font-weight: 650; letter-spacing: -.005em; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: var(--yellow-warm); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.blurb { margin: 0 0 12px; color: var(--ink-2); }
.foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; border-radius: 999px; padding: 3px 10px 3px 8px;
  background: var(--accent-soft); color: var(--accent); border: 0; cursor: pointer; font-weight: 500;
}
.tag .ic { font-size: 12.5px; }
.tag:hover { background: var(--yellow-soft); color: var(--ink); }
.read {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 600;
  color: var(--navy); background: var(--yellow); text-decoration: none; padding: 6px 12px; border-radius: 999px;
}
.read:hover { background: var(--yellow-warm); }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.more {
  display: block; margin: 18px auto; padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-weight: 600; color: var(--accent);
}
.more:hover { border-color: var(--accent); }

.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 13px; padding: 18px 0 28px; }
.footer p { margin: 6px 0; }
.footer strong { color: var(--ink); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .masthead { padding: 22px 0 26px; }
  .brand-mark { width: 44px; height: 44px; font-size: 24px; border-radius: 12px; }
  .stats { width: 100%; }
  .stat { flex: 1; min-width: 0; }
  .layout { display: flex; flex-direction: column; gap: 0; padding-top: 16px; }
  .filters { position: static; display: none; max-height: none; margin-bottom: 16px; order: 1; }
  .filters.open { display: flex; }
  .results { order: 2; }
  .filter-toggle {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
    border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600;
  }
  .card { padding: 16px; }
  .read { margin-left: 0; }
}
