/* =====================================================================
   lite.css  -  TYP Lite, embedded in facts4future.ch via iframe.
   Same colours as the Webflow site. No fixed or sticky parts: the iframe
   is as tall as its content, so the page scrolls, not the iframe.
   ===================================================================== */
:root {
  color-scheme: dark;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --surface: #000000;
  --surface-2: #18181b;
  --ink: #ffffff;
  --ink-2: #d4d4d8;
  --ink-3: #a1a1aa;
  --rule: #d4d4d8;
  --rule-soft: #3f3f46;
  --head: #2a2a2e;          /* column headers: dark grey (not in the styleguide) */
  --control: #52525b;
  --focus: #60a5fa;
  --d-yes: #0d8166;
  --d-no: #ef3550;
  --d-abst: #4d0717;
  --d-notpart: #081342;
  --d-excused: #2848d1;
  --d-president: #033527;
  --pos: #0d8166;
  --neg: #ef3550;
  --mark-ring: rgba(212, 212, 216, 0.75);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); }
body { color: var(--ink); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
img { display: block; }

#app { max-width: 1200px; margin: 0 auto; padding: 4px 16px 24px; }
.loading, .empty { color: var(--ink-2); padding: 32px 0; text-align: center; }
.empty .face { display: block; font-size: 28px; margin-bottom: 6px; }

h2 { font-size: 26px; line-height: 1.2; margin: 8px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* ---- back link ---- */
/* a real button with a border, so it is easy to find (same look as the other buttons) */
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0 16px; padding: 0 16px 0 12px;
        background: var(--surface); border: 1.5px solid var(--ink); border-radius: 10px; cursor: pointer;
        color: var(--ink); font-size: 15px; font-weight: 650; text-decoration: none; }
.back:hover { background: var(--surface-2); }

/* ---- home ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 20px 0 28px; }
.tile { display: block; padding: 18px 18px 16px; border: 1.5px solid var(--rule-soft); border-radius: 12px; text-decoration: none; }
.tile:hover { border-color: var(--ink); }
.tile b { display: flex; justify-content: space-between; font-size: 20px; margin-bottom: 6px; }
.tile span { color: var(--ink-2); font-size: 15px; }
.sources { border-top: 1px solid var(--rule-soft); padding-top: 14px; color: var(--ink-2); font-size: 14px; }
.sources ul { margin: 6px 0 10px; padding-left: 18px; }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 6px 0 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; flex: 1 1 170px; max-width: 280px; }
.field.grow { flex: 2 1 240px; max-width: none; }
.field > span { font-size: 13px; color: var(--ink-2); }
.sel, .search { width: 100%; min-height: 42px; padding: 0 12px; background: var(--surface); color: var(--ink);
                border: 1.5px solid var(--control); border-radius: 10px; }
.sel { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
       background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
       background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.sel.on, .search:not(:placeholder-shown) { border-color: var(--ink); }
.reset { min-height: 42px; padding: 0 14px; background: none; border: 1.5px solid var(--control); border-radius: 10px; cursor: pointer; }
.reset:hover { border-color: var(--ink); }
.reset[disabled] { opacity: .4; cursor: default; }
.count { color: var(--ink-2); font-size: 14px; margin: 0 0 6px; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; border: 1.5px solid var(--control); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 40px; padding: 0 16px; background: none; border: 0; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1.5px solid var(--control); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 650; }

/* ---- tables (rows become cards on phones) ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 650; color: var(--ink); background: var(--head); padding: 10px 10px; white-space: nowrap; }
.tbl th:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .num, .tbl .date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .go { width: 28px; text-align: right; color: var(--ink-3); font-size: 20px; }
.tbl td.go a { text-decoration: none; color: inherit; }
.tbl .title a { text-decoration: none; }
.tbl .title a:hover { text-decoration: underline; }
.sub { display: block; color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--control); border-radius: 999px;
         font-size: 12px; color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.coat { display: inline-flex; align-items: center; gap: 8px; text-transform: lowercase; }
.coat img { width: 20px; height: 24px; object-fit: contain; }

@media (max-width: 700px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { position: relative; padding: 10px 30px 10px 0; border-bottom: 1px solid var(--rule-soft); }
  .tbl td { border: 0; padding: 1px 0; }
  .tbl td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 13px; }
  .tbl td.title { font-weight: 600; padding: 2px 0 3px; }
  .tbl td.inline { display: inline-block; width: auto; margin-right: 12px; font-size: 14px; color: var(--ink-2); }
  .tbl td.go { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: auto; padding: 0; }
  .tbl tbody tr:hover td { background: none; }
  .tbl.people td.inline:first-child { color: var(--ink); font-weight: 600; font-size: 16px; }
}

/* ---- pager ---- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 4px; color: var(--ink-2); font-size: 14px; }
.pager button { min-height: 40px; min-width: 96px; padding: 0 14px; background: none; border: 1.5px solid var(--control); border-radius: 10px; cursor: pointer; }
.pager button:hover:not([disabled]) { border-color: var(--ink); }
.pager button[disabled] { opacity: .35; cursor: default; }

/* ---- answer marks ---- */
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--mark-ring); flex: none; }
.answer { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; color: #fff; white-space: nowrap; }
.pill.pos { background: var(--pos); }
.pill.neg { background: var(--neg); }
.mini { display: inline-flex; width: 84px; height: 9px; gap: 1px; border-radius: 3px; overflow: hidden; vertical-align: middle;
        background: var(--surface-2); box-shadow: 0 0 0 1.5px var(--mark-ring); margin-right: 8px; }
.mini span { display: block; height: 100%; min-width: 2px; }

/* ---- detail pages ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; margin: 10px 0 8px; }
.card { border: 1.5px solid var(--rule-soft); border-radius: 12px; padding: 14px 16px; }
.card h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 650; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.big-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.big-result small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin: 0 4px 0 2px; }

.pies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pie { border: 1.5px solid var(--rule-soft); border-radius: 12px; padding: 10px 8px 8px; text-align: center; background: none; cursor: pointer; }
.pie[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); }
.pie b { display: block; font-size: 15px; margin-bottom: 4px; }
.pie svg { width: 96px; height: 96px; display: block; margin: 0 auto 4px; }
.pie svg text { fill: var(--ink); }
.pie small { color: var(--ink-2); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }

.person { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start; margin-bottom: 8px; }
.person img.portrait { width: 160px; height: auto; border-radius: 10px; background: var(--surface-2); }
.person .credit { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.person h2 { margin-top: 0; }
@media (max-width: 520px) {
  .person { grid-template-columns: 96px 1fr; gap: 14px; }
  .person img.portrait { width: 96px; }
  h2 { font-size: 22px; }
}
.ext::after { content: " ↗"; }

/* ---- councillor lists: portrait and coat of arms ---- */
.tbl .photo { width: 60px; padding-top: 6px; padding-bottom: 6px; }
.thumb { display: block; width: 44px; height: 55px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 44px; height: 55px; object-fit: cover; object-position: top; }
.tbl.people .coat img { width: 24px; height: 28px; }
.tbl tr.nolink { cursor: default; }
.tbl tbody tr.nolink:hover td { background: none; }
@media (max-width: 700px) {
  .tbl.people tr { padding-left: 58px; min-height: 76px; }
  .tbl.people td.photo { position: absolute; left: 0; top: 10px; width: auto; padding: 0; }
}

/* ---- vote list: the title column takes the room ---- */
.tbl.votes .title { width: 100%; }
.tbl.votes td.title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { .tbl.votes td.title a { -webkit-line-clamp: 4; } }

.note { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.credit { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
.legal { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--rule-soft); font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.legal:empty { display: none; }

/* ---- small labels and buttons ---- */
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--control); border-radius: 999px;
       font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.tl-meta .tag { margin-left: 0; font-weight: 700; color: var(--ink); }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px;
       border: 1.5px solid var(--ink); color: var(--ink); background: var(--surface); text-decoration: none; font-weight: 650; }
.btn:hover { background: var(--surface-2); }
.btn .arrow { font-size: 20px; line-height: 1; }
.meta-line { margin: -4px 0 0; color: var(--ink-2); font-size: 14.5px; }

/* ---- Zeitstrahl (same as TYP Pro) ---- */
.ttiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; max-width: 560px; }
.ttile { border: 1px solid var(--control); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.ttile b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ttile span { color: var(--ink-2); font-size: 13px; line-height: 1.25; }
.card-box { border: 1px solid var(--control); border-radius: 14px; padding: 12px 14px; margin-top: 14px; max-width: 760px; }
.card-box > b { display: block; font-size: 16px; }
.finalrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0;
            border-top: 1px solid var(--control); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.card-box .finalrow:first-of-type { margin-top: 6px; }
.finalrow:hover { background: var(--surface-2); }
.card-box + .filters, .ttiles + .filters { margin-top: 16px; }
details.help { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; max-width: 760px; }
details.help summary { cursor: pointer; color: var(--ink); min-height: 32px; }
details.help p { margin: 6px 0; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 4px; color: var(--ink-2); font-size: 13.5px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .tl-dot { position: static; width: 14px; height: 14px; border-width: 2.5px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 26px; position: relative; max-width: 860px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--ink-3); }
.tl-head { margin: 18px 0 6px -26px; padding-left: 26px; font-weight: 800; font-size: 14px; color: var(--ink); position: relative; }
.tl-head:first-child { margin-top: 4px; }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -24px; top: 18px; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
          background: var(--surface); border: 3px solid var(--ink); display: inline-block; }
