/* One stylesheet, no framework.
 *
 * The readers are parents on phones, half of them on an old Android, and
 * the person maintaining this is a volunteer who will come back to it in a
 * year. A framework would be 40 KB and a build step for a site of twenty
 * pages, so: custom properties, two breakpoints, and system fonts.
 *
 * The look (10 November 2026): white surfaces lifted off a tinted page by a
 * soft shadow rather than boxed in by lines, rounder corners, a header that
 * stays at the top, and the menu as tabs. Same markup and class names as
 * before; nothing here changes what a page does.
 *
 * Light or dark follows the device, unless the reader chose one with the
 * buttons in the footer (zadanie 9.11): then <html data-theme> says which,
 * written by the server so the page never flashes the other one. */

:root {
  --ink: #0f172a;
  --ink-soft: #5f6b7d;
  --paper: #ffffff;
  --page: #f3f5f9;
  --page-glow: radial-gradient(circle at 15% 10%, #f7f7f7 10%, #d1d5e41f 35%), linear-gradient(135deg, #fff 0%, #e0e3e8 55%, #fff 100%);
  --line: #e3e7ee;
  --line-strong: #cfd6e1;
  --accent: #2552c4;
  --accent-hover: #1d44a8;
  --accent-soft: #eaf0fd;
  --accent-ink: #ffffff;
  --warn: #b45309;
  --warn-bg: #fff6e8;
  --ok: #15803d;
  --ok-bg: #eaf8ef;
  --alert: #e5484d;
  --danger: #c62f35;
  --danger-hover: #a8242a;
  --danger-ink: #ffffff;
  --radius: 12px;
  --radius-lg: 16px;
  --gap: 1rem;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .05);
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 14px rgb(15 23 42 / .06);
  --shadow-lg: 0 10px 30px rgb(15 23 42 / .14);
  --ring: 0 0 0 3px rgb(37 82 196 / .25);
  --measure: 60rem;
  --card-border: var(--line);
  /* The account icon by the name in the header. A data: image cannot read a
   * custom property, so each theme carries its own stroke colour. */
  --icon-account: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232552c4' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='9' r='3.5'/%3E%3Cpath d='M5.5 19c1.2-3 3.8-4.5 6.5-4.5s5.3 1.5 6.5 4.5'/%3E%3C/svg%3E");
  --icon-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
  /* System fonts. A webfont with Cyrillic is 60 KB before anything is
   * read, and every phone in the country already has one that is right. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf5;
    --ink-soft: #97a3b6;
    --paper: #141b26;
    --page: #0b1018;
  --page-glow: radial-gradient(circle at 15% 10%, #1025d4 0%, #552c1400 35%), linear-gradient(135deg, #040b17 0%, #122751 55%, #4f210f 100%);
    --line: #232d3b;
    --line-strong: #334155;
    --accent: #7ea6ff;
    --accent-hover: #a3c0ff;
    --accent-soft: #19243d;
    --accent-ink: #0b1020;
    --warn: #f0b46e;
    --warn-bg: #2a2015;
    --ok: #6fd39a;
    --ok-bg: #12261b;
    --alert: #ff6b6f;
    --danger: #ff6b6f;
    --danger-hover: #ff8a8d;
    --danger-ink: #1a0607;
    --shadow-sm: none;
    --shadow: 0 0 0 1px var(--line);
    --shadow-lg: 0 10px 30px rgb(0 0 0 / .5);
    --ring: 0 0 0 3px rgb(126 166 255 / .35);
    --card-border: transparent;
    --icon-account: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237ea6ff' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='9' r='3.5'/%3E%3Cpath d='M5.5 19c1.2-3 3.8-4.5 6.5-4.5s5.3 1.5 6.5 4.5'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e8edf5;
  --ink-soft: #97a3b6;
  --paper: #141b26;
  --page: #0b1018;
  --page-glow: radial-gradient(circle at 15% 10%, #1025d4 0%, #552c1400 35%), linear-gradient(135deg, #040b17 0%, #122751 55%, #4f210f 100%);
  --line: #232d3b;
  --line-strong: #334155;
  --accent: #7ea6ff;
  --accent-hover: #a3c0ff;
  --accent-soft: #19243d;
  --accent-ink: #0b1020;
  --warn: #f0b46e;
  --warn-bg: #2a2015;
  --ok: #6fd39a;
  --ok-bg: #12261b;
  --alert: #ff6b6f;
  --danger: #ff6b6f;
  --danger-hover: #ff8a8d;
  --danger-ink: #1a0607;
  --shadow-sm: none;
  --shadow: 0 0 0 1px var(--line);
  --shadow-lg: 0 10px 30px rgb(0 0 0 / .5);
  --ring: 0 0 0 3px rgb(126 166 255 / .35);
  --card-border: transparent;
  --icon-account: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237ea6ff' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='9' r='3.5'/%3E%3Cpath d='M5.5 19c1.2-3 3.8-4.5 6.5-4.5s5.3 1.5 6.5 4.5'/%3E%3C/svg%3E");
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 1rem/1.6 var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* A soft glow of the brand colours behind everything, light and dark alike.
 * On a fixed layer, not background-attachment: fixed, which iOS ignores and
 * which repaints on every scroll; the cards stay plain on top of it. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--page-glow, var(--page)); pointer-events: none; }

/* A 16px gutter at phone width, and a measure that stops at something
 * readable on a laptop -- a line of 140 characters is a line nobody
 * finishes. The header and footer run the full width; only their content
 * keeps to the measure. */
main { max-width: var(--measure); margin: 0 auto; padding: 0 1rem 3rem; }
/* The footer at the foot of the screen when a page is short, and after the
 * content as before when it is long: the page is a column at least as tall
 * as the screen, and main takes the room that is left. In a flex column a
 * block with auto margins shrinks to its content, so main and the flash
 * messages are told their width. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; }
.flash { width: 100%; }
.top, .bottom { padding-left: max(1rem, calc((100% - var(--measure)) / 2 + 1rem)); padding-right: max(1rem, calc((100% - var(--measure)) / 2 + 1rem)); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; }
h1 { font-size: 1.65rem; line-height: 1.2; font-weight: 750; margin: 1.75rem 0 1rem; letter-spacing: -.025em; }
h2 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; margin: 1.75rem 0 .6rem; }
h3 { font-size: 1.05rem; line-height: 1.35; font-weight: 650; margin: 1rem 0 .3rem; }
h2 a, h3 a { color: inherit; text-decoration: none; }
h2 a:hover, h3 a:hover { color: var(--accent); }
p { margin: .5rem 0; }

/* Skip link: visible only when it has focus, which is the one time it is
 * useful and the one time it must not be hidden. */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--paper); padding: .5rem .75rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 50; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---- Header -------------------------------------------------------------
 * The board's name on the first line and the menu as a row of tabs under
 * it. It stays at the top while the page scrolls, on a frosted background
 * where the browser can do that. */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--gap);
  padding-top: .7rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
