/* Design system of «Активність», from the approved design D
   (docs/probes/designs-2026-10-18/design-d.html). Every colour lives in this one :root block;
   the rest of the file only references tokens. Fonts are served from /static/fonts (the CSP
   allows no third-party origins). */
:root {
  /* Dark: headers and the side panel */
  --ink-950: #101c20;
  --ink-900: #142328;
  --ink-850: #182a30;
  --ink-800: #1d3038;
  --ink-700: #22333a;
  --ink-600: #3a4e55;
  --on-dark: #cfd8da;
  --on-dark-muted: #b9c6c9;
  --on-dark-faint: #7f9196; /* group headings in the dark side panel, 4.9:1 on the panel background */
  /* Turquoise */
  --accent: #0097b2;
  --accent-deep: #00778d;
  --accent-soft: #4ec3d6;
  --accent-tint: #e3f3f6;
  --accent-ring: rgba(0, 151, 178, .35);
  --action: #00778d;
  --action-hover: #00657a;
  --on-action: #ffffff;
  /* Sand, the warm contrast */
  --sand: #c7b299;
  --sand-tint: #f3ecdf;
  --sand-chip: #e9dcc5; /* sand plates that sit on the cream page itself: --sand-tint would merge with it */
  --link: #006d82; /* 5.1:1 on the cream page, 6.0:1 on white (--accent-deep gives 4.4:1 on cream) */
  --sand-ink: #8f7a56;
  --on-sand: #101c20;
  /* Light */
  --paper: #f3ecdf; /* cream, the tile of the product icon; cards stay --surface */
  --surface: #ffffff;
  --surface-2: #f6f4f0;
  --line: #e6e2da;
  --line-strong: #c9c3b8;
  --text: #14252b;
  --muted: #4c5a5e;
  --placeholder: #6b777a;
  /* Statuses and co-authors */
  --ok-bg: #e8f0e3;
  --ok-fg: #55743f;
  --wait-bg: #fbf1d8;
  --wait-fg: #7d5a10;
  --wait-dark: #e3c37a;
  --bad-bg: #f8e9e3;
  --bad-fg: #9c5442;
  --with-bg: #e7edf8;
  --with-fg: #3d6293;
  --draft-bg: #ece9e3;
  --att-draft: #a7b0b2;
  /* Derived shades */
  --nav-end: #142328;
  --ghost-line: #3f5960;
  --ghost-hover: #1d3038;
  --dark-scroll-hover: #4a6168;
  --grad-a1: #0097b2;
  --grad-a2: #4ec3d6;
  --hero-glow: #182a30;
  --hero-sheen: rgba(78, 195, 214, .05);
  --poster-glow: #182a30;
  --poster-end: #101c20;
  --poster-line: rgba(207, 216, 218, .35);
  /* Light poster of a document (achievement), design D .poster--doc */
  --poster-light-glow: #f1f9fb;
  --poster-light-1: #e3f3f6;
  --poster-light-2: #cfe9ef;
  --poster-light-shade: rgba(20, 37, 43, .3);
  --sand-ink-strong: #6d5c3d;
  --photo-scrim: rgba(16, 28, 32, .55);
  --shadow-soft: rgba(16, 28, 32, .04);
  --shadow-poster: rgba(16, 28, 32, .35);
  --shadow-line: rgba(16, 28, 32, .08);
  --drop-dash: #3f6f78;
  --file-bad-line: #e2b7a9;
  --file-bad-bg: #fcf5f2;
  --thumb-wait: #e6e2da;
  --thumb-a: #0b5f6e;
  --thumb-b: #00778d;
  --progress-track: #e6e2da;
  --switch-off: #c9c3b8;
  --knob: #ffffff;
  --knob-shadow: rgba(16, 28, 32, .3);
  --glass-dark: rgba(16, 28, 32, .94);
  --glass-nav: rgba(16, 28, 32, .96);
  --row-hover: #f1f9fb;
  --scroll-thumb: #cfc9be;
  --scroll-thumb-hover: #a9a396;
  --scroll-track: transparent;
  --select-arrow: #4c5a5e;
  /* Administration (design D, screen admin) */
  --admin-glow: #182a30;
  --admin-backdrop: radial-gradient(900px 400px at 100% 0%, var(--admin-glow) 0%, transparent 70%), var(--ink-950);
  --tile-end: #101c20;
  --shadow-deep: rgba(5, 10, 12, .9);
  --row-stale: #fbf1d8;
  /* Export: the dimmed page behind the template name dialog */
  --overlay: rgba(16, 28, 32, .55);

  /* Spacing, radii, sizes */
  --sp-0: 2px; --sp-1: 4px; --sp-1-5: 6px; --sp-2: 8px; --sp-2-5: 10px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --r-1: 8px; --r-2: 14px; --r-3: 22px; --r-pill: 999px;
  --nav-w: 248px;
  --form-w: 960px;
  --card-w: 720px;
  --card-narrow-w: 400px;
  --tap: 44px;
  --scroll-size: 10px;
  --arrow-size: 10px;
  --icon-sm: 18px;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --focus: 0 0 0 3px var(--surface), 0 0 0 5px var(--action);
  --focus-dark: 0 0 0 3px var(--ink-950), 0 0 0 5px var(--accent-soft);
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/onest-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/unbounded-latin.woff2") format("woff2");
  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;
}

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

