/* Strateški svet – one stylesheet, no build step.
   Tokens first, then layout, then the parts in the order a page uses them.

   Every colour is a token. The values below are the light palette; dark.css,
   linked after this file, gives the same tokens their dark values and holds
   nothing else. So a rule here names a token and never a colour, and a new
   colour is a new token with a value in both files (tests/web/portal/
   test_theme.py holds the two files to that, and the pairs in use to their
   contrast). */

@font-face {
  font-family: "Instrument Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("vendor/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("vendor/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* What the browser draws itself (scrollbars, a select's list, a ticked box). */
  color-scheme: light;

  --paper: #f2f4f7;
  --surface: #ffffff;
  --ink: #122633;
  --muted: #586472;
  --line: #dce1e8;
  --line-strong: #bfc7d2;

  /* The navy of the council's logo; its red stays the logo's alone. */
  --accent: #002a76;
  --accent-ink: #001c52;
  --accent-soft: #e5eaf4;
  /* Violet: what is the signed-in member's own (the cards of their groups). */
  --own: #7b2fbe;

  /* The two sides of a vote. Used for nothing else. Of each colour: the
     colour itself, the text that stands on its soft ground, the soft ground. */
  --for: #15784f;
  --for-ink: #0e5a3a;
  --for-soft: #e0f2e9;
  --against: #b4372f;
  --against-ink: #8a2a23;
  --against-deep: #6f211b;
  --against-soft: #fbe8e5;

  --amber: #855600;
  --amber-ink: #5e3d00;
  --amber-soft: #fcefcf;
  --amber-line: #ecd9a4;
  --grey-soft: #eceff3;

  /* Text on a ground filled with the accent, a vote's colour or the ink. */
  --on-fill: #ffffff;
  /* The well a row of choices sits in, and the head of a table. */
  --well: #e3e7ed;
  --table-head: #f8f9fb;
  /* Under what is raised a step, and under what floats above the page. */
  --shadow-raised: 0 1px 2px rgb(23 33 43 / 0.14);
  --shadow-floating: 0 6px 18px rgb(18 38 51 / 0.12);
  /* Pictures drawn dark on light: the arrow of a select (in --muted), the
     logo, the editor's icons. On a dark ground the last two are turned. */
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23586472' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --logo-filter: none;
  --logo-blend: normal;
  --icon-filter: none;

  --radius-l: 14px;
  --radius-m: 9px;
  --radius-s: 6px;

  --font: "Instrument Sans Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

/* Two quick taps on a vote button are two votes, not a zoom. */
a,
button,
label,
select,
input,
textarea {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-feature-settings: "ss01";
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
fieldset {
  margin: 0;
  padding: 0;
}

fieldset {
  border: 0;
  min-width: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.num {
  font-variant-numeric: tabular-nums;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--on-fill);
  border-radius: var(--radius-s);
}
.skip:focus {
  top: 0.5rem;
  color: var(--on-fill);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top__in,
.nav__in,
.page,
.dev__in {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover {
  color: var(--ink);
}

.brand__logo {
  flex: none;
  width: auto;
  height: 2.5rem;
}
/* Navy lines on a white square. On a dark ground the picture is turned, and
   the square, black by then, is blended away into the ground. */
.brand__logo,
.gate__logo {
  filter: var(--logo-filter);
  mix-blend-mode: var(--logo-blend);
}

.brand__text {
  display: grid;
  line-height: 1.2;
  min-width: 0;
}
.brand__group {
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand__council {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
.who__name {
  color: var(--muted);
}
/* The member's own menu: their picture and name, and under them the profile,
   the sign-out and, for the skrbnik, the skrbništvo. A <details>, so the name
   opens it without the script. */
.who__menu {
  position: relative;
}
.who__me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  margin-block: -0.2rem;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.who__me::-webkit-details-marker {
  display: none;
}
/* A small arrow after the name, turned over while the menu is open. */
.who__me::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  margin: -0.2rem 0.15rem 0 0.1rem;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  rotate: 45deg;
}
.who__menu[open] > .who__me::after {
  margin-top: 0.2rem;
  rotate: 225deg;
}
.who__me:hover,
.who__menu[open] > .who__me {
  background: var(--grey-soft);
}
.who__me:hover .who__name,
.who__menu[open] .who__name {
  color: var(--ink);
}
.menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.5rem);
  right: 0;
  display: grid;
  min-width: 12rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-floating);
  white-space: nowrap;
}
.menu__item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu__item:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* Light or dark: one round button at the end of the row. It shows the look in
   use (a sun, a moon, or half of each while the device decides) and a press
   moves to the next. The row is spaced by the picture, not by the empty round
   of the button about it: the round reaches into the gap on its left and past
   the end of the row on its right. */
.look {
  display: flex;
  margin-inline: -0.5rem;
}
.look__btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
/* Over `display: grid`: only the button of the look in use is shown. */
.look__btn[hidden] {
  display: none;
}
.look__btn:hover {
  background: var(--grey-soft);
  color: var(--ink);
}

/* Labels that do not fit the row wrap onto a second one: with the scrollbar
   hidden, one pushed past the edge would be out of reach. */
.nav__in {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav a {
  flex: none;
  padding: 0.55rem 0 0.65rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
  border-bottom: 2px solid transparent;
}
.nav a:hover {
  color: var(--ink);
}
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
/* A working group's own pages, under the council's. */
.nav--group {
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.95rem;
}

/* ── Page ───────────────────────────────────────────────────────────────── */

.page {
  flex: 1 0 auto;
  padding-block: 1.75rem 4rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.page--narrow {
  width: min(100% - 2rem, 32rem);
  padding-block: 12vh 4rem;
}
.page--form {
  width: min(100% - 2rem, 48rem);
}

.lead__title {
  font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.15rem);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lead__text {
  margin-top: 0.5rem;
  max-width: var(--measure);
  color: var(--muted);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}
.lead .row__meta {
  margin-top: 0.7rem;
}
.lead--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.lead--split > :first-child {
  flex: 1 1 26rem;
  min-width: 0;
}
.lead__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.back {
  font-size: 0.9rem;
  margin-bottom: -0.6rem;
}
.back a::before {
  content: "‹ ";
}
/* The back link with, beside it, the steps to the measures before and after. */
.trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: -0.6rem;
}
.trail .back {
  margin-bottom: 0;
}

.cols {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.25rem 1.4rem;
}
.panel--flush {
  padding: 0;
  overflow: hidden;
}
.panel__title,
.section__title {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin-bottom: 0.8rem;
}
.section__sub {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 1.2rem 0 0.4rem;
}
.panel__foot {
  margin-top: 1rem;
}
.panel__notice {
  margin-top: 1rem;
}
.panel__foot--links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 1.5rem;
}

/* A part of the council's page, under a heading of its own: twice as far from
   the part before it as what it holds is from one another. */
.part {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(0, 1fr);
}
.part + .part {
  margin-top: 1.25rem;
}
.part__title {
  font-size: 1.3rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.part__text {
  margin-top: 0.25rem;
  max-width: var(--measure);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
  max-width: var(--measure);
}
.empty p + p {
  margin-top: 0.5rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.panel > .hint,
.vote > .hint {
  margin-top: 0.7rem;
}

.count {
  margin-left: 0.3rem;
  padding: 0.05rem 0.5rem;
  border-radius: 99px;
  background: var(--grey-soft);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Notices ────────────────────────────────────────────────────────────── */

.notices {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}
.notice {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-m);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 500;
}
.notice a {
  color: inherit;
}
.notice--success {
  background: var(--for-soft);
  color: var(--for-ink);
}
.notice--warning {
  background: var(--amber-soft);
  color: var(--amber-ink);
}
.notice--error {
  background: var(--against-soft);
  color: var(--against-ink);
}
.error {
  margin-top: 0.35rem;
  color: var(--against);
  font-size: 0.9rem;
  font-weight: 550;
}

/* ── Controls ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.4rem;
  padding: 0.3rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-fill);
}
.btn--primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--on-fill);
}
.btn--small {
  min-height: 1.9rem;
  padding: 0.15rem 0.7rem;
  font-size: 0.9rem;
}
.btn--wide {
  width: 100%;
  min-height: 2.9rem;
}

/* Previous, position, next: through the list a measure was opened from, and
   through the pages of the activity. */
.stepper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
/* On a row of its own: a step at each edge, the position midway. */
.stepper--wide {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
.stepper--wide .stepper__prev {
  justify-self: start;
}
.stepper--wide .stepper__next {
  justify-self: end;
}
.stepper__pos {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}
.stepper__prev::before {
  content: "‹";
}
.stepper__next::after {
  content: "›";
}
/* The end of the list: the label stays in its place, switched off. */
.stepper__off,
.stepper__off:hover {
  border-color: var(--line);
  background: none;
  color: var(--muted);
  cursor: default;
}

.linklike {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.input,
.form input[type="text"],
.form select,
.form textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea.input,
.form textarea {
  resize: vertical;
  line-height: 1.5;
}
/* Our own arrow: the browser's sits flush against the border and differs on
   every system. */
select.input,
.form select,
.dev select {
  appearance: none;
  padding-right: 2.3rem;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.95rem;
  text-overflow: ellipsis;
  cursor: pointer;
}
input[type="search"].input {
  appearance: none;
}
.input:focus-visible,
.form input[type="text"]:focus-visible,
.form select:focus-visible,
.form textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}
/* Shown, not asked for: what somebody else enters for the member. */
.form input[type="text"]:disabled {
  background: var(--well);
  border-color: var(--line);
  color: var(--muted);
  opacity: 1;
}
.form input[type="text"]:disabled + input[type="text"]:disabled {
  margin-top: 0.4rem;
}
.form input[type="file"] {
  display: block;
  max-width: 100%;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
}
/* The picture on the profile, beside the field that replaces it. */
.portrait {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.portrait__fields {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 0.7rem;
}
.actions--end {
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  margin: 0;
  flex: none;
}

/* ── Chips ──────────────────────────────────────────────────────────────── */

.tag,
.status,
.state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.08rem 0.55rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--quiet {
  background: var(--grey-soft);
  color: var(--muted);
  font-weight: 500;
}
.tag--new {
  background: var(--accent);
  color: var(--on-fill);
  vertical-align: 0.15em;
}

.status {
  background: var(--grey-soft);
  color: var(--muted);
}
.status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}
.status--izveden {
  background: var(--for-soft);
  color: var(--for-ink);
}
.status--delno {
  background: var(--amber-soft);
  color: var(--amber);
}
.status--delno::before {
  background: linear-gradient(to right, currentColor 50%, transparent 50%);
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.status--v-izvajanju {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.status--v-izvajanju::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.status--ni-izveden {
  background: var(--against-soft);
  color: var(--against-ink);
}
.status--ni-podatka::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.state {
  background: var(--grey-soft);
  color: var(--muted);
}
.state--izbran {
  background: var(--accent);
  color: var(--on-fill);
}
.state--paket-2 {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.state--opuscen {
  text-decoration: line-through;
}

/* A working group that has a measure in its area; leads to the measure's page there. */
.tag--group {
  border: 1px solid var(--line-strong);
  color: var(--accent-ink);
  text-decoration: none;
}
.tag--group:hover {
  border-color: var(--accent);
  text-decoration: underline;
}

/* ── The member's groups (home) ─────────────────────────────────────────── */

.cards {
  list-style: none;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
/* The whole card is the link: the title's link is stretched over it. */
.card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.3rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
}
.card:hover,
.card:focus-within {
  border-color: var(--accent);
}
/* A group the member is in. The border is twice a plain card's, taken out of
   the padding so that the card keeps its size, and it stays violet under the
   pointer, where the shadow says the card can be opened. */
.card--own {
  padding: calc(1.1rem - 1px) calc(1.25rem - 1px);
  border-width: 2px;
  border-color: var(--own);
}
.card--own:hover,
.card--own:focus-within {
  border-color: var(--own);
  box-shadow: var(--shadow-floating);
}
.card__title {
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.3;
}
.card__title a {
  color: var(--ink);
  text-decoration: none;
}
.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-l);
}
.card__role {
  font-size: 0.9rem;
  color: var(--muted);
}
.card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}
.card__facts div {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.card__facts dt {
  color: var(--muted);
}
.card__facts dd {
  font-weight: 650;
}
/* A group the member is not in: the same card made small, as many in a row as
   there is room for, its counts at the foot whatever the length of its name. */
.cards--small {
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}
.card--small {
  align-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-m);
}
.card--small .card__title {
  font-size: 0.95rem;
}
.card--small .card__title a::after {
  border-radius: var(--radius-m);
}
.card--small .card__facts {
  gap: 0.1rem 0.9rem;
  margin-top: 0;
  font-size: 0.82rem;
}

/* ── Timeline (home) ────────────────────────────────────────────────────── */

.track {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}
.track__step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.15rem;
  padding: 1.5rem 1rem 0 0;
  color: var(--ink);
}
/* The rail and the stop on it. */
.track__step::before {
  content: "";
  position: absolute;
  inset: 0.4rem 0 auto 0;
  height: 2px;
  background: var(--line-strong);
}
.track__step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-strong);
}
.track__step.is-past {
  color: var(--muted);
}
.track__step.is-past::before {
  background: var(--ink);
}
.track__step.is-past::after {
  background: var(--ink);
  border-color: var(--ink);
}
.track__step.is-next::after {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.track__date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
/* How far the next deadline is. */
.track__due {
  padding: 0.05rem 0.5rem;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.track__step.is-next .track__date {
  color: var(--accent);
}
.track__title {
  font-weight: 600;
  line-height: 1.3;
}
.track__detail {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 46rem) {
  .track {
    grid-template-columns: 1fr;
  }
  .track__step {
    padding: 0 0 1.1rem 1.7rem;
  }
  .track__step::before {
    inset: 0.4rem auto 0 0.4rem;
    width: 2px;
    height: auto;
  }
  .track__step:last-child::before {
    display: none;
  }
  .track__step::after {
    top: 0.3rem;
  }
  .track__step:not(.is-next) .track__detail {
    display: none;
  }
}

/* ── Meters, plain and ranked lists, feed ───────────────────────────────── */

.meter + .meter {
  margin-top: 1rem;
}
.meter__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.meter__head .num {
  flex: none;
}
.meter__bar {
  height: 0.5rem;
  border-radius: 99px;
  background: var(--grey-soft);
  overflow: hidden;
}
.meter__bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}
.meter .hint {
  margin-top: 0.3rem;
}

.plain,
.ranked,
.feed {
  list-style: none;
}
.plain li,
.ranked li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}
.plain li:first-child,
.ranked li:first-child {
  border-top: 0;
  padding-top: 0;
}
.plain li:last-child,
.ranked li:last-child {
  padding-bottom: 0;
}
.plain li > * + * {
  margin-left: 0.35rem;
}
.ranked li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.ranked__meta {
  flex: none;
  font-size: 0.85rem;
  color: var(--muted);
}
.score {
  flex: none;
  font-weight: 650;
}

.feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.2rem 0.7rem;
  align-items: start;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}
/* An entry without a picture: a draft. */
.feed__item--bare {
  grid-template-columns: minmax(0, 1fr) auto;
}
.feed__item:first-child {
  border-top: 0;
  padding-top: 0;
}
.feed__text {
  overflow-wrap: anywhere;
}
.feed__time {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
/* How a comment begins, where the feed lists comments: two lines of it. */
.feed__quote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin-top: 0.15rem;
  max-width: var(--measure);
  color: var(--muted);
}
@media (max-width: 34rem) {
  .feed__item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .feed__time {
    grid-column: 2;
  }
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* A member's picture in the place of their initials: the stored square, cut
   round like them. */
img.avatar {
  object-fit: cover;
}
.avatar--card {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.15rem;
}
.avatar--large {
  width: 6rem;
  height: 6rem;
  font-size: 1.9rem;
}

/* ── Filters ────────────────────────────────────────────────────────────── */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem 1rem;
}
.filters__field {
  display: grid;
  gap: 0.2rem;
  flex: 0 1 11rem;
  min-width: 9rem;
}
.filters__field--grow {
  flex: 1 1 14rem;
}
.filters label,
.thread__form > label,
.stateform > label {
  font-size: 0.85rem;
  font-weight: 600;
}
.filters .input {
  height: 2.5rem;
}
.filters .check {
  font-weight: 400;
  font-size: 0.95rem;
  min-height: 2.4rem;
}

.filters__toggle {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .filters__toggle svg {
    transition: rotate 0.15s;
  }
}
.filters__toggle[aria-expanded="true"] svg {
  rotate: 180deg;
}
.filters__more {
  display: contents;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: calc(var(--radius-m) + 3px);
  background: var(--well);
  flex: none;
}
.segmented label {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 550;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: calc(2.4rem - 6px);
  padding: 0 0.9rem;
  border-radius: var(--radius-m);
  color: var(--muted);
}
/* The count stays a step behind its label by colour, not by opacity: 4.9:1 on
   the track, 6:1 on the chosen side. */
.segmented .num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.segmented input:checked + span {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
}
.segmented input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.result-count {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* ── The ledger: one surface, a row per measure or proposal ─────────────── */

.ledger {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
}
.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--line);
}
.row:first-child {
  border-top: 0;
}
/* The shared list of old measures: nobody votes there, so a row has no stub. */
.row--plain {
  grid-template-columns: minmax(0, 1fr);
}
.row__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  margin-top: 0.45rem;
}
/* A dropped proposal recedes into the page: its row takes the page's grey and
   its title the colour of the meta line. Not opacity, which put the meta text
   at 2.6:1; every text here stays above 5:1. */
