/* Riigivaade – kujundus */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efeee8;
  --ink: #141b26;
  --ink-2: #3d4757;
  --muted: #6a7383;
  --line: #dedcd4;
  --line-strong: #c7c4b9;
  --brand: #173a63;
  --brand-ink: #ffffff;
  --accent: #1f5fbf;
  --accent-soft: #e3ecf9;
  --focus: #1f5fbf;

  /* menetlusetapid: heledast tumedani */
  --stage-1: #b9cde8;
  --stage-2: #85a8d6;
  --stage-3: #4f7fc0;
  --stage-4: #23569e;
  --stage-5: #173a63;

  /* tulemused */
  --passed: #1d7a5c;
  --passed-soft: #dff1ea;
  --rejected: #b23a48;
  --rejected-soft: #f7e2e4;
  --closed: #6a7383;
  --closed-soft: #e9eaee;

  /* hääled */
  --v-for: #1d8a68;
  --v-against: #c9424f;
  --v-neutral: #d9a23a;
  --v-novote: #b5bcc8;
  --v-absent: #e6e8ed;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 27, 38, 0.06), 0 1px 1px rgba(20, 27, 38, 0.04);
  --shadow-hover: 0 4px 14px rgba(20, 27, 38, 0.10);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f141b;
    --surface: #171e28;
    --surface-2: #1e2733;
    --ink: #eef1f5;
    --ink-2: #c6cdd8;
    --muted: #8d97a7;
    --line: #2a3442;
    --line-strong: #3a4656;
    --brand: #23507f;
    --accent: #7aa7ec;
    --accent-soft: #1d2c43;
    --focus: #7aa7ec;
    --stage-1: #2b3f5b;
    --stage-2: #335582;
    --stage-3: #4672b0;
    --stage-4: #6b97d6;
    --stage-5: #a6c3ec;
    --passed: #52c39b;
    --passed-soft: #15352b;
    --rejected: #ef7d89;
    --rejected-soft: #3d1d23;
    --closed: #9aa3b2;
    --closed-soft: #252d38;
    --v-for: #3fb68d;
    --v-against: #e2606c;
    --v-neutral: #e0b155;
    --v-novote: #5c6676;
    --v-absent: #2c3542;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01';
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding-left: 28px;
    padding-right: 28px;
  }
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
}

/* ---------- Päis ---------- */