/* The page's own bar and every inner scroll area: thin, muted, from the tokens. */
html {
  /* A long page and a short one keep the same width when the system shows classic bars. */
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html::-webkit-scrollbar, ::-webkit-scrollbar { width: var(--scroll-size); height: var(--scroll-size); }
html::-webkit-scrollbar-track, ::-webkit-scrollbar-track { background: var(--scroll-track); }
html::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: var(--scroll-size);
  border: 2px solid transparent;
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
html::-webkit-scrollbar-corner, ::-webkit-scrollbar-corner { background: var(--scroll-track); }
.dark-scroll { scrollbar-width: thin; scrollbar-color: var(--ink-600) transparent; }
.dark-scroll::-webkit-scrollbar-thumb { background: var(--ink-600); }
.dark-scroll::-webkit-scrollbar-thumb:hover { background: var(--dark-scroll-hover); }
.dark-scroll::-webkit-scrollbar-track { background: transparent; }
.dark-scroll::-webkit-scrollbar-corner { background: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--text);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
code { font-family: var(--mono); font-size: .95em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] { display: none !important; }

/* ---------- Buttons and badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary, .btn--action { background: var(--action); color: var(--on-action); }
.btn--primary:hover, .btn--action:hover { background: var(--action-hover); }
.btn--line { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn--line:hover { border-color: var(--text); }
.btn--ghost, .btn--ghost-dark { border-color: var(--ghost-line); color: var(--on-dark); }
.btn--ghost:hover, .btn--ghost-dark:hover { border-color: var(--on-dark); background: var(--ghost-hover); }
.btn--danger { border-color: var(--bad-fg); background: var(--surface); color: var(--bad-fg); }
.btn--danger:hover { background: var(--bad-bg); }
.btn--sm { min-height: 36px; padding: var(--sp-1) var(--sp-4); font-size: 14px; }
.btn--lg { min-height: 56px; padding: var(--sp-3) var(--sp-6); font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1-5);
  padding: var(--sp-0) var(--sp-2-5);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge--wait { background: var(--wait-bg); color: var(--wait-fg); }
.badge--bad { background: var(--bad-bg); color: var(--bad-fg); }
.badge--draft { background: var(--draft-bg); color: var(--muted); }

.alert, .notice {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-1);
}
.alert { background: var(--bad-bg); color: var(--bad-fg); }
.notice { background: var(--ok-bg); color: var(--ok-fg); }

/* A failed background request (HTMX), filled by app.js. Pinned to the top: the bottom edge
   belongs to the phone navigation and the sticky form actions. */
.request-alert {
  position: fixed;
  left: var(--sp-4);
  right: var(--sp-4);
  top: calc(var(--sp-4) + env(safe-area-inset-top));
  z-index: 7;
  max-width: 560px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-right: var(--sp-2);
  border: 1px solid var(--bad-fg);
  box-shadow: 0 var(--sp-1) var(--sp-4) var(--shadow-line);
}
.request-alert[hidden] { display: none; }
.request-alert p { margin: 0; }
.request-alert__close {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.request-alert__close svg { width: 18px; height: 18px; }
.request-alert__close:focus-visible { outline: 2px solid var(--bad-fg); outline-offset: 2px; }

/* ---------- Frame: side panel on a computer, bottom bar on a phone ---------- */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(90deg, var(--nav-end) calc(var(--nav-w) - 1px), var(--ink-700) calc(var(--nav-w) - 1px) var(--nav-w), transparent var(--nav-w));
}
.sidenav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-6) var(--sp-4);
  background: linear-gradient(180deg, var(--ink-950), var(--ink-900) 60%, var(--nav-end));
  color: var(--on-dark);
  border-right: 1px solid var(--ink-700);
}
.brand {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  gap: var(--sp-3);
  padding: 0 var(--sp-2);
  color: var(--on-dark);
  text-decoration: none;
}
.brand__mark { width: 32px; height: 32px; flex: none; }
.brand__name { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.25; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-1);
  color: var(--on-dark-muted);
  text-decoration: none;
  font-weight: 500;
}
.nav-link svg { width: 20px; height: 20px; flex: none; }
.nav-link:hover { color: var(--on-dark); background: var(--ink-800); }
.nav-link[aria-current="page"] { color: var(--on-dark); background: var(--ink-800); box-shadow: inset 3px 0 0 var(--sand); }
.me {
  margin-top: auto;
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2) 0;
  border-top: 1px solid var(--ink-700);
}
.me__who { display: flex; gap: var(--sp-3); align-items: center; min-width: 0; color: inherit; text-decoration: none; }
.me__who > span:last-child { min-width: 0; }
.me__name { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.me__role { display: block; font-size: 13px; line-height: 1.3; color: var(--on-dark-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me form { margin: 0; }
.me .btn { width: 100%; }
.avatar {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--grad-a2), var(--grad-a1));
  color: var(--ink-950);
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.main { min-width: 0; display: flex; flex-direction: column; }
.main > .page, .main > .content, .main > .form-wrap { flex: 1 0 auto; }
.bottomnav, .mtop { display: none; }

/* Guest pages (sign-in): a slim dark bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--ink-950);
  color: var(--on-dark);
}

.page { padding: var(--sp-7); }
/* A page card takes the content width like design D; only the sign-in cards stay narrow. A form
   inside, and the sentences of a message card (an error), keep a readable line
   (ПЕРЕВІРКА-ВЛАСНИКА-1 а). */
.page > .card { margin: 0 auto; }
.page > .card form.stack { max-width: var(--card-w); }
.page > .card--message > p { max-width: var(--card-w); }
.page > .card--narrow { max-width: var(--card-narrow-w); }

/* ---------- Hero (D «афіша») ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--sp-7);
  color: var(--on-dark);
  background:
    radial-gradient(900px 420px at 88% -10%, var(--hero-glow) 0%, transparent 60%),
    linear-gradient(135deg, var(--ink-950), var(--ink-850));
}
.hero__lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image: repeating-linear-gradient(115deg, transparent 0 46px, var(--hero-sheen) 46px 47px);
}
.hero__inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-7); align-items: end; }
.hero__top { display: none; }
.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.hero h1 {
  margin-top: var(--sp-4);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.02em;
  font-size: clamp(28px, 3.5vw, 52px);
  line-height: 1.08;
  max-width: 18ch;
  overflow-wrap: break-word;
}
.hero h1 .name { color: var(--sand); }
.hero__sub { margin-top: var(--sp-4); font-size: 18px; color: var(--on-dark-muted); max-width: 46ch; }
.hero__actions { margin-top: var(--sp-6); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero .notice { margin-top: var(--sp-4); max-width: 46ch; }
.hero__stats { width: 300px; }
.stat { border-left: 2px solid var(--ink-600); padding-left: var(--sp-4); }
.stat__num { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 6vw, 96px); line-height: .95; letter-spacing: -.04em; color: var(--sand); }
.stat__num small { margin-left: var(--sp-1); font-family: var(--body); font-size: .38em; font-weight: 600; letter-spacing: 0; color: var(--on-dark-muted); }
.stat__label { margin-top: var(--sp-2); font-size: 14px; line-height: 1.35; color: var(--on-dark-muted); }
.stat__prev { margin-top: var(--sp-3); font-size: 15px; color: var(--on-dark); }
/* A real <progress>: no inline width, the CSP allows no inline styles. */
.meter {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: var(--sp-3);
  border: 0;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--ink-600);
  color: var(--accent-soft);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.meter::-webkit-progress-bar { background: var(--ink-600); border-radius: var(--r-pill); }
.meter::-webkit-progress-value { background: var(--accent-soft); border-radius: var(--r-pill); }
.meter::-moz-progress-bar { background: var(--accent-soft); border-radius: var(--r-pill); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: var(--tap);
  padding: 0 var(--sp-4) 0 var(--sp-2);
  border-radius: var(--r-pill);
  border: 1px solid var(--ghost-line);
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.back-link svg { width: 20px; height: 20px; transform: rotate(90deg); }
.back-link:hover { border-color: var(--on-dark); }

/* ---------- Home content ---------- */
.content { padding: var(--sp-7); display: grid; gap: var(--sp-7); align-content: start; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.block-title { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -.01em; line-height: 1.15; }
.block-note { color: var(--muted); font-size: 15px; }
.empty { padding: var(--sp-5); border: 1.5px dashed var(--line-strong); border-radius: var(--r-3); color: var(--muted); display: grid; gap: var(--sp-3); justify-items: start; }
.empty__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.attention { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--sp-4); }
.att {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line-strong);
  border-radius: var(--r-2);
}
.att--draft { border-top-color: var(--att-draft); }
.att--wait, .att--bad { border-top-color: var(--wait-dark); }
.att__kind { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-1) var(--sp-2); font-size: 13px; color: var(--muted); }
.att__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.att__link { color: inherit; text-decoration: none; }
.att__link:hover, .att__link:focus-visible { color: var(--accent-deep); text-decoration: underline; }
.att__text { font-size: 15px; color: var(--muted); }
.att__row { flex: 1; display: flex; flex-direction: column; gap: var(--sp-2); }
.att__foot { margin-top: auto; padding-top: var(--sp-2); }

.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-5); }
.poster {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-3);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--shadow-soft), 0 12px 32px -18px var(--shadow-poster);
}
.poster:focus-within { box-shadow: var(--focus); }
.poster__head {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 188px;
  padding: var(--sp-4) var(--sp-5);
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(260px 200px at 0% 0%, var(--poster-glow) 0%, transparent 70%),
    linear-gradient(150deg, var(--ink-850), var(--poster-end));
}
.poster__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster__head--photo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, var(--photo-scrim), var(--poster-end)); }
.poster__top, .poster__base { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: var(--sp-3); }
.poster__top { align-items: center; }
.poster__base { align-items: flex-end; }
.poster__date { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.poster__kind { padding: var(--sp-0) var(--sp-2-5); border: 1px solid var(--poster-line); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.poster__dir { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.3; color: var(--on-dark-muted); }
.poster__wait { flex: none; font-size: 14px; font-weight: 600; text-align: right; }
.poster__pts { display: flex; align-items: baseline; gap: var(--sp-2); flex: none; }
.poster__num { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: .8; letter-spacing: -.05em; color: var(--sand); }
.poster__unit { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--sand); }
.poster--doc .poster__head {
  color: var(--text);
  background:
    radial-gradient(260px 200px at 100% 0%, var(--poster-light-glow) 0%, transparent 70%),
    linear-gradient(150deg, var(--poster-light-1), var(--poster-light-2));
}
.poster--doc .poster__kind { border-color: var(--poster-light-shade); }
.poster--doc .poster__dir, .poster--doc .poster__wait { color: var(--muted); }
.poster--doc .poster__num { color: var(--sand-ink); }
.poster--doc .poster__unit { color: var(--sand-ink-strong); }
.poster__body { display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.poster__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.poster__link { color: inherit; text-decoration: none; }
/* The whole card opens the record; the title link carries the name for screen readers. */
.poster__link::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.poster__link:focus-visible { box-shadow: none; }
.poster__meta { font-size: 14px; color: var(--muted); }
.poster__with {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  align-self: flex-start;
  max-width: 100%;
  padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
  border-radius: var(--r-pill);
  background: var(--with-bg);
  color: var(--with-fg);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.poster__with > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.initials {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--with-fg);
  color: var(--on-action);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.poster__foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; justify-content: space-between; }
.poster__note { font-size: 13px; color: var(--muted); }

/* Directions of the month: checklist with tooltips */
.dirs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.dirs__rule { max-width: 80ch; padding: var(--sp-4) var(--sp-5); font-size: 15px; line-height: 1.45; border-bottom: 1px solid var(--line); }
.dirs__list { list-style: none; margin: 0; padding: 0; }
.dirs__row { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-4); align-items: start; padding: var(--sp-3) var(--sp-5); }
.dirs__row + .dirs__row { border-top: 1px solid var(--line); }
.dirs__mark { display: grid; place-items: center; width: 32px; height: 32px; margin-top: var(--sp-1-5); border-radius: 50%; }
.dirs__mark svg { width: 18px; height: 18px; }
.is-done .dirs__mark { background: var(--accent-deep); color: var(--on-action); }
.is-sent .dirs__mark { background: var(--accent-tint); color: var(--accent-deep); border: 2px solid var(--accent-deep); }
.is-open .dirs__mark { border: 2px dashed var(--line-strong); color: var(--muted); }
.dirs__body { min-width: 0; }
.dirs__namewrap { position: relative; display: block; }
.dirs__name {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  cursor: help;
  text-decoration: underline dotted var(--line-strong);
  text-underline-offset: 4px;
}
.dirs__name:hover { text-decoration-color: var(--accent-deep); }
.dirs__tip {
  position: absolute;
  z-index: 3;
  left: 0;
  top: calc(100% + var(--sp-1));
  width: max-content;
  max-width: min(100%, 52ch);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-1);
  background: var(--ink-900);
  color: var(--on-dark);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 12px 28px -12px var(--shadow-poster);
  visibility: hidden;
  opacity: 0;
  transition: opacity .12s;
}
.dirs__namewrap.is-open .dirs__tip, .dirs__name:focus-visible + .dirs__tip { visibility: visible; opacity: 1; }
@media (hover: hover) { .dirs__namewrap:hover .dirs__tip { visibility: visible; opacity: 1; } }
.dirs__hint { font-size: 15px; line-height: 1.4; color: var(--muted); }
.dirs__state { margin-top: var(--sp-1); font-size: 15px; font-weight: 600; color: var(--accent-deep); }
.dirs__rejected { display: grid; gap: var(--sp-1); margin: var(--sp-1) 0 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.4; color: var(--bad-fg); }
.dirs__rejected a { color: inherit; font-weight: 600; }
.dirs__side { display: grid; justify-items: end; gap: var(--sp-1); padding-top: var(--sp-3); text-align: right; }
.dirs__max, .dirs__pts { font-size: 14px; color: var(--muted); white-space: nowrap; }
.dirs__pts--got { color: var(--text); font-weight: 600; }
.dirs__pts--got b { font-family: var(--display); font-size: 24px; color: var(--sand-ink); letter-spacing: -.03em; }
.dirs__go {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: var(--tap);
  padding: 0 var(--sp-2) 0 var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.dirs__go svg { width: 18px; height: 18px; transform: rotate(-90deg); }
.is-open:hover, .is-open:focus-within { background: var(--row-hover); }
.is-open:hover .dirs__go { background: var(--action-hover); }
.dirs__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-3) var(--r-3); background: var(--surface-2); font-size: 14px; color: var(--muted); }

/* ---------- Cards, fields (all pages) ---------- */
.card { padding: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.card h1 { margin-bottom: var(--sp-4); font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.2; }
.card > h2:not(.zone-title) { margin: var(--sp-5) 0 var(--sp-3); font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; }
.card > p + p, .card > p + .actions, .card > p + form { margin-top: var(--sp-4); }
.card .alert, .card .notice { margin-bottom: var(--sp-4); }
.card-grid { display: grid; gap: var(--sp-5); }
.card-grid--tight { gap: var(--sp-3); }
.lead { font-size: 18px; color: var(--muted); }
.muted { color: var(--muted); }
.stack { display: grid; gap: var(--sp-4); }
.field { display: grid; gap: var(--sp-2); font-weight: 600; font-size: 15px; }
.field > label, .lbl { font-weight: 600; font-size: 15px; }
.req { margin-left: var(--sp-0); color: var(--accent-deep); }
.hintline, .field-hint { font-size: 14px; font-weight: 400; color: var(--muted); }

input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--text);
  font-weight: 400;
  transition: border-color .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink-900); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