.row--dim {
  background: var(--paper);
}
.row--dim:first-child {
  border-start-start-radius: calc(var(--radius-l) - 1px);
  border-start-end-radius: calc(var(--radius-l) - 1px);
}
.row--dim:last-child {
  border-end-start-radius: calc(var(--radius-l) - 1px);
  border-end-end-radius: calc(var(--radius-l) - 1px);
}
.row--dim .row__title a:not(:hover) {
  color: var(--muted);
}
.row__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.row__title a {
  color: var(--ink);
  text-decoration: none;
}
.row__title a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.row__summary {
  margin-top: 0.2rem;
  color: var(--muted);
  max-width: var(--measure);
  overflow-wrap: anywhere;
}
.row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.9rem;
  margin-top: 0.4rem;
  font-size: 0.87rem;
  color: var(--muted);
}

/* The vote stub of a row: for above, against below. */
.stub {
  display: grid;
  gap: 4px;
  width: 3.4rem;
}
.stub__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 1.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
}
.stub__btn svg,
.ballot svg {
  fill: currentColor;
  flex: none;
}
/* Only a pointer hovers: on a touch screen a hover colour sticks after the
   tap and would read as a vote that was not cast. */
@media (hover: hover) {
  .stub__btn--for:hover:not(:disabled):not([aria-pressed="true"]) {
    border-color: var(--for);
    color: var(--for);
    background: var(--for-soft);
  }
  .stub__btn--against:hover:not(:disabled):not([aria-pressed="true"]) {
    border-color: var(--against);
    color: var(--against);
    background: var(--against-soft);
  }
}
.stub__btn--for[aria-pressed="true"] {
  background: var(--for);
  border-color: var(--for);
  color: var(--on-fill);
}
.stub__btn--against[aria-pressed="true"] {
  background: var(--against);
  border-color: var(--against);
  color: var(--on-fill);
}
.stub__btn:disabled {
  cursor: not-allowed;
}
.stub__btn:disabled:not([aria-pressed="true"]) {
  background: var(--paper);
  border-color: var(--line);
}
.stub.is-refused {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* ── Detail pages ───────────────────────────────────────────────────────── */

.detail {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.detail__main,
.detail__side {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}
/* One column: the tally leads, the content follows, and what only an admin
   uses (the state of a proposal) comes last. */
.detail__side {
  display: contents;
}
.detail__side > .vote {
  order: -1;
}
.detail__side > :not(.vote) {
  order: 1;
}
@media (min-width: 58rem) {
  .detail {
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
  .detail__side {
    display: grid;
    position: sticky;
    top: 1rem;
  }
  .detail__side > .vote,
  .detail__side > :not(.vote) {
    order: 0;
  }
}

/* A pasted address has no place to break; let it break anywhere rather than
   push the page wider than the screen. */
.prose {
  max-width: var(--measure);
  overflow-wrap: anywhere;
}
.prose p + p,
.prose div + div,
.prose p + ul,
.prose p + ol {
  margin-top: 0.8em;
}
.prose a {
  overflow-wrap: anywhere;
}
.richtext ul,
.richtext ol {
  margin: 0.5em 0;
  padding-left: 1.4em;
}
.richtext li + li {
  margin-top: 0.25em;
}

.callout {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--against);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  background: var(--against-soft);
  color: var(--against-deep);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem 1.5rem;
}
.facts__wide {
  grid-column: 1 / -1;
}
.facts dt {
  font-size: 0.85rem;
  color: var(--muted);
}
.facts dd {
  font-weight: 550;
  max-width: var(--measure);
  overflow-wrap: anywhere;
}

/* The vote panel: the tally is the loudest thing on a detail page. */
.vote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.25rem 1.4rem;
}
.tally {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
.tally__score {
  font-size: 2.6rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
}
.tally__words {
  color: var(--muted);
}
.tally__bar {
  display: flex;
  gap: 3px;
  height: 0.6rem;
  margin-top: 0.8rem;
}
.tally__bar span {
  border-radius: 99px;
  min-width: 0.6rem;
}
.tally__for {
  background: var(--for);
}
.tally__against {
  background: var(--against);
}
.tally__bar--empty {
  border-radius: 99px;
  background: var(--grey-soft);
}

.vote__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}
.ballot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
@media (hover: hover) {
  .ballot--for:hover:not([aria-pressed="true"]) {
    border-color: var(--for);
    color: var(--for);
    background: var(--for-soft);
  }
  .ballot--against:hover:not([aria-pressed="true"]) {
    border-color: var(--against);
    color: var(--against);
    background: var(--against-soft);
  }
}
.ballot--for[aria-pressed="true"] {
  background: var(--for);
  border-color: var(--for);
  color: var(--on-fill);
}
.ballot--against[aria-pressed="true"] {
  background: var(--against);
  border-color: var(--against);
  color: var(--on-fill);
}
.vote__closed {
  margin-top: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-m);
  background: var(--amber-soft);
  color: var(--amber-ink);
  font-weight: 550;
}