.site-header {
  background: var(--brand);
  color: var(--brand-ink);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.brand-mark rect {
  fill: rgba(255, 255, 255, 0.12);
}

.brand-mark path {
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  stroke-linejoin: round;
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -8px;
  padding: 0 8px;
}

.nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav a.active {
  color: var(--brand);
  background: #fff;
}

@media (max-width: 560px) {
  .header-inner {
    padding-top: 10px;
    padding-bottom: 8px;
    gap: 8px;
  }
  .nav {
    width: calc(100% + 16px);
  }
}

/* ---------- Üldised plokid ---------- */

main {
  padding-top: 28px;
  padding-bottom: 64px;
  min-height: 70vh;
}

main:focus {
  outline: none;
}

.loading,
.empty {
  color: var(--muted);
  padding: 48px 0;
  text-align: center;
}

.page-head {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  font-size: 1.125rem;
  color: var(--ink-2);
  max-width: 68ch;
}

.section {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-head a {
  font-size: 0.9rem;
  font-weight: 500;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 20px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.grid-2 {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-main-side {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
}

/* ---------- Statistikaplaadid ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 820px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  padding: 16px 18px;
  display: grid;
  gap: 2px;
  align-content: start;
  text-decoration: none;
  color: inherit;
}

a.stat:hover {
  box-shadow: var(--shadow-hover);
}

.stat-value {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.stat-note {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Teekonna riba ---------- */

.pipeline {
  padding: 20px;
}

.pipeline-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  margin: 14px 0 16px;
}

.pipeline-bar span {
  display: block;
  min-width: 4px;
}

.pipeline-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

@media (min-width: 720px) {
  .pipeline-legend {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.pipeline-legend a {
  display: grid;
  gap: 2px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin: -6px -8px;
}

.pipeline-legend a:hover {
  background: var(--surface-2);
}

.pl-count {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-count i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.pl-label {
  font-weight: 600;
  font-size: 0.92rem;
}

.pl-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.c-algatatud { background: var(--stage-1); }
.c-esimene { background: var(--stage-2); }
.c-teine { background: var(--stage-3); }
.c-kolmas { background: var(--stage-4); }
.c-otsustatud { background: var(--stage-5); }

/* ---------- Märgid ---------- */

.mark {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
  line-height: 1.4;
}

.chip-stage {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.tone-passed { background: var(--passed-soft); color: var(--passed); }
.tone-rejected { background: var(--rejected-soft); color: var(--rejected); }
.tone-closed { background: var(--closed-soft); color: var(--closed); }

/* ---------- Eelnõu kaart ---------- */

.card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
}

.card-status {
  font-size: 0.86rem;
  color: var(--ink-2);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.card-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.card-flag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Tahvel ---------- */

.filters {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-bottom: 18px;
  padding: 14px;
}

@media (max-width: 719px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters > .field:first-child,
  .filters > .toggle {
    grid-column: 1 / -1;
  }
}

@media (min-width: 720px) {
  .filters {
    grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
  }
}

.field {
  display: grid;
  gap: 4px;
}

.field label,
.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

input[type='search'],
select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
  min-width: 0;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 9px 0;
  cursor: pointer;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.result-line {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 720px) {
  .board {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 719px) {
  .board {
    grid-auto-columns: 86%;
  }
}

.column {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
}

.column-head {
  display: grid;
  gap: 2px;
  padding: 2px 4px 12px;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.column-title i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.column-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}

.column-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.column-cards {
  display: grid;
  gap: 10px;
  align-content: start;
}

.more {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px;
  cursor: pointer;
}

.more:hover {
  background: var(--surface);
}

/* ---------- Loendid ---------- */

.list {
  display: grid;
}

.list > * + * {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  gap: 6px;
  padding: 14px 20px;
  color: inherit;
  text-decoration: none;
}

a.row:hover {
  background: var(--surface-2);
}

.row-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.row-title {
  font-weight: 600;
  line-height: 1.35;
}

.row-sub {
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- Päevakord ---------- */

.day {
  display: grid;
  gap: 0;
}

.day + .day {
  margin-top: 18px;
}

.day-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.day-date {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}

.day-title {
  color: var(--muted);
  font-size: 0.88rem;
}

.today-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
}

.agenda-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 4px 12px;
  padding: 12px 20px;
}

.agenda-item + .agenda-item {
  border-top: 1px solid var(--line);
}

.agenda-no {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  padding-top: 1px;
}

.agenda-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.agenda-title {
  font-weight: 500;
  line-height: 1.4;
}

.agenda-title a {
  color: inherit;
  text-decoration-color: var(--line-strong);
}

.agenda-title a:hover {
  color: var(--accent);
}

.agenda-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.decision {
  font-weight: 600;
  color: var(--passed);
}

.week-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.week-tabs a {
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 7px 14px;
  border-radius: 999px;
}

.week-tabs a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* ---------- Hääletusriba ---------- */

.vbar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--v-absent);
  gap: 1px;
}

.vbar.lg {
  height: 16px;
}

.vbar span {
  display: block;
}

.v-for { background: var(--v-for); }
.v-against { background: var(--v-against); }
.v-neutral { background: var(--v-neutral); }
.v-novote { background: var(--v-novote); }
.v-absent { background: var(--v-absent); }

.vcounts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.84rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.vcounts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vcounts i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.vcounts b {
  font-weight: 700;
  color: var(--ink);
}

.vote {
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}

.vote + .vote {
  border-top: 1px solid var(--line);
}

.vote-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  align-items: baseline;
}

.vote-title {
  font-weight: 700;
}

.vote-outcome {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.factions {
  display: grid;
  gap: 8px;
}

.faction {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr;
  gap: 4px 12px;
  align-items: center;
}

.faction-name {
  font-size: 0.86rem;
  font-weight: 600;
}

.faction-name small {
  font-weight: 400;
  color: var(--muted);
}

.faction-detail {
  grid-column: 2;
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .faction {
    grid-template-columns: 1fr;
  }
  .faction-detail {
    grid-column: 1;
  }
}

details.members summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}

details.members summary::-webkit-details-marker {
  display: none;
}

details.members summary::before {
  content: '▸ ';
}

details.members[open] summary::before {
  content: '▾ ';
}

.member-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.member-group h4 {
  margin: 0 0 6px;
  font-size: 0.82rem;
}

.member-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.member-group li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.member-group li span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.member-group li i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- Eelnõu leht ---------- */

.back {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 14px;
  text-decoration: none;
}

.draft-head {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.draft-head h1 {
  max-width: 30ch;
}

.draft-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 22px 20px 18px;
  counter-reset: step;
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  padding: 0 2px;
}

.step::before {
  content: '';
  position: absolute;
  top: 9px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}

.step:first-child::before {
  display: none;
}

.step .dot {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  background: var(--surface);
}

.step.done {
  color: var(--ink-2);
}

.step.done::before,
.step.current::before {
  background: var(--accent);
}

.step.done .dot {
  border-color: var(--accent);
  background: var(--accent);
}

.step.current {
  color: var(--ink);
  font-weight: 700;
}

.step.current .dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.step.stopped .dot {
  border-color: var(--rejected);
  background: var(--rejected);
}

.step.stopped {
  color: var(--rejected);
  font-weight: 700;
}

.step.stopped::before {
  background: var(--rejected);
}

@media (max-width: 560px) {
  .stepper {
    padding: 18px 10px 14px;
  }
  .step {
    font-size: 0.68rem;
  }
}

.summary {
  padding: 20px 22px;
  border-left: 4px solid var(--accent);
}

.summary h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary p {
  font-size: 1.06rem;
  line-height: 1.6;
  max-width: 70ch;
}

.facts {
  display: grid;
  gap: 0;
}

.fact {
  display: grid;
  gap: 2px;
  padding: 12px 20px;
}

.fact + .fact {
  border-top: 1px solid var(--line);
}

.fact dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.fact dd {
  margin: 0;
  font-weight: 500;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 8px 20px 12px;
}

.tl {
  position: relative;
  padding: 10px 0 10px 26px;
}

.tl::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.tl:first-child::before {
  top: 18px;
}

.tl:last-child::before {
  bottom: calc(100% - 18px);
}

.tl::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
}

.tl.tl-plenary::after {
  background: var(--accent);
  border-color: var(--accent);
}

.tl-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tl-text {
  font-weight: 500;
}

.tl-sub {
  font-size: 0.84rem;
  color: var(--muted);
}

.tl-sub ul {
  margin: 2px 0 0;
  padding-left: 18px;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-list li {
  padding: 12px 20px;
  display: grid;
  gap: 4px;
}

.doc-list li + li {
  border-top: 1px solid var(--line);
}

.files {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.85rem;
}

.ext {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 4px;
}

.source-link {
  margin-top: 28px;
  font-size: 0.9rem;
}

/* ---------- Selgitus ---------- */

.howto {
  display: grid;
  gap: 12px;
  counter-reset: how;
  grid-template-columns: 1fr;
}

@media (min-width: 820px) {
  .howto {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.howto li {
  list-style: none;
  counter-increment: how;
  padding: 16px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.howto li::before {
  content: counter(how);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
}

.howto strong {
  font-size: 0.95rem;
}

.howto span {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.howto-wrap {
  padding: 0;
  margin: 0;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.95rem;
}

.notice strong {
  color: var(--accent);
}

/* ---------- Jalus ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 0.86rem;
  color: var(--muted);
}

.footer-inner {
  display: grid;
  gap: 8px;
}

.footer-inner strong {
  color: var(--ink);
}

.footer-inner a {
  color: var(--ink-2);
}

/* ---------- Saadikud ---------- */

@media (min-width: 720px) {
  .filters.filters-3 {
    grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  .filters.filters-3 > .field:first-child {
    grid-column: 1 / -1;
  }
}

.avatar {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  background: var(--surface-2);
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
}

.fcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.fcard {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  align-content: start;
}

.fcard:hover {
  box-shadow: var(--shadow-hover);
}

.fcard-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.fcard-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.fcard-size {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stage-3);
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

.member-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.mc-body {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
  justify-items: start;
}

.mc-name {
  font-weight: 600;
}

.mc-sub {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.mc-body .chip {
  margin-top: 4px;
}

.mc-att {
  display: grid;
  justify-items: end;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.2;
}

.mc-att b {
  font-size: 1rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.profile-head {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.profile-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

@media (max-width: 560px) {
  .profile-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

.dchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.dchip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.mvote {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: 12px 20px;
  align-items: center;
}

.mvote .vbar {
  margin-top: 6px;
}

.mvote-main {
  min-width: 0;
}

.mvote-main .row-title a {
  color: inherit;
  text-decoration-color: var(--line-strong);
}

.mvote-main .row-title a:hover {
  color: var(--accent);
}

.mvote-dec {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.mvote-differs {
  background: color-mix(in srgb, var(--v-neutral) 10%, transparent);
}

.differs {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-2);
}

@media (max-width: 480px) {
  .mvote {
    grid-template-columns: 1fr;
  }
  .mvote-dec {
    justify-items: start;
    text-align: left;
  }
}

.bio {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--ink-2);
  white-space: pre-line;
}

.faction-name a {
  color: inherit;
}

.member-group li a {
  color: inherit;
  text-decoration: none;
}

.member-group li a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Küsi ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ask-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  max-width: 760px;
}

.ask-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  padding: 13px 20px;
}

.ask-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ask-form button {
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  cursor: pointer;
}

.ask-form button:hover {
  filter: brightness(1.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .ask-form button {
    color: #0f141b;
  }
}

.ask-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ask-chip {
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  white-space: normal;
  text-align: left;
}

.ask-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ask-thread {
  display: grid;
  gap: 28px;
}

.ask-empty {
  padding: 8px 2px;
}

.qa {
  display: grid;
  gap: 10px;
}

.q-bubble {
  justify-self: end;
  max-width: min(640px, 90%);
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  font-weight: 500;
}

.answer {
  padding: 20px 22px;
  display: grid;
  gap: 12px;
  max-width: 860px;
}

.answer p {
  max-width: 72ch;
}

.answer-head {
  display: grid;
  gap: 4px;
}

.answer-head h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.25;
}

.answer-head h2 a {
  color: inherit;
  text-decoration: none;
}

.answer-head h2 a:hover {
  text-decoration: underline;
}

.answer .stepper {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 10px 0 4px;
}

.answer-lead {
  font-size: 1.08rem;
}

.answer-votes {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.answer-more {
  font-weight: 600;
}

.answer-source {
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ask-options {
  display: grid;
  gap: 8px;
}

.ask-option {
  display: grid;
  gap: 2px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
}

.ask-option:hover {
  border-color: var(--accent);
}

.ask-also {
  display: grid;
  gap: 6px;
}

.answer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.answer-list li {
  display: grid;
  gap: 2px;
}

.answer-member {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.answer .list .mvote {
  padding-left: 0;
  padding-right: 0;
}

/* ---------- Küsi: tehisaru vastus ---------- */

.ai-answer {
  padding: 18px 22px 14px;
  display: grid;
  gap: 10px;
  max-width: 860px;
  border-left: 4px solid var(--accent);
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.ai-text {
  font-size: 1.05rem;
  line-height: 1.6;
  display: grid;
  gap: 10px;
}

.ai-text p,
.ai-text ul {
  margin: 0;
  max-width: 72ch;
}

.ai-text ul {
  padding-left: 20px;
}

.ai-typing {
  color: var(--muted);
}

.ai-typing::after {
  content: '…';
  animation: ai-dots 1.2s steps(4, end) infinite;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  width: 0;
}

@keyframes ai-dots {
  to {
    width: 1.2em;
  }
}

.ai-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: ai-blink 1s steps(2, start) infinite;
}

@keyframes ai-blink {
  to {
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-typing::after,
  .ai-cursor {
    animation: none;
  }
}

.ai-note {
  font-size: 0.76rem;
  color: var(--muted);
}

.data-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