/* Own arrow, inset from the right edge; native arrows sit flush in several engines. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: calc(var(--sp-3) + var(--arrow-size) + var(--sp-3));
  background-image:
    linear-gradient(45deg, transparent 50%, var(--select-arrow) 50%),
    linear-gradient(135deg, var(--select-arrow) 50%, transparent 50%);
  background-position:
    right calc(var(--sp-3) + var(--arrow-size) / 2) center,
    right var(--sp-3) center;
  background-size: calc(var(--arrow-size) / 2) calc(var(--arrow-size) / 2);
  background-repeat: no-repeat;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--action);
}
input[type="file"] { padding: var(--sp-2); }
/* Two rules on purpose: an engine that does not know one pseudo-element drops the whole list. */
input[type="file"]::file-selector-button {
  margin-right: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
input[type="file"]::-webkit-file-upload-button {
  margin-right: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-5); }

/* Legacy admin and account pages */
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.head-row h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.count { color: var(--muted); font-family: var(--body); font-weight: 500; font-size: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
.actions form { margin: 0; }
.actions-hint { margin: var(--sp-3) 0 0; }
.crumbs { margin: 0 0 var(--sp-2); font-size: 14px; }

/* Довідник напрямів (суперадмін) */
.catalog { display: grid; gap: var(--sp-4); margin: var(--sp-5) 0 0; padding: 0; list-style: none; }
.catalog__item { display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-2); }
.catalog__head { display: flex; gap: var(--sp-3); align-items: flex-start; }
.catalog__num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); font-family: var(--display); }
.catalog__body { display: grid; gap: var(--sp-1); min-width: 0; }
.catalog__title { margin: 0; font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.catalog__meta { font-size: 14px; font-weight: 600; color: var(--accent-deep); }
.catalog__text, .catalog__hint { font-size: 15px; line-height: 1.45; color: var(--muted); }
.catalog__history, .catalog__change { font-size: 15px; }
.catalog__history > summary, .catalog__change > summary { cursor: pointer; font-weight: 600; color: var(--accent-deep); }
.catalog__history ul { display: grid; gap: var(--sp-1); margin: var(--sp-2) 0 0; padding-left: var(--sp-5); color: var(--muted); }
.catalog__change form { margin-top: var(--sp-3); }
.catalog__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-4); }
.tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: 0; }
.tag { padding: var(--sp-0) var(--sp-2); border-radius: var(--r-1); background: var(--surface-2); color: var(--muted); font-size: 13px; white-space: nowrap; }
.tag--ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag--bad { background: var(--bad-bg); color: var(--bad-fg); }
/* «Можливий дубль»: a wrapping note, since it names the record, its state and the file. */
.dup-mark, .dup-warn { padding: var(--sp-1) var(--sp-2); border-radius: var(--r-1); background: var(--bad-bg); color: var(--bad-fg); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.dup-warn { margin: var(--sp-2) 0 0; font-weight: 600; }
.dup-mark--credited { font-weight: 600; }  /* points for that file were already given once */
.dup-warn a { white-space: nowrap; }
/* The link to the matching record inside «Можливий дубль». */
.badge a, .tag a, .dup-mark a, .dup-warn a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.people, .report { list-style: none; margin: 0; padding: 0; }
.card > .pills { margin-bottom: var(--sp-4); }
.person { display: grid; gap: var(--sp-1); padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.person__name { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.person__name:hover { text-decoration: underline; }
.person__meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.report__line { display: grid; grid-template-columns: 3ch minmax(0, 1fr); column-gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: 14px; }
.report__no { grid-row: span 2; color: var(--muted); text-align: right; }
.report__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.report__reason { color: var(--ok-fg); }
.report__line--skipped .report__reason { color: var(--bad-fg); }
.report + .muted { margin-top: var(--sp-4); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-5); margin-top: var(--sp-4); }
.panel h2 { margin-top: 0; }
.choices { display: grid; gap: var(--sp-2); margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: var(--sp-2); padding: 0; font-weight: 600; }
.choice { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; font-weight: 500; }
.password-box { padding: var(--sp-4); border-radius: var(--r-1); background: var(--accent-tint); text-align: center; }
.password { font-size: 20px; letter-spacing: .04em; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
.steps { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }
.secret {
  display: block;
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-1);
  background: var(--surface-2);
  font-family: var(--mono);
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-4); padding-left: var(--sp-5); font-family: var(--mono); }

/* ---------- Event form ---------- */
.hero--add { padding-bottom: var(--sp-6); }
.hero--add .hero__inner { max-width: calc(var(--form-w) - 2 * var(--sp-7)); margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
.hero--add h1 { max-width: none; margin-top: 0; font-size: clamp(32px, 4vw, 60px); }
/* «Подія | Документ» next to the title of a new form (design D, screen add). */
.hero--add .hero__inner--seg { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-5); }
.seg {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: var(--sp-1);
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-600);
  background: var(--overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.seg a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border-radius: var(--r-pill);
  color: var(--on-dark-muted);
  font-weight: 600;
  text-decoration: none;
}
.seg a:hover { color: var(--on-dark); }
.seg a:focus-visible { box-shadow: var(--focus-dark); outline: none; }
.seg a[aria-current="page"] { background: var(--on-dark); color: var(--ink-950); }
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.form { display: grid; gap: var(--sp-6); max-width: var(--form-w); margin: 0 auto; padding: var(--sp-7) var(--sp-7) var(--sp-5); }
.form-wrap { display: flex; flex-direction: column; }
.zone { display: grid; gap: var(--sp-4); }
.drop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-6);
  border-radius: var(--r-3);
  color: var(--on-dark);
  background:
    radial-gradient(500px 220px at 100% 0%, var(--hero-glow) 0%, transparent 70%),
    linear-gradient(140deg, var(--ink-900), var(--ink-850));
  outline: 2px dashed var(--drop-dash);
  outline-offset: -10px;
}
.drop.is-over { outline-color: var(--accent-soft); }
.drop__title { font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.2; }
.drop__sub { margin-top: var(--sp-1); font-size: 16px; font-weight: 600; }
.drop__rules { margin-top: var(--sp-3); max-width: 60ch; font-size: 14px; color: var(--on-dark-muted); }
.drop__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
/* File pickers are labels around a hidden input: the ring follows the focused input. */
label.btn:focus-within { box-shadow: var(--focus); }
.drop__actions .btn:focus-visible, .drop__actions label.btn:focus-within { box-shadow: var(--focus-dark); }
.only-phone { display: none; }
.zone-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--sp-3) var(--sp-4); }
/* A card with a heading and a list of files: one gap between them, none when the list is empty. */
.files-section { display: grid; gap: var(--sp-4); }
.card[data-files-card] { display: grid; gap: var(--sp-3); }
.zone-head__text { display: grid; gap: var(--sp-1); min-width: 0; flex: 1 1 320px; }
.zone-title { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.2; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: var(--sp-4); }
.files:empty { display: none; }
.file {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-3) var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
}
.file--bad { border-color: var(--file-bad-line); background: var(--file-bad-bg); }
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--r-1);
  background: linear-gradient(150deg, var(--thumb-a), var(--thumb-b));
  color: var(--on-action);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.file__open { display: block; align-self: start; border-radius: var(--r-1); }
.thumb svg { width: 36px; height: 36px; }
.thumb--wait { background: var(--thumb-wait); color: var(--muted); padding: var(--sp-2); text-align: center; font-size: 12px; font-weight: 600; line-height: 1.3; }
.thumb--doc { background: var(--accent-tint); color: var(--accent-deep); }
.thumb--bad { background: var(--bad-bg); color: var(--bad-fg); }
.file__info { min-width: 0; display: grid; gap: var(--sp-1); align-content: start; }
.file__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; font-size: 14px; color: var(--muted); }
.file__caption { grid-column: 1 / -1; }
.file__caption label { font-size: 14px; }
.file__err { grid-column: 1 / -1; color: var(--bad-fg); font-size: 15px; font-weight: 500; }
.file__err--wait { color: var(--wait-fg); }
.file__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: var(--sp-1);
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--progress-track);
  color: var(--action);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.progress::-webkit-progress-bar { background: var(--progress-track); border-radius: 6px; }
.progress::-webkit-progress-value { background: linear-gradient(90deg, var(--action), var(--accent)); border-radius: 6px; }
.progress::-moz-progress-bar { background: linear-gradient(90deg, var(--action), var(--accent)); border-radius: 6px; }
.counter, .story-count { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; }
.story-count.is-enough { color: var(--ok-fg); }
.story-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: var(--sp-3); }
.note-box { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-1); border-left: 3px solid var(--accent-deep); background: var(--surface-2); font-size: 14px; color: var(--muted); }
.prompts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.prompt {
  padding: var(--sp-1-5) var(--sp-3);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
}
.prompt:hover { border-color: var(--accent-deep); background: var(--accent-tint); }

.switch-row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); }
.switch-block { display: grid; gap: var(--sp-2); }
.switch-block + .switch-block { margin-top: var(--sp-4); }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; min-height: var(--tap); font-weight: 600; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch__track { position: relative; width: 48px; height: 28px; border-radius: var(--r-pill); background: var(--switch-off); transition: background-color .15s ease; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px var(--knob-shadow); transition: transform .15s ease; }
.switch input:checked + .switch__track { background: var(--accent-deep); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }
.switch__state { min-width: 2.2em; }

.coauthors { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.coauthors:empty { display: none; }
.coauthor { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; padding: var(--sp-1); border-radius: var(--r-pill); background: var(--with-bg); color: var(--with-fg); font-weight: 600; font-size: 14px; }
.coauthor > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--shadow-line); }
.icon-btn svg { width: 16px; height: 16px; }
.search-field { position: relative; }
.search-field > svg { position: absolute; left: var(--sp-3); top: 50%; width: var(--icon-sm); height: var(--icon-sm); transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: calc(var(--sp-3) + var(--icon-sm) + var(--sp-2)); }
.suggest-list {
  list-style: none;
  margin: 0;
  padding: var(--sp-1);
  display: grid;
  gap: var(--sp-0);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  box-shadow: 0 12px 28px -18px var(--shadow-poster);
}
.suggest-list:empty { display: none; }
.suggest {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.suggest:hover { background: var(--row-hover); }
.suggest__text { display: grid; min-width: 0; line-height: 1.3; }
.suggest__name { font-weight: 600; }
.suggest__name mark { border-radius: 3px; background: var(--sand-tint); color: inherit; }
.suggest__pos { font-size: 14px; color: var(--muted); }
.suggest-empty { padding: var(--sp-2) var(--sp-3); font-size: 14px; color: var(--muted); }

details.more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
details.more > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  list-style: none;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .sum-note { margin-left: var(--sp-3); font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--muted); }
details.more > summary .chev { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); transition: transform .2s ease; }
details.more > summary .chev svg { width: 16px; height: 16px; }
details.more[open] > summary .chev { transform: rotate(180deg); }
.more__body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-5); padding: 0 var(--sp-5) var(--sp-5); }
.more__wide { grid-column: 1 / -1; }
.caption-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-4); }

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  width: calc(100% - 2 * var(--sp-7));
  max-width: calc(var(--form-w) - 2 * var(--sp-7));
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-3) var(--r-3) 0 0;
  color: var(--on-dark);
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.actionbar__status { display: grid; gap: var(--sp-0); min-width: 0; }
.actionbar__saved { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; }
.actionbar__saved::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent-soft); }
.actionbar__rule { max-width: 52ch; font-size: 13px; color: var(--on-dark-muted); }
.actionbar__btns { display: flex; gap: var(--sp-3); }
.actionbar .btn:focus-visible { box-shadow: var(--focus-dark); }