.voters {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem 0.8rem;
  font-size: 0.9rem;
}
.voters dt {
  font-weight: 650;
}
.voters dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.voter {
  padding: 0.05rem 0.5rem;
  border-radius: var(--radius-s);
}
.voter--for {
  background: var(--for-soft);
  color: var(--for-ink);
}
.voter--against {
  background: var(--against-soft);
  color: var(--against-ink);
}

.stateform {
  display: grid;
  gap: 0.5rem;
}

/* ── Discussion ─────────────────────────────────────────────────────────── */

.thread__list {
  list-style: none;
}
.comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}
.comment:first-child {
  border-top: 0;
  padding-top: 0;
}
.comment--deleted {
  display: block;
  font-size: 0.9rem;
}
.comment__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
}
.comment__head time,
.comment__head .quiet {
  font-size: 0.85rem;
  color: var(--muted);
}
.comment__body {
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}
.comment__actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.3rem;
  font-size: 0.85rem;
}
.comment form textarea {
  margin-top: 0.4rem;
}
.thread__form {
  display: grid;
  gap: 0.3rem;
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.thread > .empty + .thread__form {
  border-top: 0;
  padding-top: 0;
}

/* ── Proposal form ──────────────────────────────────────────────────────── */

.form {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: minmax(0, 1fr);
  padding: 1.6rem;
}
.form__pair {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.field {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.field__label {
  font-weight: 650;
}
.field__help {
  font-size: 0.87rem;
  color: var(--muted);
  margin-top: -0.2rem;
}
.field__sub {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.6rem;
}
.field__sub[hidden] {
  display: none;
}
.field--error input[type="text"],
.field--error select,
.field--error textarea,
.field--error trix-editor {
  border-color: var(--against);
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  cursor: pointer;
}
/* A few choices of which one holds, each with what it brings about under its
   name (the switch on »Nastavitve aplikacije«). */
.options {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0;
  border: 0;
}
.options > legend {
  margin-bottom: 0.5rem;
  padding: 0;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  cursor: pointer;
}
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option input {
  margin-top: 0.2rem;
}
.option__text {
  display: grid;
  gap: 0.15rem;
}
.option__label {
  font-weight: 600;
}
.option__effect {
  font-size: 0.85rem;
  color: var(--muted);
}
/* Who turned a switch and when, the latest first. */
/* The member's connected agents (the profile): the address to give an agent,
   then one row for each connection with its button. */
.address {
  margin-top: 0.7rem;
  overflow-wrap: anywhere;
}
.address code {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--paper);
  font-size: 0.9rem;
  user-select: all;
}
.connections {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.connection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.connection__text {
  display: grid;
  gap: 0.1rem;
}
.connection__name {
  font-weight: 600;
}
/* What a member should know before agreeing to something: small print, as a list. */
.notes {
  margin: 0.7rem 0 0;
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 0.85rem;
}
.notes li + li {
  margin-top: 0.2em;
}
.turns {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  list-style: none;
}
.turns li {
  display: grid;
  gap: 0.1rem;
}
/* A long list to tick from (the measures an old measure is linked to). */
.picklist {
  display: grid;
  gap: 0.45rem;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.picklist .check {
  align-items: flex-start;
}
.picklist .check input {
  margin-top: 0.2rem;
}
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 550;
}

/* The editor, on top of vendor/trix.css. Only what members may use is shown. */
.form trix-toolbar .trix-button-row {
  flex-wrap: wrap;
  gap: 0.4rem;
}
.form trix-toolbar .trix-button-group {
  margin-bottom: 0.4rem;
  border-color: var(--line-strong);
  border-radius: var(--radius-s);
}
.form trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 0;
}
.form trix-toolbar .trix-button {
  border-bottom: 0;
}
.form trix-toolbar .trix-button:not(:first-child) {
  border-left-color: var(--line-strong);
}
/* The icons are dark pictures. */
.form trix-toolbar .trix-button--icon::before {
  filter: var(--icon-filter);
}
.form trix-toolbar .trix-button--icon-strike,
.form trix-toolbar .trix-button--icon-heading-1,
.form trix-toolbar .trix-button--icon-quote,
.form trix-toolbar .trix-button--icon-code,
.form trix-toolbar .trix-button-group--file-tools,
.form trix-toolbar .trix-button-group-spacer {
  display: none;
}
/* The first button left in a group after the hidden ones needs no divider. */
.form trix-toolbar .trix-button--icon-bullet-list {
  border-left: 0;
}
.form trix-toolbar .trix-button.trix-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
/* The link dialog, in the app's own type and shapes. */
.form trix-toolbar .trix-dialog {
  padding: 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow-floating);
  font-size: 0.95rem;
}
.form trix-toolbar .trix-dialog__link-fields {
  align-items: stretch;
  gap: 0.5rem;
}
.form trix-toolbar .trix-dialog .trix-input {
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-color: var(--line-strong);
  border-radius: var(--radius-s);
  background-color: var(--surface);
  font: inherit;
  color: var(--ink);
}
.form trix-toolbar .trix-dialog .trix-button-group {
  margin: 0;
}
.form trix-toolbar .trix-dialog .trix-button--dialog {
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink);
  cursor: pointer;
}
.form trix-editor.editor {
  min-height: 11rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  line-height: 1.55;
}
.form trix-editor.editor:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

