/* =========================================================
   FundScout.EU — Civic Index · v1.0
   Swiss grid, institutional, data-dense.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --ink: #0d0d0d;
  --ink2: #2b2b2b;
  --mute: #6b6b68;
  --rule: #1a1a1a;
  --rule-soft: #e6e5e0;
  --rule-softer: #f0efea;
  --accent: #0033a0;
  --accent-soft: #eef1f9;
  --red: #b3261e;
  --red-soft: #fde9e7;
  --amber: #b45309;
  --amber-soft: #fdebd0;
  --green: #1f6b3a;
  --green-soft: #e0ecdf;

  --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ff-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 40px;
  --maxw: 1440px;
}

@media (max-width: 900px) { :root { --gutter: 20px; } }
@media (max-width: 560px) { :root { --gutter: 16px; } }

/* ---------- Self-hosted fonts ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('../fonts/inter-variable.woff2') format('woff2-variations'),
       url('../fonts/inter-variable.woff2') format('woff2');
}
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/jetbrains-mono-variable.woff2') format('woff2-variations'),
       url('../fonts/jetbrains-mono-variable.woff2') format('woff2');
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--ff-sans);
  font-feature-settings: "tnum", "ss01", "kern";
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4, h5 { margin: 0; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--ff-mono); }

main { flex: 1; }

/* ---------- Header ---------- */
.civic-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.civic-header__brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.civic-header__logo {
  width: 22px; height: 22px; background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.civic-header__title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.civic-header__title span { color: var(--accent); }
.civic-header__meta {
  font-family: var(--ff-mono);
  font-size: 10px; color: var(--mute);
  margin-left: 10px; padding-left: 10px;
  border-left: 1px solid var(--rule-soft);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.civic-header__nav { display: flex; gap: 2px; margin-left: 20px; flex-wrap: wrap; }
.civic-header__nav a {
  font-size: 12px; font-weight: 600; color: var(--mute);
  padding: 6px 10px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.civic-header__nav a:hover { color: var(--ink); }
.civic-header__nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.civic-header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.civic-header__status {
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--mute);
  display: flex; align-items: center; gap: 6px;
}
.civic-header__status .dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

@media (max-width: 1024px) {
  .civic-header { flex-wrap: wrap; gap: 14px; }
  .civic-header__nav { order: 3; width: 100%; margin-left: 0; }
  .civic-header__actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .civic-header__meta { display: none; }
  .civic-header__status { display: none; }
  .civic-header__nav { gap: 0; }
  .civic-header__nav a { font-size: 11px; padding: 5px 6px; }
}

/* ---------- Footer ---------- */
.civic-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 40px var(--gutter) 24px;
  font-size: 13px;
  margin-top: auto;
}
.civic-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.civic-footer h4 {
  font-family: var(--ff-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: rgba(255,255,255,.55); margin-bottom: 12px; font-weight: 600;
}
.civic-footer a { color: rgba(255,255,255,.85); display: block; padding: 4px 0; font-size: 13px; }
.civic-footer a:hover { color: #fff; }
.civic-footer__bottom {
  max-width: var(--maxw); margin: 32px auto 0;
  padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 16px; font-family: var(--ff-mono);
  font-size: 10px; color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.civic-footer__credit { text-align: center; }
.civic-footer__credit a {
  display: inline; padding: 0; font-size: 10px;
  color: rgba(255,255,255,.6); border-bottom: 1px solid rgba(255,255,255,.18);
}
.civic-footer__credit a:hover { color: #fff; border-bottom-color: rgba(255,255,255,.5); }
.civic-footer__logo {
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  font-family: var(--ff-sans); color: #fff; margin-bottom: 10px;
}
.civic-footer__logo span { color: var(--accent); }
@media (max-width: 900px) {
  .civic-footer__grid { grid-template-columns: 1fr 1fr; }
  .civic-footer__bottom { flex-direction: column; gap: 8px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.05em;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--light { background: var(--bg); color: var(--ink); border-color: var(--rule-soft); }
.btn--light:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; border-color: currentColor; }
.btn--block { width: 100%; }

/* ---------- Utility atoms ---------- */
.num-label {
  font-family: var(--ff-mono);
  font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 500;
}
.mono { font-family: var(--ff-mono); }

.tag-chip {
  font-family: var(--ff-mono);
  display: inline-block;
  background: var(--rule-soft); color: var(--ink2);
  padding: 2px 6px; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
}
.tag-chip--accent { background: var(--accent-soft); color: var(--accent); }
.tag-chip--red { background: var(--red-soft); color: var(--red); }
.tag-chip--green { background: var(--green-soft); color: var(--green); }
.tag-chip--amber { background: var(--amber-soft); color: var(--amber); }

hr { border: none; border-top: 1px solid var(--rule-soft); margin: 28px 0; }

/* ---------- Landing: Hero ---------- */
.hero {
  padding: 40px var(--gutter) 32px;
  border-bottom: 1px solid var(--rule);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: end;
  max-width: var(--maxw);
  margin: 0 auto;
}
.hero__headline {
  font-size: clamp(42px, 5.2vw, 68px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin: 12px 0 18px;
  text-wrap: balance;
}
.hero__headline .accent { color: var(--accent); }
.hero__headline .mute { color: var(--mute); font-weight: 500; }
.hero__lede {
  font-size: 16px; line-height: 1.55;
  color: var(--ink2); max-width: 620px; margin: 0 0 22px;
}
.hero__search {
  display: flex; background: var(--surface);
  border: 1px solid var(--rule);
  align-items: center; padding: 2px 2px 2px 14px;
  max-width: 620px;
}
.hero__search .chevron {
  font-family: var(--ff-mono); font-size: 12px;
  color: var(--mute); margin-right: 10px;
}
.hero__search input {
  flex: 1; border: none; outline: none;
  font-size: 15px; padding: 14px 0; background: transparent;
}
.hero__search button {
  background: var(--ink); color: var(--bg);
  border: none; padding: 13px 20px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.hero__search button:hover { background: var(--accent); }
.hero__ops {
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--mute);
  margin-top: 10px; letter-spacing: 0.04em;
}
.hero__ops code { background: var(--rule-soft); padding: 1px 4px; }

.hero-search {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  max-width: 620px;
}
.hero-search__head {
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.06em;
}
.hero-search__row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
  align-items: center;
  color: var(--ink);
  transition: background .1s;
}
.hero-search__row:hover { background: var(--bg); color: var(--accent); }
.hero-search__row:last-child { border-bottom: none; }
.hero-search__t { font-size: 13px; font-weight: 600; line-height: 1.3; }
.hero-search__status {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  color: var(--mute);
  font-size: 12px;
  max-width: 620px;
}

/* Live ticker */
.ticker {
  background: var(--surface);
  border: 1px solid var(--rule);
}
.ticker__head {
  padding: 10px 14px;
  background: var(--ink); color: var(--bg);
  font-size: 11px; font-family: var(--ff-mono);
  letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; justify-content: space-between;
}
.ticker__head .pulse { animation: pulse 2s infinite; color: #ff5252; }
.ticker__row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
  display: grid; grid-template-columns: 46px 1fr 70px;
  gap: 8px; align-items: center;
  transition: background .15s;
}
.ticker__row:hover { background: var(--bg); }
.ticker__row:last-child { border-bottom: none; }
.ticker__days {
  font-family: var(--ff-mono);
  font-size: 11px; font-weight: 700;
  color: var(--mute);
}
.ticker__days.urgent { color: var(--red); }
.ticker__code {
  font-family: var(--ff-mono);
  font-size: 9px; color: var(--accent);
  text-transform: uppercase; font-weight: 700;
  letter-spacing: 0.06em;
}
.ticker__title {
  font-size: 12px; font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ticker__budget {
  font-family: var(--ff-mono);
  font-size: 11px; text-align: right;
  font-weight: 700;
}

@keyframes pulse {
  0%, 50%, 100% { opacity: 1; } 25%, 75% { opacity: 0.3; }
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- KPI band ---------- */
.kpi-band {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.kpi {
  padding: 18px 20px;
  border-left: 1px solid var(--rule-soft);
}
.kpi:first-child { border-left: none; }
.kpi__value {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  line-height: 1.1;
}
.kpi__note {
  font-family: var(--ff-mono);
  font-size: 10px; color: var(--green);
  margin-top: 4px; font-weight: 600;
}
.kpi__note.alarm { color: var(--red); }

@media (max-width: 1024px) { .kpi-band { grid-template-columns: repeat(3, 1fr); } .kpi:nth-child(4) { border-left: none; } }
@media (max-width: 560px)  { .kpi-band { grid-template-columns: repeat(2, 1fr); } .kpi { border-top: 1px solid var(--rule-soft); } .kpi:nth-child(odd) { border-left: none; } }

/* ---------- Two-row sections band ---------- */
.sections-band { border-bottom: 1px solid var(--rule); }
.sections-band__label {
  padding: 14px var(--gutter) 8px;
  background: var(--bg);
  border-top: 1px solid var(--rule-soft);
}
.sections-band__label:first-child { border-top: none; }

/* ---------- N-column index ---------- */
.sections {
  display: grid;
  border-top: 1px solid var(--rule);
}
.sections--3 { grid-template-columns: repeat(3, 1fr); }
.sections--2 { grid-template-columns: 1fr 1fr; }
.section-card--accent { border-top: 3px solid var(--accent) !important; }
.section-card {
  padding: 28px;
  border-left: 1px solid var(--rule);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 220px;
  transition: background .15s;
}
.section-card:first-child { border-left: none; }
.section-card:hover { background: var(--bg); }
.section-card__code {
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--mute); font-weight: 700;
}
.section-card__title { font-size: 22px; margin: 0; letter-spacing: -0.015em; }
.section-card__sub { font-size: 13px; color: var(--mute); margin: 0 0 14px; }
.section-card__big {
  font-size: 48px; font-weight: 700;
  letter-spacing: -0.03em; color: var(--accent);
  line-height: 1; margin: 8px 0;
}
.section-card__foot {
  margin-top: 20px; padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  display: flex; justify-content: space-between;
  font-family: var(--ff-mono); font-size: 11px;
}
.section-card__foot .src { color: var(--mute); }
.section-card__foot .cta {
  color: var(--accent); font-weight: 700;
  border-bottom: 1px solid var(--accent);
}
@media (max-width: 900px) {
  .sections, .sections--3, .sections--2 { grid-template-columns: 1fr; }
  .section-card { border-left: none; border-top: 1px solid var(--rule-soft); }
  .section-card:first-child { border-top: none; }
}

/* ---------- Split: Table + Heatmap ---------- */
.split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  border-bottom: 1px solid var(--rule);
}
.split__pane { padding: 28px var(--gutter); }
.split__pane--left { border-right: 1px solid var(--rule); }
.split__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.split__head h3 { font-size: 16px; letter-spacing: -0.01em; }
.split__meta { font-family: var(--ff-mono); font-size: 11px; color: var(--mute); }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split__pane--left { border-right: none; border-bottom: 1px solid var(--rule); }
}

/* ---------- Dense table ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tbl thead tr {
  border-bottom: 1px solid var(--rule);
  font-family: var(--ff-mono);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--mute);
  text-align: left;
}
.tbl th { padding: 10px 8px; font-weight: 600; }
.tbl td { padding: 11px 8px; vertical-align: top; }
.tbl tbody tr { border-bottom: 1px solid var(--rule-soft); }
.tbl tbody tr:hover { background: var(--rule-softer); }
.tbl .num { font-family: var(--ff-mono); font-weight: 700; text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.tbl .title-cell { max-width: 380px; }
.tbl .title-cell .t { font-weight: 600; }
.tbl .title-cell .id { font-family: var(--ff-mono); font-size: 10px; color: var(--mute); margin-top: 2px; }
.tbl .bar { width: 3px; background: var(--accent); align-self: stretch; }

.tbl a { color: var(--ink); }
.tbl a:hover { color: var(--accent); border-bottom: 1px solid var(--accent); }

/* ---------- Heatmap ---------- */
.heat {
  display: grid;
  gap: 3px;
}
.heat__col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat__cell { aspect-ratio: 1/1; background: var(--rule-soft); transition: transform .08s; }
.heat__cell:hover { transform: scale(1.25); outline: 1px solid var(--ink); z-index: 2; }
.heat__cell.l1 { background: rgba(0, 51, 160, 0.18); }
.heat__cell.l2 { background: rgba(0, 51, 160, 0.36); }
.heat__cell.l3 { background: rgba(0, 51, 160, 0.54); }
.heat__cell.l4 { background: rgba(0, 51, 160, 0.72); }
.heat__cell.l5 { background: rgba(0, 51, 160, 0.90); }
.heat__legend {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--ff-mono); font-size: 10px; color: var(--mute);
  margin-top: 8px;
}

/* Top-programme bars */
.prog-bar { margin-bottom: 8px; }
.prog-bar__head {
  display: flex; justify-content: space-between;
  font-size: 11px; margin-bottom: 3px;
  font-family: var(--ff-mono);
}
.prog-bar__head .name { color: var(--ink2); }
.prog-bar__head .num { color: var(--mute); }
.prog-bar__track { height: 8px; background: var(--rule-soft); }
.prog-bar__fill { height: 100%; background: var(--accent); }

/* ---------- Newsletter ---------- */
.newsletter {
  padding: 32px var(--gutter);
  background: var(--ink); color: var(--bg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.newsletter .num-label { color: rgba(255,255,255,.55); }
.newsletter__title {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em; margin: 6px 0 4px;
}
.newsletter__note { font-size: 13px; opacity: .7; }
.newsletter__form { display: flex; gap: 8px; }
.newsletter__form input {
  flex: 1; background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  color: var(--bg); padding: 12px 14px; font-size: 14px;
  outline: none;
}
.newsletter__form input::placeholder { color: rgba(255,255,255,.4); }
.newsletter__form button {
  background: var(--bg); color: var(--ink);
  border: none; padding: 12px 22px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.newsletter__form button:hover { background: var(--accent); color: #fff; }
@media (max-width: 800px) { .newsletter { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- Filter bar (Database view) ---------- */
.page-head {
  padding: 20px var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  display: flex; align-items: baseline; justify-content: space-between;
}
.page-head h1 { font-size: 28px; letter-spacing: -0.02em; margin: 4px 0 0; }
.page-head__meta { font-family: var(--ff-mono); font-size: 12px; color: var(--mute); }

.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 12px var(--gutter);
  display: flex; gap: 10px; align-items: center;
  font-family: var(--ff-mono); font-size: 12px;
  flex-wrap: wrap;
}
.filter-bar__search {
  display: flex; flex: 1 1 280px;
  border: 1px solid var(--rule); background: var(--bg);
}
.filter-bar__search .chev {
  padding: 8px 12px; color: var(--mute);
  border-right: 1px solid var(--rule-soft);
}
.filter-bar__search input {
  flex: 1; border: none; padding: 8px 10px;
  outline: none; background: transparent;
  font-size: 13px;
}
.filter-chip {
  border: 1px solid var(--rule);
  padding: 8px 12px; background: var(--bg);
  cursor: pointer;
  user-select: none;
}
.filter-chip:hover { background: var(--accent-soft); }
.filter-chip .caret { color: var(--mute); margin-left: 4px; }
.filter-chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-bar__apply {
  background: var(--ink); color: var(--bg);
  border: none; padding: 9px 14px;
  font-size: 11px; letter-spacing: 0.08em;
  font-weight: 700;
}

.list-pad { padding: 0 var(--gutter) 40px; }
.pagination {
  display: flex; justify-content: space-between;
  margin-top: 14px;
  font-family: var(--ff-mono); font-size: 11px; color: var(--mute);
}
.pagination__pages { display: flex; gap: 4px; }
.pagination__pages a, .pagination__pages span {
  padding: 4px 10px;
  border: 1px solid var(--rule-soft);
  background: var(--surface);
  color: var(--ink2);
}
.pagination__pages a:hover { background: var(--accent-soft); }
.pagination__pages .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Detail view ---------- */
.detail-breadcrumb {
  padding: 20px var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--mute); letter-spacing: 0.04em;
}
.detail-breadcrumb a:hover { color: var(--accent); }

.detail {
  padding: 28px var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
}
.detail__grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}
.detail__chips {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
}
.detail__title {
  font-size: clamp(28px, 3.6vw, 40px);
  margin: 0 0 12px; letter-spacing: -0.025em;
  line-height: 1.1; text-wrap: balance;
}
.detail__excerpt {
  font-size: 17px; color: var(--ink2);
  line-height: 1.6; margin: 0 0 24px;
}
.meta-table {
  background: var(--surface);
  border: 1px solid var(--rule);
  margin-bottom: 24px;
}
.meta-table table { border-collapse: collapse; width: 100%; font-size: 13px; }
.meta-table tr { border-bottom: 1px solid var(--rule-soft); }
.meta-table tr:last-child { border-bottom: none; }
.meta-table td { padding: 10px 14px; vertical-align: top; }
.meta-table td:first-child {
  width: 220px; color: var(--mute);
  font-family: var(--ff-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
}

.detail__body {
  font-size: 15px; line-height: 1.7;
  color: var(--ink);
}
.detail__body h2 {
  font-size: 20px; margin: 22px 0 10px;
  letter-spacing: -0.015em;
}
.detail__body h3 {
  font-size: 16px; margin: 18px 0 8px;
  color: var(--ink);
}
.detail__body p { margin: 0 0 1em; }
.detail__body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.detail__body a:hover { border-bottom-color: var(--accent); }
.detail__body ul, .detail__body ol { padding-left: 0; list-style: none; margin: 0 0 1em; }
.detail__body li {
  padding: 8px 0;
  border-top: 1px solid var(--rule-soft);
  display: flex; gap: 12px;
}
.detail__body li:first-child { border-top: 1px solid var(--rule); }
.detail__body li::before {
  content: counter(steps, decimal-leading-zero) "·";
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--mute);
  min-width: 30px;
  counter-increment: steps;
}
.detail__body ul, .detail__body ol { counter-reset: steps; }
.detail__body blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 14px; margin: 14px 0;
  background: var(--accent-soft);
  font-style: italic;
}
.detail__body hr { margin: 20px 0; border-top: 1px solid var(--rule-soft); }
.detail__body strong { font-weight: 700; }
.detail__body code {
  background: var(--rule-soft);
  padding: 1px 4px;
  font-size: 0.92em;
}
.detail__body img { border: 1px solid var(--rule-soft); margin: 14px 0; }

/* Sticky aside */
.detail__aside { position: relative; }
.sticky-card {
  position: sticky; top: 90px;
  background: var(--ink); color: var(--bg);
  padding: 20px;
}
.sticky-card__countdown {
  display: flex; align-items: baseline; gap: 8px; margin-top: 8px;
}
.sticky-card__days {
  font-size: 56px; font-weight: 700;
  letter-spacing: -0.035em; line-height: 1;
}
.sticky-card__label { font-size: 13px; opacity: .7; }
.sticky-card__bar {
  height: 4px; background: rgba(255,255,255,.2);
  margin-top: 12px; position: relative;
}
.sticky-card__bar-fill {
  height: 100%; background: var(--bg);
}
.sticky-card__range {
  font-family: var(--ff-mono); font-size: 10px; opacity: .6;
  margin-top: 4px;
  display: flex; justify-content: space-between;
}

@media (max-width: 900px) {
  .detail__grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; margin-top: 24px; }
}

/* ---------- Calendar (Fristen-Kalender) ---------- */
.cal-wrap { padding: 28px var(--gutter); }
.cal-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 24px;
  margin-bottom: 20px;
}
.cal-card__head {
  display: flex; justify-content: space-between; margin-bottom: 14px;
  flex-wrap: wrap; gap: 10px;
}
.cal-card__head .ttl { font-size: 15px; font-weight: 700; margin-top: 2px; }

.cal-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
@media (max-width: 900px) { .cal-split { grid-template-columns: 1fr; } }

.deadline-row {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 44px 1fr 80px;
  gap: 14px; align-items: center;
  transition: background .15s;
}
.deadline-row:hover { background: var(--bg); }
.deadline-row:last-child { border-bottom: none; }
.deadline-row .d-date { text-align: center; font-family: var(--ff-mono); }
.deadline-row .d-day {
  font-size: 20px; font-weight: 700; line-height: 1;
  color: var(--ink);
}
.deadline-row .d-day.urgent { color: var(--red); }
.deadline-row .d-mo {
  font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.deadline-row .d-code {
  font-family: var(--ff-mono); font-size: 10px;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 700;
}
.deadline-row .d-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.deadline-row .d-budget { font-family: var(--ff-mono); font-size: 12px; font-weight: 700; text-align: right; }
.deadline-row .d-t { font-family: var(--ff-mono); font-size: 10px; color: var(--mute); text-align: right; }
.deadline-row .d-t.urgent { color: var(--red); }

/* ---------- Stats dashboard bits ---------- */
.stat-bar { height: 8px; background: var(--rule-soft); margin: 4px 0 2px; }
.stat-bar > div { height: 100%; background: var(--accent); }

/* ---------- Post content (generic / wissen / antragstipps) ---------- */
.article-body {
  max-width: 760px; margin: 0 auto;
  padding: 0 var(--gutter);
  font-size: 16px; line-height: 1.7;
  color: var(--ink);
}
.article-body h2 { font-size: 26px; margin: 32px 0 12px; letter-spacing: -0.02em; }
.article-body h3 { font-size: 20px; margin: 24px 0 10px; letter-spacing: -0.015em; }
.article-body p, .article-body ul, .article-body ol { margin: 0 0 1.1em; }
.article-body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.article-body a:hover { border-bottom-color: var(--accent); }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px; margin: 16px 0;
  background: var(--accent-soft);
  font-style: italic;
}
.article-body hr { margin: 28px 0; border-top: 1px solid var(--rule-soft); }
.article-body img { margin: 14px 0; border: 1px solid var(--rule-soft); }
.article-body pre { background: var(--ink); color: var(--bg); padding: 12px 14px; overflow-x: auto; }
.article-body code { background: var(--rule-soft); padding: 1px 4px; font-size: 0.92em; }
.article-body table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.article-body table th, .article-body table td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); text-align: left; }
.article-body table thead th { font-family: var(--ff-mono); text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; color: var(--mute); border-bottom: 1px solid var(--rule); }

.article-head {
  padding: 40px var(--gutter) 24px;
  max-width: 760px; margin: 0 auto;
}
.article-head h1 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.025em; line-height: 1.15; text-wrap: balance; }
.article-head__meta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px;
}

/* ---------- Programs view ---------- */
.prog-tbl td { padding: 14px 8px; vertical-align: middle; }
.prog-tbl .code-badge {
  width: 46px; height: 28px;
  background: var(--accent); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em;
}
.prog-tbl .cat {
  font-family: var(--ff-mono); font-size: 10px; color: var(--mute);
  margin-top: 2px;
}

/* ---------- Error page ---------- */
.err {
  padding: 80px var(--gutter);
  max-width: 680px; margin: 0 auto; text-align: center;
}
.err h1 { font-size: 88px; color: var(--accent); letter-spacing: -0.04em; }
.err p { font-size: 17px; color: var(--ink2); margin: 10px 0 24px; }

/* ---------- Tag / author header ---------- */
.tax-head {
  padding: 40px var(--gutter) 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.tax-head h1 { font-size: 32px; letter-spacing: -0.025em; }
.tax-head__desc { color: var(--mute); margin-top: 6px; max-width: 680px; }

/* ---------- Post card (wissen / antragstipps list) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
@media (max-width: 1024px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .card-grid { grid-template-columns: 1fr; } }
.card-grid .card {
  padding: 22px;
  border-left: 1px solid var(--rule-soft);
  border-top: 1px solid var(--rule-soft);
  transition: background .15s;
}
.card-grid .card:nth-child(3n+1) { border-left: none; }
.card-grid .card:hover { background: var(--bg); }
.card__meta {
  font-family: var(--ff-mono);
  font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.card__title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.3; margin-bottom: 8px;
}
.card__excerpt {
  font-size: 13px; color: var(--ink2); line-height: 1.5;
}
.card__read {
  margin-top: 12px;
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--accent);
  font-weight: 700;
}

/* ---------- Membership portal overrides ---------- */
.gh-portal-triggerbtn-iframe { display: none !important; }

/* ---------- Keyboard focus ring ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--rule-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--mute); }

/* ---------- Programme Overview Page ---------- */
.prog-hero {
  padding: 32px var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.prog-hero__grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.prog-hero__title {
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 8px 0 12px;
  text-wrap: balance;
}
.prog-hero__lede {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink2);
  max-width: 620px;
  margin: 0;
}

.prog-meta-box {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 18px;
}
.prog-meta-box__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 8px;
}
.prog-meta-table {
  width: 100%; font-size: 13px; border-collapse: collapse;
}
.prog-meta-table tr {
  border-bottom: 1px solid var(--rule-soft);
}
.prog-meta-table tr:last-child { border-bottom: none; }
.prog-meta-table td {
  padding: 8px 0;
  vertical-align: top;
}
.prog-meta-table td:first-child {
  width: 120px;
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.prog-body {
  padding: 28px 0;
  max-width: var(--maxw);
  margin: 0 auto;
}
.prog-body .article-body h2 {
  font-size: 20px;
  margin: 24px 0 10px;
  letter-spacing: -0.015em;
}
.prog-body .article-body h2:first-of-type { margin-top: 0; }
.prog-body .programme-overview > .programme-header { display: none; }

.prog-calls { background: var(--bg); }
.prog-calls .page-head { background: var(--bg); border-top: none; }

@media (max-width: 900px) {
  .prog-hero__grid { grid-template-columns: 1fr; gap: 24px; }
  .prog-meta-box { order: -1; }
}

/* ---------- Programme overview cards (/programme/) ---------- */
.prog-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.prog-card {
  padding: 22px;
  border-left: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  transition: background .15s;
  position: relative;
}
.prog-card:hover { background: var(--bg); }
.prog-card__bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--accent);
}
.prog-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.prog-card__code {
  font-family: var(--ff-mono);
  font-size: 10px; color: var(--mute);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
}
.prog-card__title {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.25;
  margin: 0 0 8px;
}
.prog-card__title a { color: var(--ink); }
.prog-card__title a:hover { color: var(--accent); }
.prog-card__excerpt {
  font-size: 13px; color: var(--ink2);
  line-height: 1.4; margin-bottom: 14px;
}
.prog-card__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--ff-mono); font-size: 11px;
}
.prog-card__budget {
  color: var(--accent); font-weight: 700;
}
.prog-card__calls {
  color: var(--mute);
}