/* Read-only record and clarifications */
.record { display: grid; gap: var(--sp-4); }
.record__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; color: var(--muted); font-size: 15px; }
.record__story { white-space: pre-line; }
.clar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.clar { padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--wait-dark); border-radius: var(--r-1); background: var(--surface-2); white-space: pre-line; }
.clar__when { display: block; font-size: 13px; color: var(--muted); }
.clar-acts { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
[data-clarify-status].is-error { color: var(--bad-fg); }

/* Version history on the record card, newest first (V2-Ф2) */
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.history__item { display: grid; gap: var(--sp-1); padding-left: var(--sp-4); border-left: 2px solid var(--line-strong); }
.history__head { font-size: 15px; }
.history__meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history__note { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Phone ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); background: var(--paper); }
  .sidenav { display: none; }
  .bottomnav {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: grid;
    /* Four sections, five with «Галерея»: as many equal columns as there are links. */
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ink-700);
    background: var(--glass-nav);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .bottomnav a {
    display: grid;
    justify-items: center;
    gap: var(--sp-0);
    min-height: 56px;
    padding: var(--sp-2) var(--sp-1);
    border-radius: var(--r-1);
    color: var(--on-dark-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
  }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a[aria-current="page"] { color: var(--on-dark); }
  .bottomnav a[aria-current="page"] svg { color: var(--sand); }
  .bottomnav a:focus-visible { box-shadow: var(--focus-dark); }
  .mtop { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--ink-950); color: var(--on-dark); }
  .mtop .brand { padding: 0; }
  .mtop .avatar, .hero__top .avatar { font-size: 14px; }

  .page { padding: var(--sp-5) var(--sp-4) var(--sp-6); }
  .card { padding: var(--sp-4); }
  .hero { padding: var(--sp-5) var(--sp-4) var(--sp-6); }
  .hero__top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
  .hero__top .brand { padding: 0; }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .hero h1 { margin-top: var(--sp-3); font-size: 27px; }
  .hero__sub { font-size: 16px; }
  .hero__actions { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: var(--sp-5); }
  .hero__stats { width: auto; }
  .stat--main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--sp-3); align-items: center; }
  .stat--main .meter, .stat--main .stat__prev { grid-column: 1 / -1; }
  .stat__num { font-size: 44px; }
  .stat__label { margin-top: 0; }
  .meter, .stat__prev { margin-top: var(--sp-2); }
  .content { padding: var(--sp-6) var(--sp-4) var(--sp-7); gap: var(--sp-6); }
  .block-title { font-size: 22px; }
  .block-head { margin-bottom: var(--sp-4); }
  .posters, .attention { gap: var(--sp-3); }
  .att { padding: var(--sp-3) var(--sp-4); gap: var(--sp-1); }
  .att__row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2) var(--sp-3); }
  .att__row .att__text { flex: 1 1 160px; }
  .att__foot { padding-top: 0; }
  .poster { border-radius: var(--r-2); }
  .poster__head { min-height: 68px; padding: var(--sp-3) var(--sp-4); gap: var(--sp-1); justify-content: center; }
  .poster__head--photo { min-height: 132px; justify-content: space-between; }
  .poster__top { justify-content: flex-start; }
  .poster__date { font-size: 14px; }
  .poster__kind { padding: 0 var(--sp-2); font-size: 12px; }
  .poster__wait { font-size: 13px; }
  .poster__num { font-size: 44px; }
  /* No hover on a phone and the whole card is a link: the names wrap instead of hiding. */
  .poster__with > span:last-child {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
  }
  .poster__body { padding: var(--sp-3) var(--sp-4); gap: var(--sp-2); }
  .poster__title { font-size: 16px; }
  .dirs__rule { padding: var(--sp-3) var(--sp-4); }
  .dirs__row { grid-template-columns: 28px minmax(0, 1fr); gap: 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  .dirs__mark { width: 28px; height: 28px; margin-top: var(--sp-2); }
  .dirs__mark svg { width: 16px; height: 16px; }
  .dirs__name { font-size: 16px; }
  .dirs__side { grid-column: 2; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding-top: var(--sp-2); text-align: left; }
  .dirs__foot { padding: var(--sp-4); }

  .btn--sm, .prompt, .switch { min-height: var(--tap); }
  .form { padding: var(--sp-5) var(--sp-4) var(--sp-5); gap: var(--sp-5); }
  .hero--add h1 { font-size: 34px; }
  .hero--add .hero__inner--seg { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .drop { grid-template-columns: minmax(0, 1fr); padding: var(--sp-5); }
  .drop__title { font-size: 20px; }
  .drop__actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .drop__actions .btn { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .only-phone { display: inline-flex; }
  .files { grid-template-columns: minmax(0, 1fr); }
  .file { grid-template-columns: 72px minmax(0, 1fr); padding: var(--sp-3); }
  .thumb { width: 72px; height: 72px; }
  details.more > summary { padding: var(--sp-4); }
  details.more > summary .sum-note { display: block; margin: var(--sp-0) 0 0; }
  .more__body { padding: 0 var(--sp-4) var(--sp-4); }
  .actionbar { width: 100%; margin: 0; padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); border-radius: var(--r-2) var(--r-2) 0 0; }
  .actionbar__btns { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .actionbar__btns .btn { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .actionbar__status { order: 2; }
  .page--form .bottomnav { display: none; }
}
/* ---------- Administration (design D, ?screen=admin): dark page, white sheets ---------- */
.is-admin .app { background: linear-gradient(90deg, var(--nav-end) calc(var(--nav-w) - 1px), var(--ink-600) calc(var(--nav-w) - 1px) var(--nav-w), var(--ink-950) var(--nav-w)); }
.admin-main {
  flex: 1 0 auto;
  display: grid;
  align-content: start;
  gap: var(--sp-5);
  min-width: 0;
  /* The same gutter from the menu as .content, so content does not shift between sections. */
  padding: var(--sp-7);
  color: var(--on-dark);
  background: var(--admin-backdrop);
}
.admin-top, .admin-nav { display: none; }
/* On the dark backdrop the menu edge would melt away and the menu would seem to widen. */
.is-admin .sidenav { border-right-color: var(--ink-600); }
/* The page bar and its reserved gutter sit on the dark backdrop too, not on a cream strip. */
body.is-admin { background: var(--ink-950); }
html:has(body.is-admin) { scrollbar-color: var(--ink-600) var(--ink-950); }
html:has(body.is-admin)::-webkit-scrollbar-thumb { background-color: var(--ink-600); }
html:has(body.is-admin)::-webkit-scrollbar-thumb:hover { background-color: var(--dark-scroll-hover); }
.topbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.topbar h1 { margin-right: auto; font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1; letter-spacing: -.03em; }
.topbar select { width: 200px; }
.topbar .search-field { width: 340px; }
.topbar .search-field > svg { width: 18px; height: 18px; color: var(--on-dark-muted); }
.topbar .search-field input { padding-left: calc(var(--sp-3) + 18px + var(--sp-2)); }
.select--dark, .input--dark { background-color: var(--ink-800); border-color: var(--ink-600); color: var(--on-dark); }
.select--dark { --select-arrow: var(--on-dark); }
.input--dark::placeholder { color: var(--on-dark-muted); }
.select--dark:hover, .input--dark:hover { border-color: var(--on-dark-muted); }
.select--dark:focus-visible, .input--dark:focus-visible { border-color: var(--accent-soft); box-shadow: var(--focus-dark); }
.select--dark option { background: var(--surface); color: var(--text); }

.scope {
  justify-self: start;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  min-height: var(--tap);
  padding: var(--sp-1) var(--sp-5);
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-700);
  background: var(--ink-850);
}
/* A reset button sits inside the pill, close to its right edge. */
.scope:has(> .btn) { padding-right: var(--sp-1); }
.scope b { color: var(--sand); font-weight: 600; }
.admin-main > .alert, .admin-main > .notice { justify-self: start; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4); }
.tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-2);
  border: 1px solid var(--ink-700);
  background: linear-gradient(150deg, var(--ink-850), var(--tile-end));
  color: var(--on-dark);
  text-decoration: none;
}
.tile--link:hover { border-color: var(--ink-600); }
.tile__label { font-size: 14px; color: var(--on-dark-muted); }
.tile__num { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.05; letter-spacing: -.04em; }
.tile__num small { font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--on-dark-muted); }
.tile--accent .tile__num { color: var(--sand); }

.sheet { overflow: hidden; border-radius: var(--r-3); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -30px var(--shadow-deep); }
.sheet__head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.sheet__title { font-family: var(--display); font-weight: 600; font-size: 18px; }
.sheet__note { font-size: 13px; color: var(--muted); }
.sheet__empty { padding: var(--sp-5); color: var(--muted); }
.sheet__alert { margin: var(--sp-4) var(--sp-5) 0; }
.sheet__bar { padding: 0 var(--sp-5); border-bottom: 1px solid var(--line); }

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); }
.pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}
.pill:hover { border-color: var(--text); }
.pill[aria-current="true"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--on-dark); }
.btn--dark { background: var(--ink-900); color: var(--on-dark); }
.btn--dark:hover { background: var(--ink-700); }

.scroll-x { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.scroll-x::-webkit-scrollbar { height: var(--scroll-size); }
.scroll-x::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: var(--scroll-size); border: 2px solid var(--surface); }
.scroll-x::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.scroll-x::-webkit-scrollbar-track { background: transparent; }
.scroll-x::-webkit-scrollbar-corner { background: transparent; }
.rt, .mt { width: 100%; border-collapse: collapse; }