/* ── Revisions ──────────────────────────────────────────────────────────── */

.revisions {
  list-style: none;
  padding: 0.5rem;
}
.revisions li {
  display: grid;
  gap: 0.1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-m);
}
.revisions li[aria-current="true"] {
  background: var(--accent-soft);
}
.revisions a {
  font-weight: 600;
}
.revisions__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Members table ──────────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table th,
.table td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: middle;
  border-top: 1px solid var(--line);
}
.table thead th {
  border-top: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
  vertical-align: bottom;
  background: var(--table-head);
}
.table tbody th {
  font-weight: 550;
}
.table .t-num {
  text-align: right;
  white-space: nowrap;
}
.table thead .t-num {
  white-space: normal;
}
/* A panel whose content may reach past its edge (a member's card below the
   last row). The table's own corners are rounded in its place. */
.panel--spill {
  overflow: visible;
}
.panel--spill .table thead th:first-child {
  border-top-left-radius: var(--radius-l);
}
.panel--spill .table thead th:last-child {
  border-top-right-radius: var(--radius-l);
}

/* A member in a list: the picture, the name, and a card of what they wrote
   about themselves. The card opens under the name while the name is pointed
   at or has focus (a tap gives it focus), and stays open while the pointer or
   the focus is inside the card, so that its links can be followed. Escape
   puts it away (app.js marks the member data-put-away). */
