/* KAEG Parlamentarier-Rating. Farben und Schriften folgen aerzte-sg.ch. */
:root {
  --green: #7ab41d;
  --green-deep: #5b8a12;
  --green-tint: #f2fbe3;
  --blue: #004a96;
  --blue-deep: #00396f;
  --blue-tint: #e6edf5;
  --red: #e30613;
  --red-deep: #b5050f;
  --red-tint: #fce9ea;
  --amber: #b97a00;
  --amber-tint: #fff3d6;
  --grey: #8a8d99;
  --grey-tint: #ecedf0;
  --ink: #3a3c49;
  --muted: #6c6f7e;
  --line: #e1e3e9;
  --bg: #f4f4f5;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(58, 60, 73, .05), 0 8px 24px rgba(58, 60, 73, .06);
  --radius: 12px;
  --font-body: "Martel Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-head: "Open Sans", "Martel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font: 16px/1.6 var(--font-body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; }
h2 { font-size: 20px; font-weight: 700; margin: 36px 0 12px; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
.lead { font-size: 17px; color: var(--muted); max-width: 760px; margin-bottom: 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
code { background: var(--grey-tint); padding: 1px 6px; border-radius: 5px; font-size: 14px; }
button, .btn { font: 600 15px/1 var(--font-head); color: #fff; background: var(--blue); border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; }
button:hover, .btn:hover { background: var(--blue-deep); text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: var(--blue-tint); color: var(--blue); }
button.secondary:hover { background: #d8e3f1; }
button.danger { background: transparent; color: var(--red-deep); padding: 6px 8px; }
button.danger:hover { background: var(--red-tint); }
button.link { background: none; color: var(--blue); padding: 0; font: inherit; font-weight: 600; }
button.link:hover { text-decoration: underline; background: none; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9ccd6; border-radius: 8px; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 74, 150, .25); border-color: var(--blue); }
textarea { width: 100%; resize: vertical; }

/* Kopf */
.top { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(58, 60, 73, .03); }
.top::after { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--green) 0 50%, var(--blue) 50% 100%); }
.top .wrap { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font: 800 17px var(--font-head); color: var(--blue); }
.brand-sub { font-size: 13px; color: var(--muted); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a { font: 600 14.5px var(--font-head); color: var(--ink); padding: 8px 12px; border-radius: 8px; position: relative; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--blue); background: var(--blue-tint); }
.nav .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--amber); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--muted); }
.userbox button { padding: 7px 12px; font-size: 13.5px; }

main { padding-top: 36px; padding-bottom: 56px; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 24px; padding-top: 18px; padding-bottom: 28px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Anmeldung */
.login { max-width: 560px; margin: 40px auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; }
.login h1 { font-size: 26px; }
.login label { display: block; font: 600 14px var(--font-head); margin-bottom: 6px; }
.login .row { display: flex; gap: 10px; }
.login .row input { flex: 1; }
.msg { min-height: 24px; margin-top: 14px; font-size: 15px; }
.msg.ok { color: var(--green-deep); }
.msg.err { color: var(--red-deep); }

/* Übersicht */
.hero { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 44px; margin-bottom: 8px; border-left: 6px solid var(--green); }
.eyebrow { font: 700 13px var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--green-deep); margin-bottom: 8px; }
.hero h1 { font-size: 34px; }
.hero .lead { margin-bottom: 26px; }
.quick { position: relative; max-width: 520px; }
.quick input { width: 100%; padding: 13px 16px; font-size: 16px; }
.quick-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 5; overflow: hidden; }
.quick-results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--ink); border-bottom: 1px solid var(--line); }
.quick-results a:last-child { border-bottom: 0; }
.quick-results a:hover { background: var(--blue-tint); text-decoration: none; }
.quick-results .sub { margin: 0; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin-top: 40px; }
.section-title span { font: 700 12px var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--blue); padding: 3px 9px; border-radius: 6px; }
.section-title.green span { background: var(--green-deep); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.tile { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; color: var(--ink); border-top: 5px solid var(--blue); transition: transform .12s ease, box-shadow .12s ease; }
.tile.green { border-top-color: var(--green); }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(58, 60, 73, .06), 0 14px 32px rgba(58, 60, 73, .1); }
.tile .num { font: 800 40px/1 var(--font-head); color: var(--blue); }
.tile.green .num { color: var(--green-deep); }
.tile .num small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.tile h3 { font-size: 20px; margin: 10px 0 6px; }
.tile p { color: var(--muted); margin: 0; font-size: 15px; }
.tile .go { display: inline-block; margin-top: 14px; font: 600 14px var(--font-head); color: var(--blue); }
.callout { margin-top: 28px; background: var(--amber-tint); border-left: 5px solid var(--amber); border-radius: 10px; padding: 16px 20px; }
.callout a { font-weight: 600; }
.notice { background: var(--blue-tint); border-left: 5px solid var(--blue); border-radius: 10px; padding: 16px 20px; margin: 0 0 24px; }
.notice.warn { background: var(--red-tint); border-left-color: var(--red); }
.notice p:last-child { margin-bottom: 0; }