/* Рейтинг активності */
.rating-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 var(--sp-4); padding: 0 var(--sp-5) var(--sp-2); border-bottom: 1px solid var(--line); }
.stale-link { gap: var(--sp-2); }
.stale-link::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--wait-dark); }
.rt { font-size: 15px; table-layout: fixed; }
.rt th, .rt td { padding: var(--sp-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.rt thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.rt th:first-child, .rt td:first-child { padding-left: var(--sp-5); }
.rt th:last-child, .rt td:last-child { padding-right: var(--sp-5); }
.rt .place { width: 88px; }
.rt td.place { font-family: var(--display); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.rt .n { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.rt td.score { font-family: var(--display); font-weight: 600; font-size: 17px; }
.rt__row { position: relative; }
.rt__row:hover { background: var(--row-hover); }
.rt__row.is-selected { background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent-deep); }
.rt__name { margin-right: var(--sp-2); font-weight: 600; color: var(--text); text-decoration: none; }
.rt__name::after { content: ""; position: absolute; inset: 0; }
.rt__name:hover { text-decoration: underline; }
.rt__meta { display: none; margin-top: 2px; font-size: 13px; color: var(--muted); }
.rt__gap td { padding: var(--sp-1); background: var(--surface-2); }
.rt__empty { color: var(--muted); }
.stale-tag { display: inline-block; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--row-stale); color: var(--wait-fg); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.rating-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); padding: var(--sp-3) var(--sp-5); background: var(--surface-2); }
.rating-foot p { font-size: 14px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: var(--sp-1); }
.pager__btn { display: inline-grid; place-items: center; min-width: var(--tap); height: var(--tap); padding: 0 var(--sp-2); border-radius: var(--r-1); border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.pager__btn:hover { border-color: var(--text); }
.pager__btn[aria-current="page"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--on-dark); }
.pager__gap { min-width: var(--sp-5); text-align: center; color: var(--muted); }

/* Бали за місяць: широкий підсумок-кнопка, вузькі бали */
.mt { font-size: 14px; min-width: 1080px; table-layout: fixed; }
.mt__dir { width: 250px; }
.mt__pts { width: 260px; }
.mt th, .mt td { padding: var(--sp-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.mt thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.mt th:first-child, .mt td:first-child { padding-left: var(--sp-5); }
.mt th:last-child, .mt td:last-child { padding-right: var(--sp-5); }
.dirc { display: flex; align-items: flex-start; gap: var(--sp-3); }
.dirc b { min-width: 1.1em; font-family: var(--display); font-size: 24px; line-height: 1; letter-spacing: -.04em; color: var(--accent-deep); }
.dirc span { font-weight: 600; line-height: 1.3; }
.dirc small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.mt .muted { display: inline-block; padding-top: var(--sp-2); color: var(--muted); }
.sum-btn {
  display: grid;
  gap: var(--sp-0);
  width: 100%;
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-1);
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.sum-btn:hover { border-color: var(--accent-deep); background: var(--row-hover); }
.sum-btn__count { font-size: 13px; font-weight: 600; color: var(--accent-deep); }
.sum-btn__titles { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; text-decoration: underline; text-underline-offset: 2px; }
.pts { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--sp-2); }
.pts input { min-height: 40px; padding: var(--sp-1) var(--sp-2); font-size: 14px; }
.pts__num { text-align: center; }
.pts__read { display: grid; gap: var(--sp-0); padding-top: var(--sp-2); }
.pts__read b { font-family: var(--display); font-size: 18px; color: var(--sand-ink); }
.pts__read small { color: var(--muted); font-size: 13px; }
.mt tfoot td { padding-top: var(--sp-3); padding-bottom: var(--sp-3); text-align: right; font-family: var(--display); font-weight: 600; font-size: 16px; background: var(--surface-2); border-bottom: 0; }
.mt tfoot b { color: var(--accent-deep); }
.panel-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); background: var(--surface-2); }
.panel-foot p { max-width: 64ch; font-size: 14px; color: var(--muted); }
.month-state { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); }
.month-state__note { flex: 1 1 280px; max-width: 64ch; font-size: 14px; color: var(--muted); }
.month-state__note b { color: var(--text); }
.month-state__reason { flex: 1 1 220px; min-width: 0; }