.person {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  border-radius: var(--radius-s);
  cursor: default;
}
.person__card {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.45rem);
  left: 0;
  display: none;
  gap: 0.7rem;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2.5rem));
  padding: 0.95rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-floating);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
}
/* The gap between the name and the card is the card's too: the pointer
   crosses it without the card closing. */
.person__card::before {
  content: "";
  position: absolute;
  inset: -0.5rem 0 auto;
  height: 0.5rem;
}
.person:hover > .person__card,
.person:focus-within > .person__card {
  display: grid;
}
/* Pointed at, the card waits a moment, so a pointer on its way down the list
   opens none; focus opens it at once. */
.person:hover:not(:focus-within) > .person__card {
  animation: person-card-wait 0.3s step-end;
}
@keyframes person-card-wait {
  from {
    visibility: hidden;
  }
}
.person[data-put-away] > .person__card {
  display: none;
}
/* The last rows of a long list open their card upwards, so that it does not
   hang under the table. */
.table tbody tr:nth-last-child(-n + 2):nth-child(n + 5) .person__card {
  top: auto;
  bottom: calc(100% + 0.45rem);
}
.table tbody tr:nth-last-child(-n + 2):nth-child(n + 5) .person__card::before {
  inset: auto 0 -0.5rem;
}
.person__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.person__title {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
}
.person__role,
.person__empty {
  color: var(--muted);
}
.person__bio {
  overflow-wrap: anywhere;
}
.person__contact {
  list-style: none;
  display: grid;
  gap: 0.25rem;
}