/* Filter */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.filters input[type=search] { min-width: 240px; flex: 1 1 240px; }
.filters .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; white-space: nowrap; }
.count { font-size: 14px; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 0 0 22px; }
.tabs a { font: 600 15px var(--font-head); color: var(--muted); padding: 10px 16px; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Tabellen */
.tablewrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafafb; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.inactive td { color: var(--muted); }
tr.inactive a { color: var(--muted); }
td a { font-weight: 600; }
.rating td:first-child { font: 700 15px var(--font-head); color: var(--muted); }

/* Matrix */
.matrix th, .matrix td { padding: 6px 8px; font-size: 13.5px; white-space: nowrap; }
.matrix th.vote { writing-mode: vertical-rl; transform: rotate(180deg); white-space: normal; height: 170px; padding: 8px 4px; font-weight: 500; font-size: 12px; text-transform: none; letter-spacing: 0; text-align: left; line-height: 1.2; width: 28px; }
.matrix td.cell { text-align: center; padding: 4px; width: 28px; }

/* Anzeigeelemente */
.pip { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; padding: 0 4px; border-radius: 6px; font: 700 12px var(--font-head); text-align: center; }
.pip.agree { background: var(--green); color: #fff; }
.pip.disagree { background: var(--red); color: #fff; }
.pip.abstention { background: var(--amber-tint); color: var(--amber); }
.pip.absent { background: var(--grey-tint); color: var(--grey); }
.pip.yes { background: var(--green-tint); color: var(--green-deep); border: 1px solid var(--green); }
.pip.no { background: var(--red-tint); color: var(--red-deep); border: 1px solid var(--red); }
.pip.none { background: transparent; color: var(--grey); }
.score { display: inline-flex; align-items: center; gap: 10px; min-width: 170px; }
.score .bar { flex: 0 0 110px; height: 10px; background: var(--grey-tint); border-radius: 5px; overflow: hidden; }
.score .bar > i { display: block; height: 100%; background: var(--green); }
.score .bar.mid > i { background: var(--amber); }
.score .bar.low > i { background: var(--red); }
.score b { font-family: var(--font-head); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.score.big { min-width: 0; gap: 14px; }
.score.big .bar { flex-basis: 180px; height: 14px; border-radius: 7px; }
.score.big b { font-size: 26px; font-weight: 800; }
.score.none { color: var(--muted); font-size: 14px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 600 12.5px var(--font-head); white-space: nowrap; vertical-align: middle; }
.tag.relevant { background: var(--green-tint); color: var(--green-deep); }
.tag.relevant_ohne_position { background: var(--amber-tint); color: var(--amber); }
.tag.offen { background: var(--amber); color: #fff; }
.tag.irrelevant { background: var(--grey-tint); color: var(--grey); }
.tag.untagged { background: transparent; color: var(--grey); border: 1px solid var(--line); }
.tag.pos { background: var(--blue-tint); color: var(--blue); }
.tag.w { background: var(--blue); color: #fff; }
.tag.party { background: var(--blue-tint); color: var(--blue); }
.tag.role { background: var(--green-tint); color: var(--green-deep); }
.tag.role.reader { background: var(--grey-tint); color: var(--muted); }

/* Fraktionen */
.fsummary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 12px; }
.fsum { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px 18px; color: var(--ink); border-top: 5px solid var(--green); transition: transform .12s ease, box-shadow .12s ease; }
.fsum.grey { border-top-color: var(--grey); }
.fsum:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(58, 60, 73, .06), 0 14px 32px rgba(58, 60, 73, .1); }
.fsum .fname { font: 700 15px/1.3 var(--font-head); min-height: 2.6em; margin-bottom: 6px; }
.fsum .fbig { font: 800 34px/1 var(--font-head); color: var(--green-deep); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.fsum .fbig.mid { color: var(--amber); }
.fsum .fbig.low { color: var(--red-deep); }
.fsum .bar { height: 10px; background: var(--grey-tint); border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.fsum .bar > i { display: block; height: 100%; background: var(--green); }
.fsum .bar.mid > i { background: var(--amber); }
.fsum .bar.low > i { background: var(--red); }
.fsum .sub { margin: 0; }
.fsection h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 40px; }
.fsection h2 .muted { font: 400 15px var(--font-body); }

/* Profil */
.profile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: start; margin-bottom: 8px; border-left: 6px solid var(--green); }
.profile .facts { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.profile .facts b { color: var(--ink); font-weight: 600; }
.profile .scorebox { text-align: right; }
.profile .scorebox .lbl { font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--muted); margin: 10px 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Abstimmungen */
.business { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 26px; margin: 0 0 18px; }
.business > header { margin-bottom: 6px; }
.business > header h3 { font-size: 18px; margin-bottom: 2px; }
.business .meta { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.vote { border-top: 1px solid var(--line); padding: 16px 0 6px; margin-top: 12px; }
.vote-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; margin-bottom: 6px; }
.vote-head .tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vote-date { font: 700 13.5px var(--font-head); color: var(--muted); margin-right: 4px; }
.vote-links { font-size: 13.5px; }
.vote-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.result { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.result .r { display: inline-flex; align-items: center; gap: 6px; }
.result .r::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--grey); }
.result .r.yes::before { background: var(--green); }
.result .r.no::before { background: var(--red); }
.result .r.abst::before { background: var(--amber); }
.meaning { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14px; margin: 0 0 10px; }
.meaning dt { color: var(--muted); }
.meaning dd { margin: 0; }
.parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 20px; margin: 6px 0 10px; }
.prow { display: grid; grid-template-columns: 76px 1fr 96px; gap: 10px; align-items: center; font-size: 13px; }
.prow .cnt { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.stack { display: flex; height: 9px; border-radius: 4px; overflow: hidden; background: var(--grey-tint); }
.stack i { display: block; height: 100%; }
.stack .y { background: var(--green); }
.stack .n { background: var(--red); }
.stack .a { background: var(--amber); }
.reason { font-size: 13px; color: var(--muted); }

/* Entscheid */
.decision { background: var(--bg); border-radius: 10px; padding: 14px 18px; margin-top: 12px; }
.decision.is-relevant { background: var(--green-tint); }
.decision.is-offen { background: var(--amber-tint); }
.decision-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 6px; font-size: 14.5px; }
.decision-head b { font-family: var(--font-head); }
.decision p { margin-bottom: 6px; }
.decision .stamp { font-size: 13px; color: var(--muted); }
.decision-form { display: grid; gap: 14px; margin-top: 8px; }
.decision-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.decision-form legend { font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
.decision-form fieldset label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.decision-form .two { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
.decision-form .two label, .decision-form > label { display: flex; flex-direction: column; gap: 4px; font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.decision-form input[type=text], .decision-form select { font: 15px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.decision-form textarea { font: 15px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.decision-form .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.decision-form .actions .msg { margin: 0; min-height: 0; }
.history { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.history li { padding: 8px 0; border-top: 1px solid var(--line); }

/* Stimmverhalten */
.ballots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.ballots .group { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; }
.ballots .group h3 { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ballots .group h3 span { font-weight: 400; color: var(--muted); font-size: 14px; }
.ballots ul { list-style: none; margin: 0; padding: 0; }
.ballots li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14.5px; }

/* Zugang */
.member-form { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 10px; align-items: end; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 20px; }
.member-form label { display: flex; flex-direction: column; gap: 4px; font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.member-form label input, .member-form label select { font: 15px var(--font-body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.member-form .msg { grid-column: 1 / -1; margin: 0; }

.prose { max-width: 760px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
.prose h2 { margin-top: 24px; font-size: 18px; }
.prose li { margin-bottom: 6px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .top .wrap { gap: 12px; }
  .brand img { height: 36px; }
  .nav { margin-left: 0; width: 100%; }
  .userbox { width: 100%; justify-content: space-between; }
  h1 { font-size: 26px; }
  .hero { padding: 26px 22px; }
  .hero h1 { font-size: 26px; }
  .login { padding: 26px 22px; margin: 16px auto; }
  .login .row { flex-direction: column; }
  .profile { grid-template-columns: 1fr; }
  .profile .scorebox { text-align: left; }
  .decision-form .two { grid-template-columns: 1fr; }
  .member-form { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
}

/* Nachträge 2026-09-03: Tabellen in Karten, aufklappbare Listen, Fakten im Profil */
.business .tablewrap { box-shadow: none; border: 1px solid var(--line); margin-top: 10px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font: 600 14.5px var(--font-head); color: var(--blue); padding: 6px 0; }
details.more summary:hover { text-decoration: underline; }
.profile .eyebrow { margin-bottom: 4px; }
.login .eyebrow { margin-bottom: 6px; }
.filters button { padding: 9px 14px; font-size: 14px; margin-left: auto; }
.vote-head .tags .tag { margin: 0; }
.count { margin-top: 4px; }
.decision-form fieldset label .muted { font-size: 13px; }