/* Стрічка записів */
.feed { margin: 0; padding: 0; list-style: none; }
.feed__row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); }
.feed__row + .feed__row { border-top: 1px solid var(--line); }
.feed__date { font-family: var(--display); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed__body { display: grid; min-width: 0; }
.feed__dup { justify-self: start; margin-top: var(--sp-1); }
.rv__dup { justify-self: start; margin: 0; }
.feed__title { overflow: hidden; font-weight: 600; color: var(--text); text-overflow: ellipsis; white-space: nowrap; }
a.feed__title:hover { color: var(--accent-deep); }
.feed__meta { overflow: hidden; font-size: 13px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

/* Черга перевірки */
.rv-list { margin: 0; padding: 0; list-style: none; }
.rv { display: grid; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); }
.rv + .rv { border-top: 1px solid var(--line); }
.rv__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.rv__title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.rv__title-link { color: inherit; text-decoration: none; border-radius: var(--r-1); }
.rv__title-link:hover { color: var(--accent-deep); text-decoration: underline; }
.rv__title-link:focus-visible { box-shadow: var(--focus); }
/* «Показати ще» under the queue: the next portion comes in its place (V2-К1). */
.rv-more { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--sp-2) var(--sp-4); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--line); }
.rv-more__note { color: var(--muted); font-size: 14px; }
.rv__meta, .rv__files { font-size: 14px; color: var(--muted); }
.rv__story { max-width: 80ch; white-space: pre-line; }
/* A long address breaks anywhere instead of widening the card on a phone. */
.rv__link { font-weight: 600; overflow-wrap: anywhere; text-underline-offset: 3px; }
.rv__reason { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-1); background: var(--bad-bg); color: var(--bad-fg); }
.rv__badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.rv__asked { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-1); background: var(--wait-bg); color: var(--wait-fg); }
.rv__changes { display: grid; gap: var(--sp-2); max-width: 80ch; }
.rv__changes-title { font-size: 14px; font-weight: 600; }
.rv__decide { display: grid; gap: var(--sp-2); max-width: 720px; padding-top: var(--sp-2); }
.rv__decide textarea { min-height: 72px; }
.rv__acts { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* A record's files in the queue and the feed: previews in a row, evidence as named chips. */
.rec-files { display: grid; gap: var(--sp-2); min-width: 0; }
.feed__body .rec-files { margin-top: var(--sp-2); }
/* A row with previews is tall: date and state stay by the title, not in the middle. */
.feed__row--files { align-items: start; }
.rec-files__media, .rec-files__docs { margin: 0; padding: 0; list-style: none; }
.rec-files__media { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.rec-files__item { flex: none; }
.rec-files__open { display: block; border-radius: var(--r-1); }
.rec-files__docs { display: flex; flex-wrap: wrap; gap: var(--sp-2); min-width: 0; }
.rec-files__docs li { min-width: 0; max-width: 100%; }
.rec-doc {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
  min-height: 36px;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}
a.rec-doc:hover { border-color: var(--accent-deep); color: var(--accent-deep); }
.rec-doc svg { flex: none; width: 18px; height: 18px; color: var(--accent-deep); }
.rec-doc--wait svg { color: var(--muted); }
.rec-doc__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-doc__note { flex: none; color: var(--wait-fg); font-weight: 600; }
/* A file that came after submission: under its preview or chip, never as wide as the page. */
.rec-files__item { width: min-content; }
.rec-files__later {
  display: block;
  width: fit-content;
  margin-top: var(--sp-1);
  padding: var(--sp-0) var(--sp-1-5);
  border-radius: var(--r-1);
  background: var(--wait-bg);
  color: var(--wait-fg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

@media (max-width: 900px) {
  .is-admin .app { background: var(--ink-950); }
  .is-admin .mtop { display: none; }
  .admin-top { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--ink-950); color: var(--on-dark); }
  .admin-top .avatar { width: 40px; height: 40px; font-size: 14px; text-decoration: none; }
  .admin-nav { display: flex; gap: var(--sp-2); overflow-x: auto; padding: 0 var(--sp-4) var(--sp-3); background: var(--ink-950); border-bottom: 1px solid var(--ink-700); }
  .admin-nav a { flex: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-4); border-radius: var(--r-pill); border: 1px solid var(--ink-700); color: var(--on-dark-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .admin-nav a[aria-current="page"] { background: var(--on-dark); border-color: var(--on-dark); color: var(--ink-950); }
  .admin-main { gap: var(--sp-4); padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  .topbar h1 { width: 100%; font-size: 30px; }
  .topbar select, .topbar .search-field, .topbar .btn { width: 100%; }
  .scope { width: 100%; justify-content: space-between; border-radius: var(--r-2); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3); }
  .tiles { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .tile { padding: var(--sp-3) var(--sp-4); }
  .tile__num { font-size: 32px; }
  .tile__label { font-size: 13px; }
  .sheet__head { padding: var(--sp-4); }
  .sheet__alert { margin: var(--sp-4) var(--sp-4) 0; }
  .sheet__bar, .sheet__empty { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .rating-bar, .rating-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .rt th:first-child, .rt td:first-child { padding-left: var(--sp-4); }
  .rt th:last-child, .rt td:last-child { padding-right: var(--sp-4); }
  .rt .place { width: 52px; }
  .rt .n { width: 64px; }
  .rt .n--extra { display: none; }
  .rt__meta { display: block; }
  .mt { min-width: 0; }
  .mt colgroup, .mt thead { display: none; }
  .mt, .mt tbody, .mt tfoot, .mt tr, .mt td { display: block; width: 100%; }
  .mt tr { padding: var(--sp-4); border-bottom: 1px solid var(--line); }
  .mt td, .mt td:first-child, .mt td:last-child { padding: var(--sp-1) 0; border: 0; }
  .mt td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
  .mt td:first-child { padding-bottom: var(--sp-2); }
  .mt td:last-child { padding-top: var(--sp-2); }
  .mt tfoot tr { padding: var(--sp-3) var(--sp-4); }
  .mt tfoot td, .mt tfoot td:first-child, .mt tfoot td:last-child { padding: 0; text-align: left; }
  .panel-foot { padding: var(--sp-4); }
  .panel-foot .btn { width: 100%; }
  .month-state { padding: var(--sp-4); }
  .month-state .btn { width: 100%; }
  .feed__row { grid-template-columns: 48px minmax(0, 1fr); padding: var(--sp-3) var(--sp-4); }
  .feed__row .badge { grid-column: 2; justify-self: start; }
  .rv { padding: var(--sp-4); }
  .rv__head { flex-direction: column; gap: var(--sp-2); }
  .rv__acts .btn { flex: 1 1 140px; }
  /* On a phone the previews scroll sideways inside the card, never the page. */
  .rec-files__media {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: var(--sp-0) var(--sp-0) var(--sp-1);
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  }
  .rec-files__media::-webkit-scrollbar { height: var(--scroll-size); }
  .rec-files__media::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: var(--scroll-size); border: 2px solid var(--surface); }
  .rec-files__media::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
  .rec-files__media::-webkit-scrollbar-track { background: transparent; }
  .rec-files__media::-webkit-scrollbar-corner { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Export (design D, ?screen=admin, block «Експорт») ---------- */
.notice--row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-4); padding-top: 0; padding-bottom: 0; min-height: var(--tap); }
.notice--row .link-btn { color: inherit; }
.export { display: grid; gap: var(--sp-5); padding: var(--sp-5); }
.ready { display: grid; gap: var(--sp-3); }
.ready__line { font-family: var(--display); font-weight: 600; font-size: 17px; }
.ready__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.ready__skips { display: grid; gap: var(--sp-2); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.skips {
  display: grid;
  gap: var(--sp-2);
  max-height: 260px;
  margin: 0;
  padding: 0 var(--sp-2) 0 var(--sp-5);
  overflow-y: auto;
  font-size: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
.skips::-webkit-scrollbar { width: var(--scroll-size); }
.skips::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: var(--scroll-size); border: 2px solid var(--surface); }
.skips::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.skips::-webkit-scrollbar-track { background: transparent; }
.skips::-webkit-scrollbar-corner { background: transparent; }
.skips b { overflow-wrap: anywhere; }
.skips span { color: var(--muted); }

.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.tpl { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.tpl form:first-child { display: flex; flex: 1; min-width: 0; align-self: stretch; }
.tpl__run {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  min-height: var(--tap);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.tpl__run:hover { border-color: var(--accent-deep); }
.tpl__run svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.tpl__text { display: grid; min-width: 0; line-height: 1.3; }
.tpl__name { font-weight: 600; overflow-wrap: anywhere; }
.tpl__sub { font-size: 13px; color: var(--muted); }
.tpl .icon-btn { color: var(--muted); }

.export-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); align-items: start; gap: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
/* Sticky needs a sheet that does not clip: .sheet clips its rounded corners with overflow. */
.sheet--builder { overflow: visible; }
.builder { display: grid; gap: var(--sp-6); min-width: 0; }
.bf { display: grid; align-content: start; gap: var(--sp-3); min-width: 0; margin: 0; padding: 0; border: 0; }
.bf legend { margin-bottom: var(--sp-2); padding: 0; }
.pill--choice { cursor: pointer; }
.pill--choice:has(input:checked) { background: var(--ink-900); border-color: var(--ink-900); color: var(--on-dark); }
.pill--choice:has(input:focus-visible) { box-shadow: var(--focus); }
.who-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.who-row .add-teacher { width: auto; max-width: 100%; }
.date-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); }
.date-pair .basis select { width: 100%; min-width: 0; }
.date-pair label, .basis { display: grid; gap: var(--sp-1); font-size: 14px; font-weight: 600; color: var(--muted); }
.date-pair input, .basis select { color: var(--text); font-size: 16px; font-weight: 400; }
/* A date field has a wide built-in minimum; without this two of them overflow a phone. */
.date-pair input { width: 100%; min-width: 0; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); }
.filters .basis select { width: 100%; min-width: 0; }
.filter-classes { display: grid; gap: var(--sp-1); }
.pill--grade { min-width: var(--tap); justify-content: center; }
.checks { display: flex; flex-wrap: wrap; gap: 0 var(--sp-5); }
.check { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); font-weight: 500; cursor: pointer; }

.export__sum { position: sticky; top: var(--sp-4); display: grid; gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--r-2); background: var(--ink-900); color: var(--on-dark); }
.export__sum-title { font-family: var(--display); font-weight: 600; font-size: 18px; }
.sum-list { display: grid; gap: var(--sp-3); margin: 0; padding-bottom: var(--sp-4); border-bottom: 1px solid var(--ink-700); }
.sum-list[hidden] { display: none; }
.sum-list div { display: grid; gap: var(--sp-0); min-width: 0; }
.sum-list dt { font-size: 13px; font-weight: 600; color: var(--on-dark-muted); }
.sum-list dd { margin: 0; overflow-wrap: anywhere; }
.export__count { display: grid; gap: var(--sp-1); min-width: 0; }
.export__count b { font-family: var(--display); font-weight: 600; font-size: 17px; }
.export__note { font-size: 14px; color: var(--on-dark-muted); }
.export__count .export__error { color: var(--wait-dark); font-family: var(--body); font-size: 16px; }
.export__sum .acts { display: grid; gap: var(--sp-2); }

.dialog {
  position: fixed;
  inset: 0;
  width: calc(100% - var(--sp-6));
  max-width: 440px;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px -30px var(--shadow-deep);
}
.dialog:not([open]) { display: none; }
.dialog::backdrop { background: var(--overlay); }
.dialog__box { display: grid; gap: var(--sp-4); padding: var(--sp-5); }
.dialog__title { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink-900); }
.dialog__acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.field-error { color: var(--bad-fg); font-size: 14px; font-weight: 600; }

@media (max-width: 900px) {
  .export { padding: var(--sp-4); }
  .export-form { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .export__sum { position: static; padding: var(--sp-4); }
  /* Two dates share a row on a phone; the date kind takes the next row whole, not a stub. */
  .date-pair .basis { grid-column: 1 / -1; }
  .ready__acts .btn { width: 100%; }
}
@media (max-width: 480px) {
  .checks { display: grid; grid-template-columns: minmax(0, 1fr); }
  .dialog__acts .btn { flex: 1 1 120px; }
}

/* ---------- «Потребує уваги адміністратора» (Д6): warnings of /health, sand of «Лідер», not red ---------- */
.attention-strip {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
  /* Lines up with the page content under it: the same gutter as .content and .admin-main. */
  margin: var(--sp-7) var(--sp-7) 0;
  padding: var(--sp-3) var(--sp-5) var(--sp-3) var(--sp-4);
  border-left: 4px solid var(--sand);
  border-radius: var(--r-1);
  background: var(--sand-chip);
  color: var(--on-sand);
  overflow-wrap: anywhere;
}
/* The glow of the dark page starts above the strip, not at the page body: no seam under it. */
.is-admin .main:has(> .attention-strip) { background: var(--admin-backdrop); }
.attention-strip ~ .admin-main { background: none; }
.attention-strip__title { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; color: var(--sand-ink-strong); }
.attention-strip__list { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); font-size: 15px; line-height: 1.45; }
.attention-strip__list li::marker { color: var(--sand-ink); }
@media (max-width: 900px) {
  .attention-strip { margin: var(--sp-4) var(--sp-4) 0; padding: var(--sp-3) var(--sp-4); }
  .attention-strip__list { padding-left: var(--sp-4); font-size: 14px; }
}

/* --- V2-Ф6: settings, roles, change log, sign-in sheets, QR, profile ------------------------ */
.page > .card.card--next { margin-top: var(--sp-5); }
.panels > .stack { align-content: start; }
.search-field--light { margin: var(--sp-4) 0; }
.entered-note { margin-bottom: var(--sp-4); }
.link-list { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.link-list a { display: flex; align-items: center; min-height: var(--tap); font-weight: 600; }
.panel--top { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.choice__text { min-width: 0; overflow-wrap: anywhere; }
.choice input { flex: none; }

.log-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-3) var(--sp-4); align-items: end; margin: var(--sp-4) 0 var(--sp-5); }
.log-filters__go { display: flex; align-items: flex-end; }
.admin-sheet { padding: var(--sp-5); border-radius: var(--r-3); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -30px var(--shadow-deep); }
.error-journal h1 { font-family: var(--display); font-size: 28px; line-height: 1.15; }
.error-list { display: grid; border-top: 1px solid var(--line); }
/* Two filters per row on a phone instead of five full-width ones. */
.error-journal .log-filters { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.error-journal .log-filters input[type=date] { padding-left: var(--sp-3); padding-right: var(--sp-3); }
.error-count { margin: 0 0 var(--sp-3); }
.error-row { display: grid; grid-template-columns: 150px minmax(180px, 2fr) minmax(140px, 1fr) 120px 90px; gap: var(--sp-3); align-items: baseline; padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.error-row:hover { background: var(--row-hover); }
.error-row span, .error-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-detail { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: var(--sp-5) 0; }
.error-detail dt { font-weight: 600; color: var(--muted); }
.error-detail dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.error-detail pre { max-height: 420px; overflow: auto; padding: var(--sp-3); border-radius: var(--r-1); background: var(--surface-2); font: 12px/1.45 ui-monospace, monospace; white-space: pre-wrap; }
.trail { display: grid; gap: var(--sp-2); padding-left: var(--sp-6); }
.error-technical { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.error-technical summary { cursor: pointer; font-weight: 600; }
.error-technical h2 { margin: var(--sp-4) 0 var(--sp-3); font-size: 18px; }
@media (max-width: 700px) { .error-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time state" "text text" "person source"; gap: var(--sp-1) var(--sp-3); } .error-row__time { grid-area: time; } .error-row__state { grid-area: state; } .error-row .error-row__text { grid-area: text; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; } .error-row__person { grid-area: person; } .error-row__source { grid-area: source; color: var(--muted); } .error-row__state { color: var(--muted); justify-self: end; } .error-detail { grid-template-columns: 1fr; gap: var(--sp-1); } .error-detail dt:not(:first-child) { margin-top: var(--sp-3); } }
.log { display: grid; gap: 0; margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.log__line { display: grid; gap: var(--sp-1); padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.log__line:first-child { border-top: 0; }
.log__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.log__what { min-width: 0; overflow-wrap: anywhere; }
.log__when { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log__who, .log__details { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }

.card > h2:first-child { margin-top: 0; }
.access-list { display: grid; gap: var(--sp-3); margin: var(--sp-3) 0 var(--sp-4); padding: 0; list-style: none; }
.access-list li { display: grid; gap: var(--sp-1); }
.access-list p { font-size: 14px; color: var(--muted); }
.entered-by { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); background: var(--sand-chip); color: var(--sand-ink-strong); font-weight: 600; font-size: 14px; }

.qr__modules { stroke: var(--text); }
.qr { display: block; width: 200px; max-width: 100%; height: auto; margin: var(--sp-3) 0; padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--text); }

.signin-sheet { max-width: var(--card-w); margin: var(--sp-4) auto 0; padding: var(--sp-5); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-2); color: var(--text); }
.signin-sheet__brand { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); font-family: var(--display); font-weight: 600; }
.signin-sheet__name { margin: 0 0 var(--sp-4); font-family: var(--display); font-size: 22px; line-height: 1.25; }
.signin-sheet__data { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-4); }
.signin-sheet__data dt { color: var(--muted); }
.signin-sheet__data dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.signin-sheet__password { font-family: var(--mono); font-size: 20px; letter-spacing: .04em; overflow-wrap: anywhere; }
.signin-sheet__steps { margin: 0 0 var(--sp-3); padding-left: var(--sp-5); }
.signin-sheet__note { font-size: 14px; color: var(--muted); }
@media (max-width: 560px) {
  .signin-sheet { padding: var(--sp-4); }
  .signin-sheet__data { grid-template-columns: minmax(0, 1fr); gap: var(--sp-1); }
  .signin-sheet__data dd + dt { margin-top: var(--sp-2); }
}
@media print {
  .sheets-page .sidenav, .sheets-page .bottomnav, .sheets-page .mtop, .sheets-page .admin-top,
  .sheets-page .admin-nav, .sheets-page .attention-strip, .sheets-page .sheets-intro { display: none !important; }
  .sheets-page, .sheets-page .app, .sheets-page .main { display: block; background: var(--surface); }
  .sheets-page .page { padding: 0; }
  @page { margin: 18mm; }
  .sheets-page * { box-shadow: none !important; }
  .signin-sheet { max-width: none; margin: 0; padding: 0; border: 0; break-after: page; page-break-after: always; }
  .signin-sheet:last-of-type { break-after: auto; page-break-after: auto; }
  .signin-sheet__password { font-size: 24px; }
}

/* ---------- Галерея (V2-ГАЛЕРЕЯ): tiles of every uploaded file, a choice, an action ---------- */
.gallery { flex: 1 0 auto; display: grid; align-content: start; gap: var(--sp-5); padding: var(--sp-6) var(--sp-7) var(--sp-7); }
.gallery-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); }
.gallery-head__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); min-width: 0; }
.gallery-head__all[hidden] { display: none; }
.gallery-head h1 { font-family: var(--display); font-weight: 600; font-size: 34px; letter-spacing: -.01em; line-height: 1.1; }
.gallery-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3) var(--sp-4); align-items: end; }
.gallery-filters .field { gap: var(--sp-1); font-size: 14px; }
.gallery-filters select { min-height: var(--tap); padding-top: var(--sp-2); padding-bottom: var(--sp-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-filters__acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: var(--sp-4); }
.gtile { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.gtile:hover { border-color: var(--line-strong); }
.gtile.is-picked { border-color: var(--action); box-shadow: 0 0 0 2px var(--action); }
.gtile__open { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; color: inherit; cursor: zoom-in; border-radius: var(--r-2) var(--r-2) 0 0; }
.gtile__open:focus-visible { box-shadow: inset 0 0 0 3px var(--action); }
.gtile__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(150deg, var(--thumb-a), var(--thumb-b)); }
.gtile__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gtile__plate { display: grid; place-items: center; align-content: center; gap: var(--sp-2); width: 100%; height: 100%; padding: var(--sp-3); background: var(--accent-tint); color: var(--accent-deep); font-size: 14px; font-weight: 600; text-align: center; }
.gtile__plate svg { width: 36px; height: 36px; }
.gtile__plate--wait { background: var(--thumb-wait); color: var(--muted); font-size: 13px; }
.gtile__badge { position: absolute; right: var(--sp-2); bottom: var(--sp-2); display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-0) var(--sp-2); border-radius: var(--r-pill); background: var(--photo-scrim); color: var(--on-action); font-size: 13px; font-weight: 600; line-height: 20px; font-variant-numeric: tabular-nums; }
.gtile__badge svg { width: 12px; height: 12px; }
.gtile__body { display: grid; gap: var(--sp-0); min-width: 0; min-height: var(--tap); padding: var(--sp-2) var(--sp-3) var(--sp-3); color: inherit; text-decoration: none; border-radius: 0 0 var(--r-2) var(--r-2); }
a.gtile__body:hover .gtile__title { color: var(--accent-deep); text-decoration: underline; }
.gtile__body:focus-visible { box-shadow: inset 0 0 0 3px var(--action); }
.gtile__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
}
.gtile__meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
/* The author in full: a long name wraps rather than losing its end (review Д7). */
.gtile__author { min-width: 0; font-size: 13px; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.gtile__role { justify-self: start; max-width: 100%; margin-top: var(--sp-1); padding: var(--sp-0) var(--sp-2); border-radius: var(--r-1); background: var(--accent-tint); color: var(--accent-deep); font-size: 12px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
/* The tick sits on the photo's corner: a 44 px target, a light pad so it reads on any picture. */
.gtile__pick { position: absolute; top: 0; left: 0; z-index: 2; display: grid; place-items: center; width: var(--tap); height: var(--tap); cursor: pointer; }
.gtile__pick::before { content: ""; position: absolute; width: 30px; height: 30px; border-radius: var(--r-1); background: var(--surface); box-shadow: 0 1px 3px var(--shadow-line); }
.gtile__pick input { position: relative; width: 20px; height: 20px; cursor: pointer; }
.gallery-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: var(--sp-2); }
.gallery-bar { width: calc(100% - 2 * var(--sp-7)); max-width: var(--form-w); }
.gallery-bar[hidden] { display: none; }
.gallery-bar__about { display: grid; gap: var(--sp-0); min-width: 0; }
.gallery-bar__count { font-weight: 600; }
.gallery-bar__limit { font-weight: 500; font-size: 13px; color: var(--on-dark-muted); }
.gallery-bar__note { max-width: 52ch; font-size: 13px; color: var(--on-dark-muted); }
.gallery-bar__note[hidden] { display: none; }
.gallery-bar__note--warn { color: var(--sand); font-weight: 600; }
.gallery-bar__count b { font-family: var(--display); color: var(--sand); }
.gallery-bar__btns { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
/* The viewer (after the lyceum site's Lightbox): the picture on a dark field with its own
   blurred copy under it, the counter and «Закрити» on top, arrows at the sides, and below the
   record it came from with the choice and the download. */
.is-viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 20; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; color: var(--on-dark); background: var(--ink-950); }
.viewer[hidden] { display: none; }
.viewer__glow { position: absolute; inset: -40px; z-index: 0; opacity: .35; background: center / cover no-repeat; -webkit-filter: blur(32px); filter: blur(32px); pointer-events: none; }
.viewer__top, .viewer__stage, .viewer__panel, .viewer__nav { position: relative; z-index: 1; }
/* A zoomed photo grows past the stage; the controls and the panel stay above it. */
.viewer__top, .viewer__panel, .viewer__nav { z-index: 2; }
/* Zoom on the left, the counter in the middle, «Закрити» on the right, as on the site. */
.viewer__top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
.viewer__zoom { grid-column: 1; justify-self: start; display: flex; gap: var(--sp-2); }
.viewer__zoom[hidden] { display: none; }
.viewer__top .viewer__counter { grid-column: 2; }
.viewer__top [data-viewer-close] { grid-column: 3; justify-self: end; }
.viewer__icon:disabled { opacity: .35; cursor: default; }
.viewer__icon:disabled:hover { background: var(--photo-scrim); }
.viewer__counter { padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); background: var(--photo-scrim); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viewer__icon { display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--photo-scrim); color: var(--on-dark); cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer__icon:hover { background: var(--ink-700); }
.viewer__icon:focus-visible, .viewer .btn:focus-visible, .viewer__title:focus-visible, .viewer__original:focus-visible { box-shadow: var(--focus-dark); }
.viewer__icon svg { width: 20px; height: 20px; }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer__nav--prev { left: var(--sp-3); }
.viewer__nav--next { right: var(--sp-3); }
.viewer__nav--prev svg { transform: rotate(90deg); }
.viewer__nav--next svg { transform: rotate(-90deg); }
.viewer__stage { display: grid; place-items: center; align-content: center; gap: var(--sp-3); min-height: 0; padding: 0 calc(var(--tap) + var(--sp-5)) var(--sp-4); touch-action: pan-y; }
.viewer__stage img, .viewer__stage video { display: block; max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: var(--r-1); }
/* The zoom takes every gesture on the photo: the page neither scrolls nor zooms nor selects. */
.viewer__zoomable { transform-origin: center; cursor: zoom-in; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.viewer__zoomable.is-zoomed { cursor: grab; will-change: transform; }
.viewer__zoomable.is-zoomed:active { cursor: grabbing; }
.viewer__stage video { width: min(100%, 1200px); background: var(--ink-900); }
/* A PDF in the browser's own viewer (V2-К1): a white sheet as tall as the stage allows. */
.viewer__stage--frame { grid-template-rows: minmax(0, 1fr) auto; }
.viewer__frame { display: block; width: min(100%, 1000px); height: 100%; min-height: 0; border: 0; border-radius: var(--r-1); background: var(--surface); }
.viewer__plate { display: grid; place-items: center; gap: var(--sp-2); width: min(100%, 360px); aspect-ratio: 3 / 4; padding: var(--sp-5); border-radius: var(--r-2); background: var(--accent-tint); color: var(--accent-deep); font-family: var(--display); font-size: 20px; font-weight: 600; text-align: center; }
.viewer__plate-name { font-family: var(--body); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.viewer__original { color: var(--accent-soft); font-weight: 600; text-align: center; }
.viewer__panel { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3) var(--sp-5); padding: var(--sp-4) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom)); background: var(--glass-dark); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer__about { display: grid; gap: var(--sp-1); min-width: 0; flex: 1 1 320px; }
.viewer__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--on-dark); font-family: var(--display); font-size: 17px; font-weight: 600; border-radius: var(--r-1); }
.viewer__meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--on-dark-muted); }
.viewer__caption {
  font-size: 15px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.viewer__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.viewer__chosen { font-weight: 600; white-space: nowrap; }
.viewer__chosen[hidden] { display: none; }
.viewer__chosen b { font-family: var(--display); color: var(--sand); }
.viewer__pick svg { opacity: .35; }
.viewer__pick.is-on { border-color: var(--sand); background: var(--sand); color: var(--on-sand); }
.viewer__pick.is-on svg { opacity: 1; }
@media (max-width: 900px) {
  .viewer__top { display: flex; justify-content: space-between; padding: var(--sp-2) var(--sp-3); }
  /* A phone zooms by pinch and double tap; the top row keeps room for the arrows. */
  .viewer__zoom, .viewer__zoom[hidden] { display: none; }
  .viewer__stage { padding: 0 var(--sp-2) var(--sp-3); }
  /* On a phone the arrows sit in the top row between the counter and «Закрити»: in the middle
     of the picture they covered the video controls. */
  .viewer__nav { top: var(--sp-2); transform: none; }
  .viewer__nav--prev { left: calc(50% - var(--tap) - var(--sp-2)); }
  .viewer__nav--next { right: auto; left: calc(50% + var(--sp-2)); }
  .viewer__panel { padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); gap: var(--sp-3); }
  .viewer__about { flex-basis: 100%; }
  .viewer__acts { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .viewer__acts .btn { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .viewer__chosen { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .gallery { padding: var(--sp-5) var(--sp-4) var(--sp-6); gap: var(--sp-4); }
  .gallery-head h1 { font-size: 26px; }
  .gallery-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
  /* While files are chosen the panel takes the place of the bottom navigation. */
  .gallery-bar { z-index: 7; width: 100%; margin: 0; padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); border-radius: var(--r-2) var(--r-2) 0 0; }
  .is-choosing .bottomnav { display: none; }
  .gallery-bar__btns { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .gallery-bar__btns .btn { padding-left: var(--sp-3); padding-right: var(--sp-3); }
}

/* --- Own account: profile, password, sign-in with a code (ПЕРЕВІРКА-ВЛАСНИКА-1 а) ---------- */
.account { gap: var(--sp-5); }
.account__head { display: grid; gap: var(--sp-2); }
.account__head .crumbs { margin: 0; }
.account__who { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); align-items: baseline; }
.account__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--sp-5); align-items: start; }
.account__wide { grid-column: 1 / -1; }
/* Publication marks (V2-Ф8): the card is a grid, so its alert needs no margin of its own. */
.publication > .alert { margin-bottom: 0; }
.publication-facts { display: grid; gap: var(--sp-2); }
/* Sign-in actions in one row; leaving sits at the far end, apart from the rest. */
.account__signin form:last-child { margin-left: auto; }
@media (max-width: 900px) {
  .account { gap: var(--sp-4); }
  .account__grid { gap: var(--sp-4); }
  .account__signin form:last-child { margin-left: 0; }
}