@media (max-width: 52rem) {
  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
  }
  .table tr {
    padding: 0.9rem 1.1rem;
    border-top: 1px solid var(--line);
  }
  .table tr:first-child {
    border-top: 0;
  }
  .table th,
  .table td {
    padding: 0;
    border: 0;
  }
  .table tbody th {
    position: relative;
    margin-bottom: 0.5rem;
  }
  /* A member's card is as wide as the row, whatever the length of the name. */
  .person {
    position: static;
  }
  .person__card {
    right: 0;
    width: auto;
    max-width: none;
  }
  .table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0;
    text-align: right;
  }
  .table td::before {
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
  }
}

/* ── Sign-in ────────────────────────────────────────────────────────────── */

.gate {
  display: grid;
  gap: 1rem;
  padding: 2rem;
}
.gate__logo {
  width: auto;
  height: 4.5rem;
}
.gate__title {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.address {
  overflow-wrap: anywhere;
}

/* ── Development strip ──────────────────────────────────────────────────── */

.dev {
  background: var(--amber-soft);
  border-top: 1px solid var(--amber-line);
  color: var(--amber-ink);
  font-size: 0.9rem;
}
.dev__in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  padding-block: 0.7rem;
}
.dev select {
  font: inherit;
  padding: 0.2rem 2rem 0.2rem 0.5rem;
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-s);
  background-color: var(--surface);
  background-position: right 0.55rem center;
  max-width: 100%;
}

/* ── Phones ─────────────────────────────────────────────────────────────── */