/* ---------- Sidebar Programme link block ---------- */
.sidebar-prog {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
}
.sidebar-prog__title {
  font-size: 14px; font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.005em;
}
.sidebar-prog a {
  color: var(--ink);
}
.sidebar-prog a:hover { color: var(--accent); }
.sidebar-prog__meta {
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--mute);
  margin-top: 6px;
}

/* ---------- Coming-Soon Modal ---------- */
#cv-cs-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .18s ease;
  padding: 20px;
}
#cv-cs-modal.cs-open { opacity: 1; }
#cv-cs-modal .cs-backdrop {
  position: absolute; inset: 0;
  background: rgba(13,13,13,.55);
  backdrop-filter: blur(4px);
}
#cv-cs-modal .cs-dialog {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--rule);
  max-width: 480px; width: 100%;
  padding: 28px 28px 22px;
  box-shadow: 0 20px 60px -10px rgba(13,13,13,.4);
  transform: translateY(12px);
  transition: transform .2s ease;
}
#cv-cs-modal.cs-open .cs-dialog { transform: translateY(0); }
#cv-cs-modal .cs-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none;
  font-size: 24px; color: var(--mute);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1;
}
#cv-cs-modal .cs-close:hover { color: var(--ink); }
#cv-cs-modal .cs-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 8px; margin-bottom: 12px;
  font-weight: 700;
}
#cv-cs-modal .cs-title {
  font-size: 24px; letter-spacing: -0.02em;
  margin: 0 0 10px;
  text-wrap: balance;
}
#cv-cs-modal .cs-text {
  font-size: 14px; line-height: 1.55;
  color: var(--ink2); margin: 0 0 12px;
}
#cv-cs-modal .cs-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 18px;
}
#cv-cs-modal .cs-form input {
  border: 1px solid var(--rule);
  background: var(--bg);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
#cv-cs-modal .cs-form input:focus {
  border-color: var(--accent);
}
#cv-cs-modal .cs-form button {
  background: var(--ink); color: var(--bg);
  border: none; padding: 10px 18px;
  font-family: var(--ff-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}
#cv-cs-modal .cs-form button:hover {
  background: var(--accent);
}
#cv-cs-modal .cs-hint {
  font-size: 10px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: 12px;
}

@media (max-width: 480px) {
  #cv-cs-modal .cs-form { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  .civic-header, .civic-footer, .sticky-card, .filter-bar, .newsletter, .ticker { display: none; }
  .detail__grid { grid-template-columns: 1fr; }
  body { background: #fff; }
}