/* --- The page that explains sign-in with a code (ПЕРЕВІРКА-ВЛАСНИКА-1 в) ------------------- */
.code-needed { display: grid; gap: var(--sp-4); justify-items: start; }
/* The grid gap alone spaces the blocks; the card's own margins between paragraphs would add. */
.code-needed > *, .card.code-needed > p + p, .card.code-needed > p + .actions { margin: 0; }
.code-needed__mark { display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-2); background: var(--sand-chip); color: var(--sand-ink-strong); }
.code-needed__mark svg { width: 22px; height: 22px; }

/* --- Menu groups: personal sections, then «Адміністрування» (ПЕРЕВІРКА-ВЛАСНИКА-1 г) ------- */
.nav-group { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--ink-700); }
.nav-group__title { padding: 0 var(--sp-3); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-faint); }
.nav-group__hint { padding: 0 var(--sp-3); font-size: 13px; color: var(--sand); }
.nav-group__hint:hover { color: var(--on-dark); }
.nav-link__text { flex: 1 1 auto; min-width: 0; }
.nav-lock { width: var(--icon-sm); height: var(--icon-sm); flex: none; color: var(--sand); }
.nav-link .nav-lock { width: 16px; height: 16px; }
/* Seven administration rows fit a laptop screen together with the personal ones. */
.nav-group .nav-link { padding-block: var(--sp-2); }
.account__admin { display: none; }
.admin-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-2); margin: var(--sp-3) 0 0; padding: 0; list-style: none; }
.admin-links a { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-1); color: var(--text); font-weight: 600; text-decoration: none; }
.admin-links a:hover { border-color: var(--text); }
.admin-links svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.admin-links span { flex: 1 1 auto; min-width: 0; }
.admin-links .nav-lock { color: var(--sand-ink); }
@media (max-width: 900px) {
  .account__admin { display: block; }
}

