.eyebrow { margin: 0 0 .35rem; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #0a1424; }
.segmented button { min-width: 72px; border: 0; border-radius: 7px; background: transparent; padding: .5rem .8rem; color: var(--muted); font-weight: 800; }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: .52rem .85rem; text-decoration: none; font-weight: 750; white-space: nowrap; }
.button:hover { border-color: #526681; background: var(--surface-3); }
.button.primary { border-color: transparent; background: var(--accent); color: #06141b; }
.button.danger { color: #ffc1c1; }
.kpi { min-height: 112px; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.kpi span { display: block; min-height: 2.4em; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.kpi strong { display: block; margin-top: .35rem; font-size: clamp(1.2rem,2vw,1.8rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.kpi small { display: block; margin-top: .15rem; }
.metric-pill, .status-chip { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .65rem; color: var(--muted); font-size: .72rem; font-weight: 800; }
.status-chip.warning { border-color: var(--warning); color: var(--warning); }
.parliament-chart svg { display: block; width: min(100%, 760px); margin: auto; }
.svg-label { fill: var(--muted); font-size: 13px; }
.donut-main { fill: var(--text); font-size: 25px; font-weight: 850; }
.donut-chart svg { display: block; width: min(100%,280px); margin: .5rem auto; }
.legend, .mini-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; }
.legend-item { display: inline-flex; align-items: center; gap: .38rem; color: var(--muted); font-size: .78rem; }
.legend-item strong { color: var(--text); }
.swatch { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.mini-legend { max-height: 112px; overflow: auto; justify-content: flex-start; }
.alerts { display: grid; gap: .5rem; }
.alert { padding: .8rem 1rem; border: 1px solid var(--warning); border-radius: 9px; background: rgba(246,200,95,.08); color: #ffe3a1; }
.alert.error { border-color: var(--danger); color: #ffc1c1; background: rgba(255,123,123,.08); }
.party-name { display: inline-flex; align-items: center; gap: .55rem; font-weight: 750; }
.threshold-ok { color: var(--success); }
.threshold-out { color: var(--muted); }
.delta { font-weight: 800; }
.delta.zero { color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -1.2rem -1.2rem; }
.table-wrap table { min-width: 760px; }
.table-wrap.compact { margin: .5rem 0 0; max-height: 420px; border: 1px solid var(--line); border-radius: 8px; }
.table-wrap.compact th, .table-wrap.compact td { padding: .52rem .7rem; }
.calculation-boundary { background: rgba(87,212,197,.1); }
.party-editor { display: grid; gap: .5rem; }
.party-edit-row { display: grid; grid-template-columns: minmax(210px,1.25fr) 80px minmax(190px,2fr) 46px; gap: .7rem; align-items: center; padding: .55rem; border-bottom: 1px solid rgba(80,100,130,.22); }
.party-edit-row .name-controls { display: grid; grid-template-columns: .65fr 1.35fr; gap: .45rem; }
.party-edit-row.aggregate-row { border: 1px dashed #53657f; border-radius: 8px; background: rgba(113,128,150,.08); }
.aggregate-badge { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-weight: 900; }
.party-edit-row .value-controls { display: grid; grid-template-columns: 1fr 95px; gap: .6rem; align-items: center; }
input[type="range"] { min-height: 30px; padding: 0; accent-color: var(--accent); }
input[type="color"] { width: 46px; padding: 4px; }
.remove-party, .icon-button { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; }
.lot-box { grid-column: 1 / -1; padding: .8rem; border: 1px solid var(--warning); border-radius: 9px; background: rgba(246,200,95,.08); }
.lot-box p { margin: 0 0 .6rem; color: var(--warning); font-weight: 750; }
.lot-box .button { margin-right: .4rem; }
.helper { color: var(--muted); font-size: .82rem; }
.faction-editor { margin-top: 1rem; border-top: 1px solid var(--line); }
#faction-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 150px));
  gap: .6rem;
  margin-bottom: .8rem;
}
#faction-fields label { width: auto; min-width: 0; }
#faction-fields input[type="number"] { width: 100%; min-width: 0; max-width: 100%; }
.bar-chart { display: grid; gap: .58rem; }
.bar-row { display: grid; grid-template-columns: minmax(85px,130px) 1fr 52px; align-items: center; gap: .7rem; font-size: .8rem; }
.bar-track { height: 10px; border-radius: 99px; background: #26344a; overflow: hidden; }
.bar-fill { height: 100%; min-width: 1px; border-radius: inherit; }
.ba-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: .55rem; margin-bottom: .5rem; }
.ba-item { padding: .8rem; border: 1px solid var(--line); border-radius: 9px; }
.ba-item strong, .ba-item span { display: block; }
.ba-item strong { font-size: 1.55rem; }
.ba-item span { color: var(--muted); font-size: .72rem; }
.tie-explanation { grid-column: 1 / -1; padding: .8rem; border-left: 3px solid var(--accent); background: rgba(87,212,197,.07); }
.tie-explanation strong { font-size: .8rem; }
.tie-explanation p { margin: .25rem 0 0; color: var(--muted); font-size: .78rem; }
.check-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .45rem; }
.check-party { display: flex; grid-template-columns: auto 1fr auto; align-items: center; gap: .55rem; padding: .65rem; border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.check-party input { min-height: auto; }
.coalition-result { margin-top: 1rem; padding: 1rem; border-radius: 10px; background: var(--surface-2); }
.coalition-result strong { font-size: 1.6rem; }
.coalition-visual { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.coalition-visual .subhead { margin-bottom: .35rem; }
.coalition-chart svg { display: block; width: 100%; min-height: 190px; }
.coalition-chart-total { fill: var(--text); font-size: 22px; font-weight: 800; }
.coalition-chart-status, .coalition-chart-axis { fill: var(--muted); font-size: 12px; }
.coalition-chart-segment { fill: #fff; font-size: 12px; font-weight: 800; pointer-events: none; }
.coalition-majority-line { stroke: #fff; stroke-width: 2; stroke-dasharray: 5 4; }
.coalition-majority-label { fill: #fff; font-size: 12px; font-weight: 800; }
.coalition-combinations { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; margin-top: .7rem; }
.result-grid span { color: var(--muted); font-size: .75rem; }
.result-grid b { display: block; color: var(--text); font-size: 1rem; }
.subhead { justify-content: space-between; }
.switch-label { display: flex; align-items: center; grid-template-columns: auto 1fr; }
.switch-label input { min-height: auto; }
.combination-list { display: grid; gap: .45rem; max-height: 330px; overflow: auto; }
.combination { display: flex; justify-content: space-between; padding: .62rem .75rem; border-bottom: 1px solid rgba(80,100,130,.25); font-size: .82rem; }
.combination span { color: var(--muted); }
.positive { color: var(--success); }
.negative { color: var(--warning); }
dialog { width: min(92vw,460px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(2,7,14,.72); backdrop-filter: blur(4px); }
dialog form { display: grid; gap: 1rem; }
.dialog-head, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.dialog-head h2 { margin: 0; }
.dialog-actions { justify-content: flex-end; }
[hidden] { display: none !important; }