@media (max-width: 40rem) {
  .who__name {
    display: none;
  }
  .who {
    gap: 0.6rem;
  }
  .brand__council {
    display: none;
  }
  .brand__logo {
    height: 2.25rem;
  }
  .top__in {
    gap: 0.75rem;
    padding-block: 0.7rem 0.3rem;
  }

  /* All five sections stay in view: the row spreads edge to edge and its type
     follows the screen, instead of scrolling the last tab out of sight. */
  .nav__in {
    gap: 0 0.25rem;
    justify-content: space-between;
  }
  .nav a {
    font-size: clamp(0.8rem, 3.9vw, 1rem);
  }

  .page {
    padding-block: 1.25rem 3rem;
    gap: 1rem;
  }
  .page--narrow {
    padding-block: 1.5rem 3rem;
  }
  .lead__text {
    font-size: 1rem;
  }
  .lead__actions,
  .lead__actions form,
  .lead--split > form {
    width: 100%;
  }
  .lead__actions .btn,
  .lead--split > form .btn {
    flex: 1 1 auto;
  }
  .lead--split > form .btn {
    width: 100%;
  }
  .panel,
  .vote,
  .gate {
    padding: 1.1rem;
  }
  .row {
    gap: 0.8rem;
    padding: 0.85rem 0.9rem;
  }

  /* The steps take a row of their own under the back link. There and at the
     foot of the page the two buttons share the width, each easy to hit. */
  .trail .stepper,
  .stepper--wide {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    flex: 1 1 100%;
  }
  .trail .stepper {
    margin-bottom: 0.4rem;
  }
  .stepper .btn {
    justify-self: stretch;
    padding-inline: 0.4rem;
  }

  /* Filters: scope and search stay; the rest folds behind one button. */
  .filters {
    gap: 0.7rem;
  }
  .segmented {
    display: flex;
    width: 100%;
  }
  .segmented label {
    flex: 1 1 0;
    min-width: 0;
  }
  .segmented label > span {
    justify-content: center;
    width: 100%;
    padding-inline: 0.4rem;
  }
  .filters__field {
    min-width: 0;
    flex-basis: 8rem;
  }
  .filters__field--grow {
    flex: 1 1 9rem;
  }
  .filters__toggle:not([hidden]) {
    display: inline-flex;
    flex: none;
  }
  .filters__more {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.7rem;
    width: 100%;
  }
  .filters__more .check {
    grid-column: 1 / -1;
  }
  .filters__toggle:not([hidden])[aria-expanded="false"] + .filters__more {
    display: none;
  }

  /* A second fact about a ranked row goes under its title, not beside it. */
  .ranked li:has(.ranked__meta) {
    display: grid;
    gap: 0.1rem;
  }

  /* The editor: one toolbar row that shares the width; list nesting is left
     to wider screens. */
  .form trix-toolbar .trix-button-row {
    flex-wrap: nowrap;
  }
  .form trix-toolbar .trix-button-group {
    flex: 0 1 auto;
    min-width: 0;
  }
  .form trix-toolbar .trix-button--icon {
    flex: 0 1 auto;
    width: 2.75rem;
    min-width: 0;
    max-width: none;
  }
  .form trix-toolbar .trix-button--icon-decrease-nesting-level,
  .form trix-toolbar .trix-button--icon-increase-nesting-level {
    display: none;
  }
  .form trix-toolbar .trix-dialog__link-fields {
    flex-wrap: wrap;
  }
  .form trix-toolbar .trix-dialog__link-fields .trix-input {
    flex: 1 1 100%;
  }
  .form trix-toolbar .trix-dialog .trix-button-group {
    flex: 1 1 100%;
  }
  .form trix-toolbar .trix-dialog .trix-button--dialog {
    flex: 1 1 0;
  }
  .form .actions--end .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 22.5rem) {
  .brand__group {
    font-size: 0.92rem;
  }
  .who {
    gap: 0.7rem;
    font-size: 0.85rem;
  }
}

/* ── Print ──────────────────────────────────────────────────────────────── */

/* A measure, a proposal or one of the two lists as a document for a meeting:
   the text, the statuses, the tallies and the discussion. Whatever is there to
   be clicked stays on the screen. Browsers leave backgrounds out of a print,
   so nothing below relies on one, and the page flows as plain blocks, which
   break across sheets more dependably than grids do. */