/* --- «Повідомити про проблему» page and its attachments (ПЕРЕВІРКА-ВЛАСНИКА-1 ґ) ---------- */
.problem-link, .me__link { display: flex; align-items: center; gap: var(--sp-2); min-height: 36px; margin-inline: calc(-1 * var(--sp-2)); padding: 0 var(--sp-2); border-radius: var(--r-1); color: var(--on-dark-muted); font-size: 13px; white-space: nowrap; text-decoration: none; }
.problem-link svg, .me__link svg { width: var(--icon-sm); height: var(--icon-sm); flex: none; }
.problem-link:hover, .me__link:hover { color: var(--on-dark); background: var(--ink-800); }
/* The current page is marked like any other menu item: a plate and the sand edge, same weight. */
.problem-link[aria-current="page"], .me__link[aria-current="page"] { color: var(--on-dark); background: var(--ink-800); box-shadow: inset 3px 0 0 var(--sand); }
.problem-link:focus-visible, .me__link:focus-visible { box-shadow: var(--focus-dark); }
.report-form { display: grid; gap: var(--sp-4); }
.report-form textarea { min-height: 200px; resize: vertical; }
.report-drop { display: grid; gap: var(--sp-2); justify-items: start; padding: var(--sp-4); border: 1px dashed var(--line-strong); border-radius: var(--r-2); background: var(--surface-2); }
.report-drop label.btn { cursor: pointer; }
.report-drop input:focus-visible + .field-hint, .report-drop:focus-within label.btn { box-shadow: var(--focus); }
.report-files { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.report-files:empty { display: none; }
.report-files li { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding-left: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-1); }
.report-files__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.report-files__size { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.report-sent { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-right: var(--sp-2); position: fixed; left: var(--sp-4); right: var(--sp-4); top: calc(var(--sp-4) + env(safe-area-inset-top)); z-index: 7; max-width: 560px; margin-inline: auto; border: 1px solid var(--ok-fg); box-shadow: 0 var(--sp-1) var(--sp-4) var(--shadow-line); }
.report-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); }
.report-cta h2 { margin: 0 0 var(--sp-1); font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; }
.attachment-links { display: grid; gap: 0; margin: 0 0 var(--sp-2); padding: 0; list-style: none; }
.attachment-links a { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); max-width: 100%; font-weight: 600; text-decoration: none; }
.attachment-links a span { text-decoration: underline; }
.attachment-links svg { width: var(--icon-sm); height: var(--icon-sm); flex: none; }
.attachment-links span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-links small { flex: none; color: var(--muted); font-weight: 400; }
.error-detail__text { white-space: pre-line; }
.phone-account { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.phone-account__report { color: var(--on-dark-muted); }
.phone-account__report:hover { color: var(--on-dark); background: var(--ink-800); }
.phone-account__report svg { width: 20px; height: 20px; }
.phone-account__report:focus-visible { box-shadow: var(--focus-dark); }
/* Personal and administration rows, the account and leaving fit a 900px tall laptop screen
   without scrolling the side panel (ПЕРЕВІРКА-ВЛАСНИКА-1 г). */
.sidenav:has(.nav-group) { gap: var(--sp-5); }
.sidenav:has(.nav-group) .nav-link { padding-block: var(--sp-2-5); }
.sidenav:has(.nav-group) .nav-group .nav-link { padding-block: var(--sp-2); }
.sidenav:has(.nav-group) .me { gap: var(--sp-2); }

/* Administration marks (V2-Ф4): the form, the month list, the panel column and the teacher's rows. */
.tag--wait { background: var(--wait-bg); color: var(--wait-fg); }
.marks-month { display: flex; gap: var(--sp-2); }
.marks-month select { width: auto; min-width: 200px; }
.marks-form { margin-top: var(--sp-4); }
.marks-form__row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--sp-4); }
.segmented { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.segmented__item { position: relative; display: inline-flex; }
.segmented__item input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.segmented__item span {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-weight: 600;
  font-size: 15px;
}
.segmented__item input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-ring); }
.segmented__item--done input:checked + span { border-color: var(--ok-fg); background: var(--ok-bg); color: var(--ok-fg); }
.segmented__item--partial input:checked + span { border-color: var(--wait-fg); background: var(--wait-bg); color: var(--wait-fg); }
.segmented__item--not_done input:checked + span { border-color: var(--bad-fg); background: var(--bad-bg); color: var(--bad-fg); }
.marks-people__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-4); }
.marks-people__tools { display: flex; gap: var(--sp-4); font-size: 14px; }
.marks-people__tools .link-btn { padding: 0; border: 0; background: none; cursor: pointer; }
.marks-people__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 var(--sp-4); margin: 0; padding: var(--sp-2) var(--sp-3); list-style: none; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); }
.marks-people__list .choice { min-height: var(--tap); min-width: 0; }
.marks-people__list .choice span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-row { gap: var(--sp-1); }
.mark-row__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-1) var(--sp-3); }
.mark-row__reason { overflow-wrap: anywhere; }
.mark-row.is-withdrawn .mark-row__reason { color: var(--muted); text-decoration: line-through; }
.mark-row__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-3); }
.mark-row__foot .person__meta { flex: 1 1 auto; }
.mark-row__withdraw[open] { flex-basis: 100%; }
.mark-row__withdraw summary { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent-deep); font-weight: 600; font-size: 14px; cursor: pointer; }
.mark-row__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2); max-width: 560px; }
.mt__marks { width: 240px; }
.mt-marks { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; line-height: 1.4; overflow-wrap: anywhere; }
.mt-marks small { display: block; color: var(--muted); }
.dirs__marks { display: grid; gap: var(--sp-1); margin: var(--sp-1) 0 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.dirs__by { display: block; color: var(--muted); font-size: 14px; }
/* Marks of earlier months on the teacher's home: the same list, padded like a direction row. */
.dirs__marks--earlier { gap: var(--sp-3); margin: 0; padding: var(--sp-3) var(--sp-5); }
@media (max-width: 560px) {
  .marks-form__row { grid-template-columns: 1fr; }
  .marks-month, .marks-month select { width: 100%; }
  .mark-row__form { grid-template-columns: 1fr; }
}