@supports not (background: color-mix(in srgb, red, blue)) { .top { background: var(--paper); } }
.top .brand {
  display: flex; align-items: center; gap: .65rem; min-height: 44px;
  font-weight: 700; letter-spacing: -.01em; line-height: 1.25;
  text-decoration: none; color: var(--ink);
}
.top .brand img { height: 2.25rem; width: auto; border-radius: 8px; }
.top .brand .mark {
  flex: none; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6d4fd8);
  color: #fff; box-shadow: 0 4px 12px rgb(37 82 196 / .3);
}
.top .brand .mark svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* One line on any screen wider than a phone (10 Nov 2026, the user: "not
 * on two lines, and the header the full width"): the logo and short name,
 * the places, then the admin and the account at the right. The header
 * spans the window; the page under it keeps its 60rem measure. */
.top { flex-wrap: nowrap; gap: .25rem; min-height: 3.75rem; padding-top: .5rem; padding-bottom: .5rem; }
@media (min-width: 40.01rem) {
  /* The footer as wide as the header, so its one line has room. */
  .top, .bottom { padding-left: clamp(1.5rem, 2vw, 2rem); padding-right: clamp(1.5rem, 2vw, 2rem); }
}
.top .brand { flex: none; margin-right: .75rem; white-space: nowrap; }
.top .brand .name-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top .brand .name-short { font-size: 1.05rem; }
.top nav.wide { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.top .drop > summary {
  flex: none; display: inline-flex; align-items: center; gap: .35rem;
  min-height: 40px; padding: 0 .7rem; border-radius: 10px;
  font-size: .95rem; font-weight: 500; color: var(--ink-soft);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.top .drop > summary:hover { background: var(--page); color: var(--ink); text-decoration: none; }

/* The places to read (documents, the assembly, the cash book) are in the
 * footer since 16 November 2026; the header keeps the icons for what a
 * person opens every day and the account, so it no longer runs out of room.
 * On a tablet (40-64rem) the admin and the account keep only their icons
 * (the words stay for screen readers). */
@media (max-width: 63.99rem) {
  .top nav.wide > a.button { padding: 0 .85rem; }
  .top nav.wide > a.to-admin { padding: 0; width: 40px; min-height: 40px; justify-content: center; }
  .top nav.wide > a.to-admin > span, .top .account > summary > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
/* Signed out on a small tablet, the two buttons need the room the short
 * name takes; the logo stays, and its link still says the full name. */
@media (max-width: 52rem) { .top:has(nav.wide > a.button) .brand .name-short { display: none; } }

/* The account's drop-down. A <details>, so they open
 * without JavaScript; menu.js closes them on a click elsewhere or Escape. */
.top .drop { position: relative; flex: none; }
.top .drop > summary { list-style: none; }
.top .drop > summary::-webkit-details-marker { display: none; }
.top .drop > summary::after {
  content: ""; width: .45rem; height: .45rem; margin: -.2rem 0 0 .1rem;
  border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg);
  transition: transform .15s;
}
.top .drop[open] > summary { background: var(--page); color: var(--ink); }
.top .drop[open] > summary::after { transform: rotate(-135deg); margin-top: .2rem; }
.top .drop > summary:focus-visible { outline: 0; box-shadow: var(--ring); }
.top .drop .menu {
  position: absolute; z-index: 35; top: calc(100% + .4rem); right: 0;
  min-width: 13rem; padding: .35rem; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.top .drop .menu > a, .top .drop .menu button.link {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 .75rem; margin: 0;
  border-radius: 8px; color: var(--ink); font-size: .95rem; font-weight: 500; text-decoration: none; text-align: left;
}
.top .drop .menu > a:hover, .top .drop .menu button.link:hover { background: var(--page); color: var(--ink); text-decoration: none; }
.top .drop .menu .badge { margin-left: .4rem; }
.top .drop .menu > a[aria-current] { color: var(--accent); font-weight: 650; background: var(--accent-soft); }
.top .drop .menu > form { margin: .25rem 0 0; padding-top: .25rem; border-top: 1px solid var(--line); }

/* The icons at the right (signed in): home, groups, the bell -- each with
 * its unread count on its shoulder, like the phone's tab bar. */
.top nav.wide > a.iconlink {
  position: relative; flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px; color: var(--ink-soft);
  transition: background-color .15s, color .15s;
}
.top nav.wide > a.iconlink svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top nav.wide > a.iconlink:hover { background: var(--page); color: var(--ink); }
.top nav.wide > a.iconlink[aria-current] { background: var(--accent-soft); color: var(--accent); }
.top nav.wide > a.iconlink:focus-visible { outline: 0; box-shadow: var(--ring); }
.top nav.wide > a.iconlink .badge { position: absolute; top: 3px; right: 1px; box-shadow: 0 0 0 2px var(--paper); }

/* The account: a round icon and the first name. */
.top .account > summary { color: var(--ink); font-weight: 600; padding-left: .35rem; }
.top .account > summary::before {
  content: ""; width: 1.75rem; height: 1.75rem; border-radius: 999px; flex: none;
  background: var(--accent-soft) var(--icon-account) center / 1.15rem no-repeat;
}
.top .account > summary.here { background: var(--accent-soft); }
/* Requests waiting for the reader's approval (14.10): a dot on the account
 * icon, since the count itself is inside the menu. */
.top .account > summary.waiting {
  background-image: radial-gradient(circle, var(--alert) 0 3.5px, var(--paper) 3.6px 5px, transparent 5.1px);
  background-repeat: no-repeat; background-position: 1.75rem .3rem; background-size: 10px 10px;
}
.top .drop .menu .badge { margin-left: .4rem; }
.tabbar .sheet .badge { position: static; transform: none; margin-left: .5rem; box-shadow: none; }
.top .drop .menu > a { white-space: nowrap; }
/* The same on the phone's "More", where the requests are listed. */
.tabbar .more:has(.sheet .badge) > summary { position: relative; }
.tabbar .more:has(.sheet .badge) > summary::after {
  content: ""; position: absolute; top: .35rem; left: calc(50% + .45rem);
  width: 9px; height: 9px; border-radius: 999px; background: var(--alert); box-shadow: 0 0 0 2px var(--paper);
}

/* The way into the admin, for the board only. A tool, not a place a parent
 * goes: smaller and quieter than the tabs, next to the account. The gear
 * is a mask, so it takes the text colour on light and dark alike. */
.top nav.wide > a.to-admin {
  flex: none; display: inline-flex; align-items: center; gap: .3rem;
  min-height: 36px; padding: 0 .65rem; white-space: nowrap; text-decoration: none;
  font-size: .85rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px;
}
.top nav.wide > a.to-admin::before {
  content: ""; width: 1rem; height: 1rem; flex: none; background: currentColor;
  -webkit-mask: var(--icon-gear) center / contain no-repeat; mask: var(--icon-gear) center / contain no-repeat;
}
.top nav.wide > a.to-admin:hover { border-color: var(--line-strong); color: var(--ink); }
.top nav.wide > a.button { flex: none; min-height: 40px; padding: 0 1.1rem; color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
.top nav.wide > a.button:hover { background: var(--accent-hover); color: var(--accent-ink); }
.top nav.wide > a.button.secondary { color: var(--accent); }
.top nav.wide > a.button.secondary:hover { background: var(--accent-soft); color: var(--accent); }
.top nav.wide > a.button + a.button { margin-left: .25rem; }
.top .narrow-only { display: none; }
/* On a phone, Register is a link next to the Sign in button. */
.top a.to-register { align-items: center; min-height: 44px; padding: 0 .35rem; font-size: .92rem; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* The phone menu (zadanie 9.3). Under 40rem the header shrinks to one line
 * with the board's name, and the places a parent goes sit at the bottom of
 * the screen, where the thumb already is. 193px of an 812px screen was menu
 * before this. */
.tabbar { display: none; }

@media (max-width: 40rem) {
  .top { flex-wrap: nowrap; gap: .5rem; padding-top: .45rem; padding-bottom: .45rem; min-height: 3.5rem; }
  .top .brand { min-width: 0; flex: 1; font-size: .95rem; }
  .top .brand .name-short { display: none; }
  .top .brand .name-full { position: static; width: auto; height: auto; clip-path: none; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .top .brand img, .top .brand .mark { height: 2rem; width: 2rem; }
  .top nav.wide, .top::after { display: none; }
  .top .brand { margin-right: 0; }
  .top .narrow-only { display: inline-flex; flex: none; }

  /* Room for the bar under the last line of the page, and for the home
   * indicator on a phone without a button. */
  body { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }

  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-top: 1px solid var(--line);
    padding: .25rem .25rem env(safe-area-inset-bottom);
  }
  .tabbar > a, .tabbar summary {
    position: relative;
    flex: 1; min-height: 3.5rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    color: var(--ink-soft); text-decoration: none;
    font-size: .72rem; font-weight: 500; line-height: 1.2;
    cursor: pointer; list-style: none;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar summary::-webkit-details-marker { display: none; }
  .tabbar details { flex: 1; display: flex; }
  .tabbar svg {
    width: 2.75rem; height: 1.75rem; padding: .2rem .65rem; border-radius: 999px;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
    transition: background-color .15s;
  }
  .tabbar .more svg { fill: currentColor; stroke: none; }
  .tabbar [aria-current] { color: var(--accent); font-weight: 650; }
  .tabbar [aria-current] svg { background: var(--accent-soft); }
  .tabbar .badge { position: absolute; top: .2rem; left: calc(50% + .5rem); }

  /* "More" opens upwards, over the page, as a sheet with rounded corners. */
  .tabbar .sheet {
    position: fixed; left: .5rem; right: .5rem;
    bottom: calc(4rem + env(safe-area-inset-bottom));
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: .35rem;
  }
  .tabbar .sheet a, .tabbar .sheet button.link {
    display: flex; align-items: center; width: 100%;
    min-height: 48px; padding: 0 1rem; border-radius: 10px;
    text-decoration: none; color: var(--ink); font-weight: 500; text-align: left;
  }
  .tabbar .sheet a:active, .tabbar .sheet button.link:active { background: var(--page); }
  .tabbar .sheet form { margin: .25rem 0 0; padding-top: .25rem; border-top: 1px solid var(--line); }
  .tabbar .sheet button.link { color: var(--ink-soft); }
}

/* ---- Pieces ------------------------------------------------------------ */

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem;
  background: var(--alert); color: #fff;
  border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1;
  vertical-align: middle;
}

.card {
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  margin: var(--gap) 0;
}
article.card { transition: box-shadow .2s, transform .2s; }
article.card:has(h2 a:hover, h3 a:hover) { box-shadow: var(--shadow-lg); }
.card.urgent {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: linear-gradient(180deg, var(--warn-bg), var(--paper) 140%);
  box-shadow: inset 4px 0 0 var(--warn), var(--shadow);
}
/* A card's own heading starts at its top edge, not 1.75rem below it. */
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.narrow { max-width: 28rem; }
form.card.narrow { margin-left: auto; margin-right: auto; margin-top: 2rem; padding: 1.5rem; }

.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / .12), inset 0 1px 0 rgb(255 255 255 / .12);
  transition: background-color .15s, transform .05s, box-shadow .15s;
}
.button:hover, button.button:hover { background: var(--accent-hover); color: var(--accent-ink); }
.button:active, button.button:active { transform: translateY(1px); }
.button:focus-visible { outline: 0; box-shadow: var(--ring); }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; min-height: 44px; }
button.link:hover { text-decoration: underline; text-underline-offset: .2em; }
form.inline { display: inline; }
.addlink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }

input, textarea, select {
  width: 100%; padding: .65rem .8rem; font: inherit;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover, select:hover { border-color: var(--ink-soft); }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: var(--ring); }
/* 16px minimum, because anything smaller makes iOS zoom the page when a
 * field is focused and leaves it zoomed. */
input, textarea { font-size: max(1rem, 16px); }
label { display: block; margin-top: 1rem; margin-bottom: .3rem; font-weight: 600; font-size: .92rem; }
label input[type="checkbox"] { width: auto; margin-right: .4rem; }
/* A checkbox is 13px by default: the whole line is what gets tapped, so the
 * line is the 44px target (zadanie 9.4), and the box itself is visible. */
label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin-top: 0; font-weight: 400; font-size: 1rem; }
label > input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--accent); box-shadow: none; }
input[type="file"] { min-height: 44px; padding: .35rem; }
input[type="file"]::file-selector-button {
  min-height: 2.25rem; margin-right: .6rem; padding: 0 .9rem;
  font: inherit; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border: 0; border-radius: calc(var(--radius) - 3px); cursor: pointer;
}
form .button[type="submit"], form button.button { margin-top: 1rem; }
form.inline .button, .choices .button, form.write .button[type="submit"], td .button, .save .button { margin-top: 0; }
.errorlist { list-style: none; padding: 0; margin: .3rem 0 0; color: var(--alert); font-size: .9rem; }
.helptext { display: block; color: var(--ink-soft); font-size: .85rem; margin-top: .25rem; }