.tl-dot.first { background: var(--pos); border-color: var(--pos); box-shadow: 0 0 0 2px var(--mark-ring); }
.tl-dot.last { background: var(--neg); border-color: var(--neg); box-shadow: 0 0 0 2px var(--mark-ring); }
.tl-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 10px; margin-bottom: 6px;
           border: 1px solid var(--control); border-radius: 12px; color: var(--ink); text-decoration: none; }
.tl-card:hover { background: var(--surface-2); }
.tl-item.first .tl-card { border-color: var(--pos); }
.tl-item.last .tl-card { border-color: var(--neg); }
.tl-text { min-width: 0; }
.tl-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.tl-subj { margin-top: 3px; font-weight: 650; line-height: 1.3; white-space: pre-line; }
.tl-mean { margin-top: 6px; display: grid; gap: 4px; color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.tl-m { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: baseline; }
.tl-k { justify-self: start; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: 700; color: #fff; line-height: 1.5; }
.tl-k.yes { background: var(--pos); }
.tl-k.no { background: var(--neg); }
.tl-v { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-res { display: grid; justify-items: end; gap: 5px; }
.tl-score { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.own { font-style: italic; }

/* ---- councillor profile ---- */
.person.noface { grid-template-columns: 1fr; }
.person .kv { grid-template-columns: minmax(110px, auto) 1fr; }
.periods div + div { margin-top: 2px; }
.committees { margin: 0; padding-left: 18px; }
.committees li + li { margin-top: 2px; }
@media (max-width: 520px) {
  .person { grid-template-columns: 96px 1fr; }
  .person .kv { grid-template-columns: 1fr; gap: 0 0; }
  .person .kv dt { margin-top: 8px; font-size: 13px; }
}
.coat.named { text-transform: none; }

/* ---- party logos (only where a logo file exists) ---- */
/* every logo is a ready-made tile (party_logos.py): same white 336 x 160 tile, same visual weight.
   Shown at one fixed size everywhere, so no party gets a bigger display than another. */
.plogo { display: inline-block; width: 84px; height: 40px; flex: none; background: #fff; border-radius: 6px; overflow: hidden; }
.plogo img { width: 100%; height: 100%; object-fit: contain; }
.plogo.empty { background: none; }
.plogo.big { width: 126px; height: 60px; border-radius: 8px; }
.tbl .logo { width: 100px; }
.phead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0 12px; }
.phead h2 { margin: 0; }
.pwith { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .tbl.parties tr { padding-left: 98px; min-height: 60px; }
  .tbl td.logo { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: auto; padding: 0; }
}