@media print {
  @page {
    margin: 1.5cm;
  }
  :root {
    --paper: #fff;
    --surface: #fff;
    --ink: #000;
    --muted: #444;
    --line: #bbb;
    --line-strong: #888;
  }
  html {
    font-size: 11pt;
  }
  body {
    display: block;
    min-height: 0;
  }

  /* `!important`: a hidden control must stay hidden whatever a later rule
     says about how it is laid out. */
  .skip,
  .nav,
  .who,
  .dev,
  .notices,
  .trail,
  .back,
  .stepper,
  .filters,
  .btn,
  .lead__actions,
  .lead--split > form,
  .vote__buttons,
  .vote > .hint,
  .tally__bar,
  .thread__form,
  .comment__actions,
  .comment form,
  .comment > .avatar,
  .person__card,
  .stateform,
  .tag--new,
  .screen-only {
    display: none !important;
  }
  /* A panel's foot that held only a button has nothing left to show. */
  .panel__foot:has(> .btn) {
    display: none;
  }

  /* The group's name and logo stay as the letterhead. */
  .top {
    border-bottom: 1px solid var(--line-strong);
  }
  .top__in,
  .page,
  .page--narrow,
  .page--form {
    width: auto;
    margin-inline: 0;
  }
  .top__in {
    padding-block: 0 0.5rem;
  }
  .page {
    padding-block: 1rem 0;
  }
  .page,
  .cols,
  .detail,
  .detail__main,
  .detail__side {
    display: block;
  }
  .detail__side {
    position: static;
  }
  .page > * + *,
  .cols > * + *,
  .detail > * + *,
  .detail__main > * + *,
  .detail__side > * + * {
    margin-top: 1rem;
  }

  .panel,
  .vote,
  .ledger {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: none;
  }
  /* The sections of a detail page are told apart by a rule above each. */
  .detail .panel,
  .detail .vote {
    border-top: 1px solid var(--line-strong);
    padding-top: 0.8rem;
  }

  .lead__title {
    font-size: 1.5rem;
  }
  .prose,
  .lead__text,
  .row__summary,
  .facts dd,
  .empty {
    max-width: none;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  .prose a {
    text-decoration: underline;
  }

  /* Chips keep their shape as an outline; the one that is white on a filled
     ground on the screen takes the ink colour. (»novo« is hidden above: it
     is about the reader's own last visit and means nothing on paper.) */
  .tag,
  .status,
  .state,
  .notice {
    border: 1px solid currentColor;
    background: none;
  }
  .state--izbran {
    color: var(--ink);
  }
  .status::before {
    display: none;
  }

  /* A row of a list. Its vote stub prints as the two counts beside their
     arrows, without the buttons' frames or the mark of the reader's own vote. */
  .row {
    gap: 0.8rem;
    padding: 0.5rem 0;
    background: none;
    break-inside: avoid;
  }
  .row .stub {
    width: 3rem;
    gap: 0;
  }
  .row .stub__btn {
    justify-content: flex-start;
    height: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 0.9rem;
  }

  /* The tally of a detail page, and who voted how: names apart by commas now
     that their chips have no ground. */
  .tally__score {
    font-size: 1.6rem;
  }
  .vote__closed {
    margin-top: 0.5rem;
    padding: 0;
    background: none;
  }
  .voters {
    margin-top: 0.6rem;
    padding-top: 0;
    border-top: 0;
    break-inside: avoid;
  }
  .voter {
    padding: 0;
    background: none;
  }
  .voter:not(:last-child)::after {
    content: ",";
  }

  .comment {
    display: block;
    break-inside: avoid;
  }
  .facts > div {
    break-inside: avoid;
  }
  .lead__title,
  .panel__title,
  .section__title,
  .section__sub,
  .row__title,
  .comment__head {
    break-after: avoid;
  }
}

/* ── Touch ──────────────────────────────────────────────────────────────── */

/* A finger needs about 44 px. Sized by the kind of pointer, not by the width
   of the screen, so a tablet gets it too and a narrow desktop window does not. */
@media (pointer: coarse) {
  .btn,
  .input,
  .form input[type="text"],
  .form select,
  .filters .input,
  .dev select {
    min-height: 2.75rem;
  }
  .filters .input {
    height: auto;
  }
  .btn--small {
    min-height: 2.5rem;
    padding-inline: 0.9rem;
  }
  .look {
    margin-inline: -0.75rem;
  }
  .look__btn {
    width: 2.75rem;
    height: 2.75rem;
  }
  .btn--wide,
  .ballot {
    min-height: 3rem;
  }
  .nav a {
    padding-block: 0.75rem 0.8rem;
  }
  .segmented label > span {
    min-height: 2.5rem;
  }
  .stub {
    gap: 6px;
    width: 3.75rem;
  }
  .stub__btn {
    height: 2.75rem;
    font-size: 1rem;
  }
  .check,
  .filters .check,
  .choice {
    min-height: 2.75rem;
  }
  .choice {
    padding-inline: 1rem;
  }
  input[type="checkbox"],
  input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }
  /* Text-sized actions keep their look and get a finger-sized hit area. */
  .linklike,
  .comment__actions a,
  .back a {
    display: inline-block;
    padding: 0.7rem 0.35rem;
    margin: -0.7rem -0.35rem;
  }
  /* The member's menu: the name and each entry are as tall as a finger. */
  .who__me {
    min-height: 2.75rem;
    margin-block: -0.45rem;
  }
  .menu__item {
    padding-block: 0.75rem;
  }
  .comment__actions {
    gap: 1.5rem;
    margin-top: 0.5rem;
  }
  .form trix-toolbar .trix-button--icon,
  .form trix-toolbar .trix-dialog .trix-input,
  .form trix-toolbar .trix-dialog .trix-button--dialog {
    height: 2.75rem;
  }
  /* Under 16 px an iPhone zooms the page when the field takes focus. */
  .dev select,
  .form trix-toolbar .trix-dialog .trix-input {
    font-size: 1rem;
  }
}

.htmx-request.stub,
.htmx-request .ballot {
  opacity: 0.6;
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .stub__btn,
  .ballot,
  .nav a {
    transition:
      background-color 0.12s,
      border-color 0.12s,
      color 0.12s;
  }
}

/* ── Failed requests (appended with the htmx behaviour in app.js) ───────────
   The notice base.html carries hidden and app.js shows when a vote, a comment
   or a filter did not reach the server. Fixed to the bottom edge: the member
   may be far down a long list, where a notice at the top of the page would
   not be seen. */
.request-error {
  position: fixed;
  z-index: 20;
  inset: auto 0 max(1rem, env(safe-area-inset-bottom));
  width: min(100% - 2rem, 34rem);
  margin-inline: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  border: 1px solid currentColor;
  box-shadow: var(--shadow-floating);
}
.request-error[hidden] {
  display: none;
}
.request-error .linklike {
  flex: none;
  color: inherit;
}

/* ── What a revision changed (appended with the word-by-word comparison on the
   page of revisions) ────────────────────────────────────────────────────────
   The comparison stands in the shown revision's panel, above its full text and
   ruled off from it. What went is struck through and what came is underlined;
   the grounds behind them only help the eye find the place, so the marks hold
   where colour does not: on paper, in forced colours, for a reader who cannot
   tell the two grounds apart. Neither ground is the vote's green or red. */
.diff {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
/* Over `.panel > .hint`: the first revision has one line here, no comparison. */
.panel > .diff {
  margin-top: 0;
}
.diff > .section__sub {
  margin-top: 0;
}
.diff__fields {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.9rem;
}
.diff__fields dt {
  font-size: 0.85rem;
  color: var(--muted);
}
.diff__fields dd {
  max-width: var(--measure);
  overflow-wrap: anywhere;
}
/* The text keeps its line breaks, so a paragraph is still a paragraph. */
.diff__text {
  white-space: pre-wrap;
}
/* The padding also keeps a replaced word and its replacement from reading as
   one word: nothing stands between the two in the text. */
.diff__del,
.diff__ins {
  padding: 0.05em 0.2em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.diff__del {
  background: var(--grey-soft);
  color: var(--muted);
  text-decoration: line-through;
}
.diff__ins {
  background: var(--accent-soft);
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

@media print {
  /* No grounds on paper: the strike and the underline say it alone, in ink. */
  .diff__del,
  .diff__ins {
    background: none;
    color: var(--ink);
  }
  .diff__fields dt {
    break-after: avoid;
  }
}