.flash { list-style: none; padding: 0 1rem; margin: var(--gap) auto 0; max-width: var(--measure); display: grid; gap: .5rem; }
.flash li {
  padding: .75rem 1rem; border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.flash .error { border-color: var(--alert); }
.flash .warning { border-color: var(--warn); background: var(--warn-bg); }
.flash .success { border-color: var(--ok); background: var(--ok-bg); }

.meta, .muted, small { color: var(--ink-soft); }
.meta { font-size: .88rem; margin: 0 0 .5rem; }
.total { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }

.rows { list-style: none; padding: 0; margin: 0; width: 100%; }
.rows li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.rows li:first-child { padding-top: .25rem; }
.rows li:last-child { border-bottom: 0; padding-bottom: .25rem; }
.rows li > a:first-child { font-weight: 600; text-decoration: none; }
.rows li > a:first-child:hover { text-decoration: underline; }
.rows li > small { display: block; }
.people { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.people li { padding: .2rem 0; break-inside: avoid; }

/* The bank details on the payment page (zadanie 9.5): each value with its
 * copy button on the same line, the button where the thumb is. */
dl.transfer { margin: 0; }
dl.transfer dt { color: var(--ink-soft); font-size: .85rem; font-weight: 500; margin-top: .9rem; }
dl.transfer dt:first-child { margin-top: 0; }
dl.transfer dd {
  margin: .25rem 0 0; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .5rem .5rem .5rem .85rem; background: var(--page); border-radius: var(--radius);
}
dl.transfer dd > :first-child { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
dl.transfer code { font-size: 1.05rem; font-weight: 600; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .95em; }
button.copy {
  min-height: 40px; padding: 0 .9rem; flex: none;
  font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
  color: var(--accent); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 10px;
}
button.copy:hover { border-color: var(--accent); }
button.copy.done { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }

/* What is owed, on the home page (zadanie 9.7): description, amount and date
 * one under the other, the button beside them on a wide screen and across
 * the whole card on a phone. */
.charges li { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; align-items: center; }
.charges .what { grid-column: 1; font-weight: 500; }
.charges .sum { grid-column: 1; font-weight: 750; font-size: 1.35rem; letter-spacing: -.01em; }
.charges small { grid-column: 1; }
.charges .button { grid-column: 2; grid-row: 1 / span 3; }
@media (max-width: 40rem) {
  .charges li { grid-template-columns: 1fr; }
  .charges .button { grid-column: 1; grid-row: auto; width: 100%; margin-top: .6rem; padding: .75rem; }
}

table.rows { border-collapse: separate; border-spacing: 0; width: 100%; }
table.rows th, table.rows td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rows th { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom-color: var(--line-strong); }
table.rows tbody tr { transition: background-color .1s; }
table.rows tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
table.rows tr:last-child td { border-bottom: 0; }
/* Amounts never break across lines; a reference may, because a 30-character
 * code would otherwise widen the whole table. */
table.rows .num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
table.rows code { overflow-wrap: anywhere; }
/* A table sits on a card of its own when it is not already inside one. */
main > table.rows, main > section > table.rows, main > form > table.rows {
  background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; margin: var(--gap) 0;
}
main > table.rows th:first-child, main > table.rows td:first-child,
main > section > table.rows th:first-child, main > section > table.rows td:first-child,
main > form > table.rows th:first-child, main > form > table.rows td:first-child { padding-left: 1.1rem; }
main > table.rows th:last-child, main > table.rows td:last-child,
main > section > table.rows th:last-child, main > section > table.rows td:last-child,
main > form > table.rows th:last-child, main > form > table.rows td:last-child { padding-right: 1.1rem; }

/* At phone width a table with more than two columns becomes a stack of
 * cards: one row, one card, each cell on its own line with its column name
 * in front (from data-label, because the header row is hidden). A table
 * that scrolls sideways hides its last column, and on "My payments" the
 * last column is the pay button -- the one thing the parent came to press.
 * Two-column tables (the annual report) fit as they are and stay tables. */
@media (max-width: 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  main > table.stack, main > section > table.stack, main > form > table.stack { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack tr {
    background: var(--paper);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: .75rem 1rem; margin: 0 0 .75rem;
  }
  table.stack tbody tr:hover { background: var(--paper); }
  main table.stack td, main table.stack td:first-child, main table.stack td:last-child { border: 0; padding: .15rem 0; }
  table.stack td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--ink-soft); font-size: .85rem;
  }
  table.stack td:empty { display: none; }
  /* An empty table is one dashed note, not a note inside a card. */
  table.stack tr:has(> td.empty) { border: 0; padding: 0; background: none; box-shadow: none; }
  table.stack .num { text-align: left; }
  /* The action is the reason the row is there: make it a full-width,
   * thumb-sized button rather than a word at the end of a line. */
  main table.stack td.act { padding-top: .6rem; }
  table.stack td.act .button { display: flex; width: 100%; text-align: center; padding: .75rem; }
}

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: var(--gap) 0; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-weight: 500; font-size: .92rem; text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.tabs a:hover { border-color: var(--accent); color: var(--accent); }
.tabs a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tabs-label { flex-basis: 100%; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }

/* The three figures at the top of the annual report, and the small
   print under it. */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: var(--gap) 0; padding: 0; }
.summary div { min-width: 0; padding: 1rem 1.1rem; background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.summary dt { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.summary dd { margin: .3rem 0 0; font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary dd.good { color: var(--ok); }
.summary dd.bad { color: var(--warn); }
/* "When" and "Where" are words, not one figure. */
.summary.facts dd { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
.note { font-size: .85rem; color: var(--ink-soft); }
/* A difference with the bank that nobody has explained is the one line of
   the report the board has to act on, so it is not small print. */
.rows .bad { color: var(--warn); }
.note.warn, .inapp-note {
  padding: .75rem 1rem; background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius); color: var(--ink); font-size: .9rem;
}
.inapp-note { margin: var(--gap) 0 0; }

/* The two report downloads, each with its file type inside. */
.downloads { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 40rem) {
  .downloads .button { flex: 1 1 100%; justify-content: center; text-align: center; }
}
.button small.kind { color: inherit; border-color: currentColor; opacity: .85; }

/* "PDF" after a link to one, so a tap that opens a file is no surprise. */
.rows a[type="application/pdf"] { white-space: nowrap; }
small.kind {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: .05rem .35rem; border: 1px solid var(--line-strong); border-radius: 5px;
  color: var(--ink-soft); vertical-align: middle;
}

/* An empty list says why it is empty and what happens next (zadanie 9.10).
 * Set apart from content by a dashed edge, so it does not read as an entry. */
.empty, li.empty, table.rows td.empty {
  color: var(--ink-soft); text-align: center;
  padding: 1.5rem 1rem; margin: var(--gap) 0;
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg);
}
li.empty, td.empty { list-style: none; }
.empty a { overflow-wrap: anywhere; }

.bar { height: .6rem; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #a3e635)); border-radius: 999px; }

/* ---- The conversation (zadanie 9.8) -------------------------------------
 * Messages as bubbles: the reader's own on the right in the accent colour,
 * everyone else's on the left. On a phone the list is part of the page and
 * the page is the one thing that scrolls; on a wide screen the list keeps
 * its own scroll, so the members and the rest of the group stay in view. */
.messages {
  list-style: none; margin: 0; padding: .75rem;
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.messages li {
  max-width: 85%; align-self: flex-start;
  padding: .55rem .85rem; border-radius: 16px 16px 16px 6px;
  background: var(--page);
}
.messages li.mine {
  align-self: flex-end; border-radius: 16px 16px 6px 16px;
  background: var(--accent-soft);
}
.messages li:only-child:has(.empty), .messages li.empty { max-width: none; align-self: stretch; background: none; }
.messages p { margin: .15rem 0; overflow-wrap: anywhere; }
.messages time { font-size: .75rem; color: var(--ink-soft); }
.messages b, .messages strong { font-size: .85rem; }
.pinned {
  margin: 0 0 var(--gap); padding: .8rem 1rem;
  background: var(--warn-bg); border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.write { margin-top: .75rem; display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; }
.write textarea { grid-column: 1 / -1; resize: vertical; border-radius: 14px; }

/* The file input stays in the page, only out of sight, inside its label: a
 * tap on the label opens the picker with or without JavaScript. */
.attach {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; margin: 0; padding: 0 .85rem; max-width: 100%; justify-self: start;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--accent); font-weight: 500; font-size: .95rem; cursor: pointer;
}
.attach:hover { border-color: var(--accent); }
.attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.attach:focus-within { box-shadow: var(--ring); }
.attach svg { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.attach span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attach.chosen { color: var(--ink); border-color: var(--accent); }

@media (max-width: 40rem) {
  /* Writing stays at hand while reading: the box sits on top of the tab
   * bar for as long as the conversation is on screen. */
  .write {
    position: sticky; bottom: calc(4rem + env(safe-area-inset-bottom)); z-index: 5;
    margin: 0 -1rem; padding: .5rem 1rem;
    background: color-mix(in srgb, var(--page) 92%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
  }
  .write textarea { min-height: 2.9rem; }
  .messages li { max-width: 92%; }
}

.prose { font-size: 1.03rem; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .45rem .65rem; }
.prose blockquote { margin: 1rem 0; padding: .25rem 1rem; border-left: 3px solid var(--accent); color: var(--ink-soft); }

/* ---- Footer ------------------------------------------------------------ */
/* One line: the board's name at the left, the links after it, spaced
 * evenly with a dot between; on a narrow screen the links wrap as a
 * paragraph does, never into a stack. */
.bottom {
  margin-top: 2rem; padding-top: .75rem; padding-bottom: .75rem;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 1.5rem; row-gap: 0;
  border-top: 1px solid var(--line); background: var(--paper);
  color: var(--ink-soft); font-size: .9rem;
}
.bottom p.board { margin: 0; color: var(--ink); font-weight: 600; line-height: 1.4; padding: .7rem 0; }
.bottom ul.links { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: .75rem; }
.bottom ul.links li { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.bottom ul.links li + li::before { content: "·"; margin-right: .75rem; color: var(--line-strong); }
/* On a computer it stays one line: the links keep their room and a long
 * board name gives way, cut with "…" (the whole name is in its title). */
@media (min-width: 64rem) {
  .bottom { flex-wrap: nowrap; }
  .bottom p.board { flex: 0 1 auto; min-width: 12rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  /* Many pages in the footer (15.3) wrap the links to the right of the
   * name rather than push past the edge. */
  .bottom ul.links { flex: none; max-width: calc(100% - 13.5rem); justify-content: flex-end; }
}
.bottom a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.bottom a:hover { text-decoration: underline; }
.bottom a[aria-current] { color: var(--ink); font-weight: 600; }
@media (max-width: 40rem) {
  .bottom { padding-top: 1rem; padding-bottom: 1rem; }
  /* A wrapped line would start with a dot; on a phone the gap alone parts them. */
  .bottom ul.links { margin-left: 0; column-gap: 1.25rem; }
  .bottom ul.links li + li::before { content: none; }
}

img { max-width: 100%; height: auto; }

@media (min-width: 40rem) {
  h1 { font-size: 2.1rem; margin-top: 2.25rem; }
  .messages { max-height: 60vh; overflow-y: auto; }
  .card { padding: 1.35rem 1.5rem; }
}

/* ---- Home -------------------------------------------------------------- */
/* Signed out, the first card says what the place is and holds the one
   button worth pressing. */
.hero {
  padding: 1.75rem 1.5rem;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, #6d4fd8 18%, transparent), transparent 55%),
    radial-gradient(120% 140% at 0% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 55%),
    var(--paper);
}
.hero p { font-size: 1.1rem; max-width: 38rem; }
.hero .button { margin-top: .75rem; padding-left: 1.5rem; padding-right: 1.5rem; }
.greeting { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; margin: 1.75rem 0 .25rem; }
.greeting + .meta { margin-bottom: 1rem; }
.more-link { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; font-weight: 600; text-decoration: none; }
.more-link::after { content: "→"; transition: transform .15s; }
.more-link:hover::after { transform: translateX(3px); }

/* ---- General assembly and surveys (zadanie 8.7, 8.8) ------------------- */

/* "Will you come?": three answers that can be changed, so one tap each. Once
   one is chosen the others turn to outlines, and the chosen one says so. */
.choices { display: flex; flex-wrap: wrap; gap: .5rem; margin: var(--gap) 0; }
.choices:has(.on) .button:not(.on) { background: var(--paper); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-strong); }
.choices .button.on::before { content: "✓"; margin-right: .2rem; }
@media (max-width: 40rem) {
  .choices .button { flex: 1 1 100%; justify-content: center; }
}

/* A survey answer: pick, then send. Each choice is a full-width row a thumb
   can hit. */
.pick fieldset { margin: var(--gap) 0; padding: 0; border: 0; display: grid; gap: .5rem; }
.pick label {
  display: flex; align-items: center; gap: .75rem; min-height: 48px; margin: 0; padding: .6rem 1rem;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-weight: 500; font-size: 1rem; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.pick label:hover { border-color: var(--accent); }
.pick label:has(:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pick input[type="radio"] { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--accent); box-shadow: none; }

/* The agenda is numbered: "item 2" is how the minutes and the members refer
   to it. The majority each item needs goes on its own line. */
ol.agenda { counter-reset: item; list-style: none; padding: 0; }
ol.agenda li { counter-increment: item; display: grid; grid-template-columns: 2.25rem 1fr; padding: .6rem 0; border-bottom: 1px solid var(--line); }
ol.agenda li:last-child { border-bottom: 0; }
ol.agenda li::before {
  content: counter(item);
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 700;
}
ol.agenda li > * { grid-column: 2; }
.agenda small { display: block; }

/* Attendance at the door, on a phone. */
.attendance select, .attendance input { width: 100%; }
@media (max-width: 40rem) {
  table.attendance td.who { font-weight: 600; }
  table.attendance td.who small { display: block; font-weight: 400; }
  /* The label would repeat what the select already shows. */
  table.attendance td::before { display: none; }
  /* Where the browser can tell, the proxy field appears only for a proxy.
     Without :has() it simply stays. */
  @supports selector(:has(*)) {
    table.attendance tr:not(:has(option[value="proxy"]:checked)) td.proxy { display: none; }
  }
  /* Save stays in reach above the tab bar while scrolling a long list. */
  .save { position: sticky; bottom: calc(4rem + env(safe-area-inset-bottom)); margin: 0; padding: .5rem 0; background: var(--page); }
  .save .button { width: 100%; justify-content: center; }
}

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

/* ---- Theme buttons in the footer (zadanie 9.11) ------------------------
 * A segmented control: three buttons in one track, the chosen one lifted
 * onto a paper "thumb". aria-pressed is both what a screen reader hears and
 * what the CSS draws, so the two cannot disagree. Each button is 44px high
 * for a thumb; on a phone the track takes the full width and the three
 * share it by the length of their words. */
.theme { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: 1rem 0 0; }
.theme > span[id^="theme-label"] { color: var(--ink-soft); font-size: .88rem; }
.theme .seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--page); border: 1px solid var(--line-strong); border-radius: 14px;
}
.theme button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; min-width: 44px; padding: 0 .85rem; border: 0; border-radius: 11px;
  background: none; color: var(--ink-soft); font: inherit; font-size: .88rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.theme button:hover { color: var(--ink); background: var(--paper); }
.theme button[aria-pressed="true"] {
  background: var(--paper); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgb(15 23 42 / .08), 0 0 0 1px var(--line);
}
/* In the dark the thumb needs an edge of its own: paper on page is a small
   step in lightness. */
:root[data-theme="dark"] .theme button[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--line-strong); color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme button[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--line-strong); color: var(--accent); }
}
.theme button:focus-visible { outline: 0; box-shadow: var(--ring); }
.theme svg { width: 1.05rem; height: 1.05rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 40rem) {
  .theme .seg { display: flex; width: 100%; }
  /* Shared by the length of each word: equal thirds cut "Автоматична". */
  .theme button { flex: 1 1 auto; padding: 0 .55rem; gap: .3rem; }
}

/* ---- The site on the phone (zadanie 14.1, 14.2) ----------------------- */

/* The one-time offer on the home page. It carries the app's own icon so
 * the parent recognises it later on the home screen, and it is quieter
 * than the "To pay" card: it is an offer, not something owed. */
.card.offer {
  display: grid; grid-template-columns: 3rem 1fr; column-gap: .9rem; align-items: start;
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  background: linear-gradient(160deg, var(--accent-soft), var(--paper) 70%);
}
/* Anything pwa.js hides stays hidden, whatever display its class gives it:
 * a .button is inline-flex, which beat the hidden attribute and showed an
 * empty blue button on an iPhone. */
[hidden] { display: none !important; }
.card.offer::before {
  content: ""; grid-row: 1 / span 2; width: 3rem; height: 3rem; border-radius: 12px;
  background: url("../icons/icon-192.6370759b2bd1.png") center / cover; box-shadow: 0 4px 12px rgb(37 82 196 / .25);
}
.card.offer > * { grid-column: 2; }
.card.offer > h2 { margin: .1rem 0 .2rem; font-size: 1.1rem; }
.card.offer > p { margin: 0 0 .5rem; }
/* The steps and the buttons take the card's full width on a phone; the
 * column under the icon would cost them a third of it. */
@media (max-width: 40rem) { .card.offer > .ios-steps, .card.offer > .offer-actions { grid-column: 1 / -1; } }
.offer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; margin-top: .4rem !important; }
.offer-actions button.link { color: var(--ink-soft); }

/* The three taps on an iPhone, each with the picture Safari shows, because
 * "Share" is an icon there, not a word. The pictures are masks, so they
 * take the accent colour on light and dark alike. */
.ios-steps { list-style: none; counter-reset: step; margin: .2rem 0 .6rem; padding: 0; display: grid; gap: .45rem; }
.ios-steps li {
  counter-increment: step; position: relative; padding: .55rem .7rem .55rem 2.6rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  line-height: 1.45;
}
.ios-steps li::before {
  content: counter(step); position: absolute; left: .65rem; top: .55rem;
  display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 700;
}
.ios-steps li:nth-child(-n+2)::after {
  content: ""; display: inline-block; width: 1.25rem; height: 1.25rem; margin-left: .35rem;
  vertical-align: -.25rem; background: var(--accent);
  -webkit-mask: var(--icon-step) center / contain no-repeat; mask: var(--icon-step) center / contain no-repeat;
}
.ios-steps li:nth-child(1) { --icon-step: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9H6.5A1.5 1.5 0 0 0 5 10.5v9A1.5 1.5 0 0 0 6.5 21h11a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 17.5 9H16'/%3E%3Cpath d='M12 14V3M8.5 6.5 12 3l3.5 3.5'/%3E%3C/svg%3E"); }
.ios-steps li:nth-child(2) { --icon-step: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='4'/%3E%3Cpath d='M12 8.5v7M8.5 12h7'/%3E%3C/svg%3E"); }

/* "On this device": the state reads as a line with a bell in front, and
 * the button sits under it. */
[data-push-panel] [data-push-state] { display: flex; gap: .55rem; align-items: flex-start; }
[data-push-panel] [data-push-state]::before {
  content: ""; flex: none; width: 1.25rem; height: 1.25rem; margin-top: .15rem; background: var(--accent);
  -webkit-mask: var(--icon-bell) center / contain no-repeat; mask: var(--icon-bell) center / contain no-repeat;
}
[data-push-panel] { --icon-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16V11a6 6 0 1 1 12 0v5l1.5 2h-15z'/%3E%3Cpath d='M10 20.5a2 2 0 0 0 4 0'/%3E%3C/svg%3E"); }

/* What you hear about: the event, then two narrow columns of ticks. The
 * whole cell is the tick's label, so the target is the cell, not the 20px
 * box; at 375px the event name gets what is left and wraps. */
table.prefs th:not(:first-child), table.prefs td:not(:first-child) { width: 1%; text-align: center; white-space: nowrap; padding-left: .3rem; padding-right: .3rem; }
table.prefs td { vertical-align: middle; }
table.prefs td:not(:first-child) { padding: 0; }
table.prefs td label { display: flex; justify-content: center; align-items: center; min-height: 48px; min-width: 56px; cursor: pointer; }
table.prefs input[type="checkbox"] { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
table.prefs + .button { margin-top: .9rem; }
/* The table is already on a card (the form), so it does not get a second
 * card of its own, and the heading under the hidden CSRF field starts at
 * the card's top like every other card's. */
main > form.card > table.rows { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
main > form.card > table.rows th:first-child, main > form.card > table.rows td:first-child { padding-left: 0; }
main > form.card > table.rows th:last-child, main > form.card > table.rows td:last-child { padding-right: 0; }
.card > input[type="hidden"]:first-child + h2 { margin-top: 0; }
@media (max-width: 40rem) {
  table.prefs th { font-size: .7rem; letter-spacing: .02em; }
  table.prefs th:first-child, table.prefs td:first-child { padding-left: 0; }
  table.prefs th:not(:first-child) { white-space: normal; max-width: 4.5rem; line-height: 1.25; vertical-align: bottom; }
}

/* Devices that ring: the name, since when, and Remove on the right. */
.rows.devices li { display: flex; flex-wrap: wrap; align-items: center; column-gap: .75rem; }
.rows.devices li > span { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.rows.devices li > small { display: block; order: 3; flex-basis: 100%; margin-top: -.4rem; }
.rows.devices li > form { order: 2; flex: none; }

/* No connection: a page of its own, kept on the phone, with no header to
 * lean on -- the card stands in the middle of the screen. */
main.offline { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; box-sizing: border-box; }
main.offline .card { text-align: center; padding: 2rem 1.5rem; margin: 0; }
main.offline img { display: block; margin: 0 auto 1rem; border-radius: 16px; box-shadow: 0 6px 18px rgb(37 82 196 / .3); }
main.offline h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
main.offline p { color: var(--ink-soft); margin: 0 0 1.25rem; }
main.offline .button { min-width: 12rem; }

/* ---- Answer, reactions, the message menu (zadanie 14.4, 14.6, 14.8) ---- */

/* The bubble is the anchor for its "⋯", which sits just outside it, on
 * the side away from the reader's own messages, so it never covers text. */
.messages li[data-id] { position: relative; }
.messages li.is-pinned { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 45%, transparent); }
.messages li > i.muted { display: block; font-size: .9rem; }

/* The quote: whose on one line, the start of the text on the next, cut
 * with an ellipsis; a tap goes to the original. */
.messages a.quote {
  display: block; margin: .3rem 0 .2rem; padding: .35rem .6rem;
  border-left: 3px solid var(--accent); border-radius: 6px 10px 10px 6px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  color: var(--ink-soft); font-size: .88rem; line-height: 1.35; text-decoration: none;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.messages a.quote:hover { background: var(--paper); color: var(--ink); }
.messages a.quote > span { display: block; color: var(--accent); font-weight: 650; font-size: .8rem; }

/* A tap on a quote lands on the original; for 1.6 s it glows so the eye
 * finds which one it is among a screen of bubbles. */
.messages li.flash-here { animation: flash-here 1.6s ease-out; }
@keyframes flash-here {
  0%, 35% { box-shadow: 0 0 0 3px var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--paper)); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .messages li.flash-here { animation: none; box-shadow: 0 0 0 3px var(--accent); }
}

/* Reactions: small pills under the text. The pill is 34px to keep the
 * bubble compact; an invisible edge makes the target 44px. */
.reactions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.reactions:not(:has(.reaction)) { display: none; }
.reactions form.inline { display: inline-flex; }
.reaction {
  position: relative; display: inline-flex; align-items: center; gap: .3rem;
  min-height: 34px; padding: 0 .6rem; margin: 0;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
  font: inherit; font-size: .95rem; line-height: 1; color: var(--ink); cursor: pointer;
}
.reaction::after { content: ""; position: absolute; inset: -5px -2px; }
.reaction > span { font-size: .8rem; font-weight: 650; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.reaction.on { background: var(--accent-soft); border-color: var(--accent); }
.reaction.on > span { color: var(--accent); }
button.reaction:hover { border-color: var(--accent); }
span.reaction { cursor: default; }

/* "⋯" */
.msg-menu > summary {
  position: absolute; top: 0; right: -2.85rem;
  display: grid; place-items: center; width: 44px; height: 44px;
  list-style: none; cursor: pointer; border-radius: 999px;
  color: var(--ink-soft); font-size: 1.3rem; font-weight: 700; line-height: 1;
  opacity: .55; transition: opacity .15s, background-color .15s;
}
.msg-menu > summary::-webkit-details-marker { display: none; }
.messages li.mine .msg-menu > summary { right: auto; left: -2.85rem; }
.messages li:hover .msg-menu > summary, .msg-menu > summary:focus-visible, .msg-menu[open] > summary { opacity: 1; }
.msg-menu > summary:hover, .msg-menu[open] > summary { background: var(--paper); color: var(--ink); }
.msg-menu > summary:focus-visible { outline: 0; box-shadow: var(--ring); }

/* The menu itself: a small pop-up under the "⋯" on a wide screen. */
.msg-menu > div {
  position: absolute; z-index: 20; top: 2.9rem; right: -2.85rem;
  width: max-content; min-width: 13rem; max-width: 19rem; padding: .4rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.messages li.mine .msg-menu > div { right: auto; left: -2.85rem; }
/* The last messages are at the bottom of the list's own scroll on a wide
 * screen; their menu opens upwards so it is not cut off there. */
.messages li:nth-last-child(-n+2):not(:first-child) .msg-menu > div { top: auto; bottom: calc(100% + .25rem); }
.pick-reaction { display: flex; gap: .15rem; padding: .1rem .1rem .35rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line); }
.pick-reaction form.inline { display: contents; }
.reaction-pick {
  flex: 1 1 0; display: grid; place-items: center; min-width: 40px; height: 40px; margin: 0; padding: 0;
  background: none; border: 0; border-radius: 10px; font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: background-color .1s, transform .1s;
}
.reaction-pick:hover, .reaction-pick:focus-visible { background: var(--accent-soft); transform: scale(1.12); outline: 0; }
.msg-menu > div > a, .msg-menu > div > form.inline { display: flex; }
.msg-menu > div > a, .msg-menu > div button.link {
  flex: 1; display: flex; align-items: center; min-height: 44px; padding: 0 .75rem; margin: 0;
  border-radius: 8px; color: var(--ink); font-weight: 500; text-decoration: none; text-align: left;
}
.msg-menu > div > a:hover, .msg-menu > div button.link:hover { background: var(--page); color: var(--ink); text-decoration: none; }
/* Withdrawing is the one that cannot be undone. */
.msg-menu > div > form[data-confirm] button.link { color: var(--alert); }

/* On a phone the menu is a sheet from the bottom, over a dimmed page; a
 * tap on the dim closes it (it is the summary, stretched). */
@media (max-width: 40rem) {
  .messages li { margin-right: 2.6rem; }
  .messages li.mine { margin-right: 0; margin-left: 2.6rem; }
  .msg-menu > summary { opacity: .8; }
  .msg-menu[open] > summary::before {
    content: ""; position: fixed; inset: 0; z-index: 60;
    background: rgb(10 15 25 / .45);
  }
  .msg-menu > div, .messages li.mine .msg-menu > div {
    position: fixed; z-index: 61; top: auto; left: 0; right: 0; bottom: 0;
    width: auto; max-width: none; min-width: 0;
    padding: .6rem .75rem calc(.75rem + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0; border-bottom: 0;
    animation: sheet-up .18s ease-out;
  }
  .msg-menu > div::before {
    content: ""; align-self: center; width: 2.5rem; height: 4px; margin: 0 0 .6rem;
    border-radius: 999px; background: var(--line-strong);
  }
  .reaction-pick { height: 48px; font-size: 1.5rem; }
  .msg-menu > div > a, .msg-menu > div button.link { min-height: 50px; font-size: 1.02rem; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .msg-menu > div { animation: none !important; } }

/* "Answering X: …" over the box, with ✕ to drop it. */
.write .replying {
  grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem;
  padding: .15rem .15rem .15rem .75rem; min-width: 0;
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 6px var(--radius) var(--radius) 6px;
  font-size: .9rem;
}
.write .replying > span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-soft); }
.write .replying b { color: var(--accent); }
.write .replying [data-reply-cancel] {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  color: var(--ink-soft); text-decoration: none; font-size: 1rem;
}
.write .replying [data-reply-cancel]:hover { background: var(--paper); color: var(--ink); }

/* The pinned message's "In the conversation". */
.pinned cite { display: block; font-size: .85rem; color: var(--ink-soft); font-style: normal; }
.pinned > p { margin: 0 0 .2rem; }
.pinned > a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: .9rem; }

/* ---- Managing a group (14.8) ------------------------------------------ */
.manage-members li { display: flex; flex-wrap: wrap; align-items: center; column-gap: .75rem; }
.manage-members li > span:first-child { flex: 1 1 12rem; min-width: 0; font-weight: 600; }
.manage-members li > span:first-child small { font-weight: 500; margin-left: .25rem; padding: .05rem .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.manage-members li > small { display: inline; flex-basis: 100%; order: 3; margin-top: -.2rem; }
.member-actions { display: flex; flex-wrap: wrap; column-gap: 1rem; }
.member-actions form.inline { display: inline-flex; }
.member-actions form + form button.link { color: var(--alert); }
@media (max-width: 40rem) {
  .member-actions { flex-basis: 100%; order: 4; }
}

/* Find somebody to add: label above, field and button on one line. */
form.search { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
form.search label { grid-column: 1 / -1; margin: 0; }
form.search input { margin: 0; }
form.search .button { margin: 0; }
form.search + .rows { margin-top: .75rem; }
/* A person found: name over email on the left, Add on the right. */
form.search + .rows li:not(.empty) { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: .75rem; }
form.search + .rows li > span { font-weight: 600; }
form.search + .rows li > small { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
form.search + .rows li > form { grid-column: 2; grid-row: 1 / span 2; }
/* "← back to the group": a way out, so a full-size target, quietly drawn. */
p.back { margin: 1rem 0 0; }
p.back a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
p.back a:hover { text-decoration: underline; }

/* ---- Registration with approval (zadanie 14.10) ----------------------- */

/* Two more kinds of button. Secondary: the second choice next to a main
 * one ("Register" next to "Sign in"), drawn as an outline so the eye still
 * goes to the main one. Danger: the one that cannot be undone. */
.button.secondary, button.button.secondary {
  background: transparent; color: var(--accent); box-shadow: none;
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.button.secondary:hover, button.button.secondary:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.button.danger, button.button.danger { background: var(--danger); color: var(--danger-ink); }
.button.danger:hover, button.button.danger:hover { background: var(--danger-hover); color: var(--danger-ink); }
.hero .button + .button { margin-left: .5rem; }
@media (max-width: 40rem) {
  .hero .button { width: 100%; }
  .hero .button + .button { margin-left: 0; margin-top: .6rem; }
}

/* Sign in, a new password, an invitation, registration: one card, its
 * title at the top inside it, smaller and centred, with the line that
 * explains it under; the card close to the top of the screen. */
form.card.narrow > h1 { margin: 0 0 1rem; font-size: 1.45rem; line-height: 1.25; text-align: center; }
form.card.narrow > h1:has(+ p.lead) { margin-bottom: .35rem; }
form.card.narrow > p.lead { margin: 0 0 1rem; color: var(--ink-soft); font-size: .95rem; line-height: 1.5; text-align: center; }
@media (min-width: 40.01rem) { main > form.card.narrow:has(> h1) { margin-top: 2.5rem; } }
/* With the title centred, the main button spans the card, as on most
 * sign-in screens, and the line under it is centred too. */
form.card.narrow:has(> h1) > .button { width: 100%; margin-top: .25rem; }
form.card.narrow:has(> h1) > .button + p { text-align: center; margin: .5rem 0 0; }

/* The registration form: "You" and "Your child" as two sections of one
 * card, each field with its label above and its help under. */
form.register { max-width: 32rem; }
form.register fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
form.register fieldset + fieldset { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
form.register legend { padding: 0; margin-bottom: .2rem; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
form.register fieldset > p { margin: 0 0 .85rem; }
form.register fieldset > p > label { margin-top: .6rem; }
form.register fieldset > p > b { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
form.register fieldset > p.note { margin-top: .25rem; }
form.register > .button { width: 100%; margin-top: 1.25rem; }
form .errorlist.nonfield {
  margin: 0 0 1rem; padding: .65rem .85rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--alert) 10%, var(--paper)); border: 1px solid color-mix(in srgb, var(--alert) 35%, transparent);
}
form.register input[aria-invalid="true"], form.register .errorlist + input { border-color: var(--alert); }

/* The way between "Sign in" and "Register", under each form, set apart by
 * a line; the links are full-size targets. */
form.card.narrow > p:last-child { margin: 1.1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); text-align: center; color: var(--ink-soft); }
form.card.narrow > p > a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* "Check your email", "Thank you", "The link no longer works": one short
 * card in the middle. */
section.card.narrow { margin: 2.5rem auto; padding: 1.75rem 1.5rem; }
section.card.narrow > h1:first-child { margin-top: 0; font-size: 1.45rem; }
section.card.narrow > p > a:not(.button) { font-weight: 600; }

/* Requests to join: one card per person, the facts in two columns on a
 * wide screen and stacked on a phone, then the decision. */
.card.request > h2 { margin-bottom: .6rem; }
dl.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0 0 1rem; }
dl.facts-list dt { color: var(--ink-soft); font-size: .88rem; padding-top: .1rem; }
dl.facts-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
dl.facts-list a[href^="tel:"] { display: inline-flex; align-items: center; min-height: 44px; margin: -.65rem 0; font-weight: 600; }
.card.request > form { display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; align-items: end; padding-top: .9rem; border-top: 1px solid var(--line); }
.card.request > form > label { grid-column: 1 / -1; margin: 0; }
.card.request > form select, .card.request > form .button { margin: 0; }
.card.request details.refuse { margin-top: .5rem; }
.card.request details.refuse > summary {
  display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
  color: var(--danger); font-weight: 600; list-style: none;
}
.card.request details.refuse > summary::-webkit-details-marker { display: none; }
.card.request details.refuse > summary::after { content: "▾"; margin-left: .35rem; font-size: .8em; transition: transform .15s; }
.card.request details.refuse[open] > summary::after { transform: rotate(180deg); }
.card.request details.refuse > form { display: grid; grid-template-columns: 1fr auto; gap: .5rem .75rem; align-items: end; padding: .75rem; border-radius: var(--radius); background: color-mix(in srgb, var(--danger) 7%, var(--paper)); }
.card.request details.refuse > form > label { grid-column: 1 / -1; margin: 0; }
.card.request details.refuse input, .card.request details.refuse .button { margin: 0; }
@media (max-width: 40rem) {
  dl.facts-list { grid-template-columns: 1fr; gap: 0; }
  dl.facts-list dt { margin-top: .55rem; }
  dl.facts-list dt:first-child { margin-top: 0; }
  .card.request > form, .card.request details.refuse > form { grid-template-columns: 1fr; }
  .card.request > form .button, .card.request details.refuse .button { width: 100%; }
}

/* The registration link for the class's Viber group: the address in a box
 * that wraps rather than overflows, with Copy beside it. */
p.copyline {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .5rem .5rem .5rem .85rem; background: var(--page); border-radius: var(--radius);
}
p.copyline > code { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; font-size: .92rem; }
p.copyline + p > a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-weight: 600; }

/* The theme in the account menu and in the phone's "More" (signed in): a
 * caption over the three buttons, which share the menu's width. */
.top .drop .menu > form.theme, .tabbar .sheet > form.theme {
  display: flex; flex-direction: column; align-items: stretch; gap: .35rem;
  margin: .25rem 0 0; padding: .55rem .4rem .45rem; border-top: 1px solid var(--line);
}
.top .drop .menu > form.theme > span[id^="theme-label"], .tabbar .sheet > form.theme > span[id^="theme-label"] { font-size: .8rem; padding: 0 .35rem; }
.top .drop .menu > form.theme .seg, .tabbar .sheet > form.theme .seg { display: flex; width: 100%; }
.top .drop .menu > form.theme button, .tabbar .sheet > form.theme button { flex: 1 1 auto; min-height: 40px; padding: 0 .5rem; gap: .3rem; }
.tabbar .sheet > form.theme button { min-height: 44px; }
.tabbar .sheet > form.theme svg { width: 1.05rem; height: 1.05rem; padding: 0; border-radius: 0; background: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (max-width: 40rem) {
  .tabbar .sheet { max-height: calc(100dvh - 6rem - env(safe-area-inset-bottom)); overflow-y: auto; }
}

/* Profile and settings: one column of sections, narrower than the page, so
 * the forms in it read like a settings screen and not a spreadsheet. */
main:has(> .settings-section) > h1, .settings-section { max-width: 40rem; margin-left: auto; margin-right: auto; }
.settings-section > h2 { font-size: 1.15rem; }
.settings-section > form > p:first-of-type > label { margin-top: 0; }
.settings-section > form > .button { margin-top: .75rem; }
.settings-section > ul { margin: 0 0 .5rem; padding-left: 1.1rem; }
.settings-section > ul li { padding: .2rem 0; }
.settings-section > form.theme { margin-top: .25rem; }
/* 14.11: a waiting request reads quieter than a linked child. */
.settings-section > ul.children li.waiting { color: var(--ink-soft); }
.settings-section > ul.children .status { margin-left: .35rem; vertical-align: .05em; }
.settings-section details.add-child { margin-top: .75rem; }
.settings-section details.add-child > summary { list-style: none; cursor: pointer; }
.settings-section details.add-child > summary::-webkit-details-marker { display: none; }
.settings-section details.add-child > form { padding-top: .25rem; }
.settings-section details.add-child > form > p:first-of-type > label { margin-top: 0; }
.settings-section details.add-child > form > .button { margin-top: .75rem; }
.settings-section details.add-child > form > p.muted { margin: .6rem 0 0; font-size: .9rem; }
.card.request > h2 .status { margin-left: .4rem; vertical-align: .15em; font-size: .72rem; }
.settings-section > p:last-child > .more-link { margin: -.4rem 0; }

/* ---- The front page: the board's shop window (zadanie 15) ------------- */

/* Something owed (15.А): one thin line at the top, warm but not loud --
 * the full list is on the profile page. */
a.owed-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem;
  min-height: 44px; margin: 1rem 0 0; padding: .55rem .9rem;
  background: var(--warn-bg); color: var(--ink); text-decoration: none; font-size: .93rem;
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); border-left: 3px solid var(--warn);
  border-radius: var(--radius);
}
a.owed-strip > b { color: var(--warn); white-space: nowrap; }
a.owed-strip:hover { color: var(--ink); border-color: var(--warn); }
a.owed-strip:hover > b { text-decoration: underline; text-underline-offset: .2em; }

/* The hero: who we are, in a large card across the page. With a photo,
 * the photo fills it and the words sit on a dark gradient at the bottom. */
.home-hero {
  position: relative; overflow: hidden; margin: 1.25rem 0 2rem; padding: 2.5rem 2rem;
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, #6d4fd8 20%, transparent), transparent 55%),
    radial-gradient(120% 140% at 0% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    var(--paper);
}
.home-hero h1, .home-hero h2 { margin: 0 0 .6rem; font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 40rem; line-height: 1.2; }
.home-hero .prose { max-width: 40rem; font-size: 1.1rem; color: var(--ink-soft); }
.home-hero .prose > :last-child { margin-bottom: 0; }
.home-hero p { max-width: 40rem; font-size: 1.1rem; color: var(--ink-soft); }
.home-hero .hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0 0; }
.home-hero .hero-actions:empty { display: none; }
.home-hero.with-image { min-height: 24rem; display: flex; align-items: flex-end; padding: 0; color: #fff; }
.home-hero.with-image > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-hero.with-image > div {
  position: relative; width: 100%; padding: 6rem 2rem 2rem;
  background: linear-gradient(180deg, transparent, rgb(8 12 24 / .55) 35%, rgb(8 12 24 / .85));
}
.home-hero.with-image :is(h1, h2) { color: #fff; }
.home-hero.with-image :is(p, .prose) { color: rgb(255 255 255 / .88); }
.home-hero.with-image .prose a { color: #fff; }
.home-hero.with-image .button.secondary { color: #fff; border-color: rgb(255 255 255 / .7); }
.home-hero.with-image .button.secondary:hover { background: rgb(255 255 255 / .12); color: #fff; }
@media (max-width: 40rem) {
  .home-hero { padding: 1.75rem 1.25rem; margin-top: 1rem; }
  .home-hero.with-image { min-height: 20rem; }
  .home-hero.with-image > div { padding: 5rem 1.25rem 1.5rem; }
  .home-hero .hero-actions .button { flex: 1 1 auto; }
}

/* The sections, each a heading and a grid of cards: three across on a wide
 * screen, two on a tablet, one on a phone. */
.home-section, .block { margin: 2.25rem 0; }
.block:first-of-type, .owed-strip + .block, .offer + .block { margin-top: 1.25rem; }
.home-section > h2, .block > h2 { font-size: 1.35rem; margin: 0 0 .9rem; }
.block-hero > .home-hero { margin: 0; }
.project-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 40rem) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.project-grid + p { margin: .75rem 0 0; }

/* A project or a cause: cover on top, edge to edge, then title, a few lines,
 * and the money bar pushed to the bottom so the bars in a row line up. A
 * card without a photo is a plain card like the rest (15.7.1); the status
 * badge says which section it is. */
.card.project, .card.cause {
  position: relative; display: flex; flex-direction: column; margin: 0; padding: 1.1rem 1.2rem;
}
.card.project > .cover, .card.cause > .cover {
  display: block; margin: -1.1rem -1.2rem .9rem; aspect-ratio: 16 / 10; overflow: hidden; background: var(--page);
}
.card.project > .cover img, .card.cause > .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card.project:hover > .cover img { transform: scale(1.03); }
.card.project h3, .card.cause h3 { margin: 0 0 .35rem; font-size: 1.1rem; line-height: 1.3; }
.card.project h3 a, .card.cause h3 a { color: var(--ink); text-decoration: none; }
.card.project h3 a:hover, .card.cause h3 a:hover { color: var(--accent); }
/* The whole project card is the link; the title carries it. */
.card.project h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card.project:hover { box-shadow: var(--shadow-lg); }
.card.project > p:not(.meta) {
  margin: 0 0 .5rem; color: var(--ink-soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.card.project > .bar, .card.cause > .bar { margin-top: auto; }
.card.project > .meta, .card.cause > .meta { margin: .25rem 0 0; font-size: .85rem; }
.card.project > p:not(.meta):last-child { margin-bottom: 0; }
.card.cause > .button { position: relative; margin-top: .9rem; align-self: flex-start; }
.card.cause > .bar:first-of-type ~ .button { margin-top: .9rem; }

/* News on the front page: the same cards as the news page, in a grid. */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 0 0 .75rem; }
.news-grid > article.card { margin: 0; }
.news-grid > article.card h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.news-grid > article.card h3 a { color: var(--ink); text-decoration: none; }
.news-grid > article.card h3 a:hover { color: var(--accent); }
.news-grid > article.card > p:last-child { margin-bottom: 0; }

/* Partners and donors: logos in tiles, a name where there is no logo. */
ul.partners { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem; }
ul.partners li {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center;
  min-height: 6.5rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
ul.partners li > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; color: var(--ink); text-decoration: none; }
ul.partners li > a:hover { color: var(--accent); }
ul.partners img { max-height: 3.25rem; max-width: 100%; width: auto; object-fit: contain; }
ul.partners b { font-size: 1.05rem; }
ul.partners small { color: var(--ink-soft); font-size: .83rem; line-height: 1.4; }

/* ---- One project (15.1) ----------------------------------------------- */
a.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
a.back:hover { text-decoration: underline; }
.project-page { max-width: 46rem; margin: 0 auto; }
.project-page > .meta:first-child { margin: .75rem 0 0; }
.project-page > h1 { margin-top: .5rem; }
.status {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent);
}
.status.status-planned { background: color-mix(in srgb, #8b5cf6 14%, var(--paper)); color: color-mix(in srgb, #8b5cf6 80%, var(--ink)); }
.status.status-done { background: var(--ok-bg); color: var(--ok); }
p.lead { font-size: 1.2rem; color: var(--ink-soft); margin: 0 0 1.25rem; }
img.cover-big { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); margin: 0 0 1.25rem; background: var(--page); }
.project-page > .card.cause { border-top-color: var(--warn); }
.project-page > .card.cause > h2 { margin: 0 0 .35rem; font-size: 1.15rem; }
.gallery { margin-top: 2rem; }
.gallery ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; }
.gallery li > a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--page); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery li > a:hover img { transform: scale(1.04); }
.gallery small { display: block; margin-top: .3rem; color: var(--ink-soft); font-size: .82rem; }
@media (max-width: 40rem) { .gallery ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Profile: the person's own, then the settings (15.2) -------------- */
/* All of it in the one narrow column the settings already use. */
main:has(> .settings-section) > :is(.greeting, .meta, section, h2.settings-title) { max-width: 40rem; margin-left: auto; margin-right: auto; }
h2.settings-title { margin-top: 2.5rem; margin-bottom: .25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 1.35rem; }
main > p:has(> a.back) { max-width: 46rem; margin: 1rem auto 0; }

/* ---- Blocks (zadanie 15.7) --------------------------------------------- */
/* Each block is a section of the page; reading text keeps a comfortable
 * line, pictures and grids take the full width. */
.block-text .prose, .block-heading .lead, .block-columns .prose, .block-quote { max-width: 46rem; }
.block-heading > h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin-bottom: .4rem; }
.block-heading .lead { font-size: 1.12rem; color: var(--ink-soft); }
.block .prose > :first-child { margin-top: 0; }
.block .prose > :last-child { margin-bottom: 0; }

.block-image figure { margin: 0; }
.block-image img { display: block; width: 100%; border-radius: var(--radius-lg); background: var(--page); }
.block-image figcaption { margin-top: .45rem; color: var(--ink-soft); font-size: .88rem; text-align: center; }

/* Picture and words side by side on a wide screen, the picture first on a
 * phone whichever side it is on. */
.block-image_text { display: grid; gap: 1.25rem 2rem; align-items: center; }
.block-image_text .media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); background: var(--page); }
.block-image_text .body > h2 { font-size: 1.35rem; margin: 0 0 .6rem; }
.block-image_text .body .button { margin-top: .25rem; }
@media (min-width: 48rem) {
  .block-image_text { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .block-image_text.image-right .media { order: 2; }
}

.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; }
.gallery-grid li > a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--page); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery-grid li > a:hover img { transform: scale(1.04); }
.gallery-grid small { display: block; margin-top: .3rem; color: var(--ink-soft); font-size: .82rem; }
@media (max-width: 40rem) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.block-columns { max-width: none; }
.block-columns .columns { display: grid; gap: 1.25rem 2.5rem; }
@media (min-width: 48rem) { .block-columns .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

p.block-button { text-align: center; margin: 0; }
p.block-button .button { padding-left: 1.75rem; padding-right: 1.75rem; }

/* A quote: large, with the accent line, the person under it. */
.block-quote blockquote {
  margin: 0; padding: 1.1rem 1.4rem; border-left: 4px solid var(--accent);
  background: var(--paper); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; box-shadow: var(--shadow);
}
.block-quote blockquote .prose { font-size: 1.2rem; line-height: 1.55; }
.block-quote cite { display: block; margin-top: .6rem; color: var(--ink-soft); font-style: normal; font-size: .92rem; }
.block-quote cite::before { content: "— "; }

/* Video: 16:9 at any width. */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.block-video > .meta { margin-top: .5rem; }

/* A page the editor sees before it is published. */
.draft-note { margin-top: 1rem; }

/* How many cards a row holds, chosen per block in the admin (15.7.1):
 * N on a computer, at most two on a tablet, one on a phone (the gallery
 * keeps two small squares there). Only blocks carry cols-*, so /proekti/
 * keeps its own grid. Last in the file so it wins over the auto-fill grids. */
.block:is(.cols-2, .cols-3, .cols-4) :is(.project-grid, .news-grid, ul.partners, .gallery-grid) { grid-template-columns: 1fr; }
.block-gallery:is(.cols-2, .cols-3, .cols-4) .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 40rem) {
  .block:is(.cols-2, .cols-3, .cols-4) :is(.project-grid, .news-grid, ul.partners, .gallery-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .block.cols-3 :is(.project-grid, .news-grid, ul.partners, .gallery-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .block.cols-4 :is(.project-grid, .news-grid, ul.partners, .gallery-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The hero and the blocks of cards may run wider than the text, up to 80rem (1280px), so
 * two or three cards in a row fill a big screen. Text blocks keep the
 * reading measure. The block is centred on the page and stops 2rem from
 * each edge, as the header does; 100vw counts the scroll bar, which the
 * 2rem gutter swallows. */
@media (min-width: 64rem) {
  .block:is(.block-hero, .block-projects, .block-causes, .block-news, .block-partners, .block-gallery) {
    width: min(80rem, 100vw - 4rem);
    margin-left: calc(50% - min(40rem, 50vw - 2rem));
  }
}

/* One card in a row: full width, so a card with a photo lies on its side,
 * the photo left and the words right, instead of a cover as tall as the
 * screen. */
.block.cols-1 :is(.project-grid, .news-grid, ul.partners) { grid-template-columns: 1fr; }
.block-gallery.cols-1 .gallery-grid { grid-template-columns: 1fr; }
.block-gallery.cols-1 .gallery-grid li > a { aspect-ratio: 16 / 9; }
@media (min-width: 40rem) {
  .block.cols-1 :is(.card.project, .card.cause):has(> .cover) {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 1.4rem; align-content: start;
  }
  .block.cols-1 :is(.card.project, .card.cause) > .cover {
    grid-column: 1; grid-row: 1 / span 8; margin: -1.1rem 0 -1.1rem -1.2rem; aspect-ratio: auto; min-height: 15rem; position: relative;
  }
  /* Out of the flow, so the photo's own height does not make the card tall. */
  .block.cols-1 :is(.card.project, .card.cause) > .cover img { position: absolute; inset: 0; }
  .block.cols-1 :is(.card.project, .card.cause):has(> .cover) > :not(.cover) { grid-column: 2; }
  .block.cols-1 .card.cause > .button { justify-self: start; }
}
