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

:root {
  /* Surfaces */
  --gals-color-bg: #f4f6f8;
  --gals-color-surface: #fff;
  --gals-color-text: #1a1a1a;
  --gals-color-text-strong: #1e293b;
  --gals-color-text-muted: #64748b;
  --gals-color-text-subtle: #94a3b8;

  /* Brand & actions */
  --gals-color-accent: #14b8a6;
  --gals-color-accent-dark: #0d9488;
  --gals-color-accent-hover: #0f766e;
  --gals-color-accent-soft: #5eead4;
  --gals-color-accent-warm: #fbbf24;
  /* Ночная палитра промо-ролика: блок с древом познания на лендинге. */
  --gals-color-night: #03110e;
  --gals-color-night-glow: #0b2a26;
  --gals-color-on-night: #eefbf7;
  --gals-color-accent-bright: #2dd4bf;
  --gals-color-accent-pale: #ccfbf1;
  --gals-color-link: #2563eb;
  --gals-color-link-hover: #1d4ed8;
  --gals-color-primary: #2563eb;
  --gals-color-primary-hover: #1d4ed8;

  /* Buttons: one set (docs/dev/ui.md § «Кнопки»). White on the main teal is 5.47:1; the lighter
     accent teals above are below AA behind white text, so they are never a button fill. */
  --gals-btn-main: #0f766e;
  --gals-btn-main-hover: #115e59;
  --gals-btn-ink: #14201b;
  --gals-btn-muted: #5c6b64;
  --gals-btn-line: rgba(20, 32, 27, 0.16);
  --gals-btn-radius: 14px;

  /* Borders & states */
  --gals-color-border: #cbd5e1;
  --gals-color-border-subtle: #e2e8f0;
  --gals-color-danger: #dc2626;
  --gals-color-danger-hover: #b91c1c;
  --gals-color-secondary-bg: #e2e8f0;
  --gals-color-secondary-hover: #cbd5e1;
  --gals-color-secondary-text: #334155;
  --gals-color-success-bg: #dcfce7;
  --gals-color-success-text: #166534;
  --gals-color-error-bg: #fee2e2;
  --gals-color-error-text: #991b1b;

  /* Mastery status badges */
  --gals-color-status-gap: #991b1b;
  --gals-color-status-gap-bg: #fee2e2;
  --gals-color-status-in-progress: #92400e;
  --gals-color-status-in-progress-bg: #fef3c7;
  --gals-color-status-solid: #166534;
  --gals-color-status-solid-bg: #dcfce7;
  --gals-color-status-correct: #f0fdf4;
  --gals-color-status-correct-bg: #14532d;
  --gals-color-status-notes: #166534;
  --gals-color-status-notes-bg: #dcfce7;
  --gals-color-status-untouched: #475569;
  --gals-color-status-untouched-bg: #f1f5f9;

  /* Typography */
  --gals-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gals-font-display: "Literata", Georgia, serif;
  --gals-line-height: 1.5;

  /* Spacing & shape */
  --gals-radius-sm: 8px;
  --gals-radius-md: 12px;
  --gals-radius-lg: 16px;
  --gals-space-sm: 0.5rem;
  --gals-space-md: 1rem;
  --gals-space-lg: 1.5rem;
  --gals-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
  --gals-focus-ring-color: var(--gals-color-accent-soft);

  /* Layout */
  --gals-layout-narrow: 560px;
  --gals-layout-wide: 720px;
}

/* The scrollbar's room is always reserved: a short tab has none, a long one has, and the
   centred column would shift sideways by its width when switching between them. */
html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--gals-font-sans);
  /* Prices and counters need lining figures whatever the heading font's default is. */
  font-variant-numeric: lining-nums;
  background: var(--gals-color-bg);
  color: var(--gals-color-text);
  line-height: var(--gals-line-height);
  min-height: 100vh;
}

a {
  color: var(--gals-color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--gals-layout-narrow);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.container.container--wide,
body:not(.landing-page) .container:has(.task-list--detailed) {
  max-width: var(--gals-layout-wide);
}

.card {
  background: var(--gals-color-surface);
  border-radius: var(--gals-radius-md);
  padding: var(--gals-space-lg);
  box-shadow: var(--gals-shadow-card);
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.subtitle {
  color: var(--gals-color-text-muted);
  margin: 0 0 var(--gals-space-lg);
  font-size: 0.95rem;
}

.input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin-bottom: var(--gals-space-md);
  border: 1px solid var(--gals-color-border);
  border-radius: var(--gals-radius-sm);
  font-size: 1rem;
}

.input:focus {
  outline: 2px solid var(--gals-color-primary);
  border-color: var(--gals-color-primary);
}

.password-field {
  position: relative;
  margin-bottom: var(--gals-space-md);
}

.password-field .input {
  margin-bottom: 0;
  padding-right: 2.75rem;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: var(--gals-radius-sm);
  background: transparent;
  color: var(--gals-color-text-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-field__toggle:hover {
  color: var(--gals-color-text-strong);
  background: var(--gals-color-secondary-bg);
}

.password-field__toggle:focus-visible {
  outline: 2px solid var(--gals-color-primary);
  outline-offset: 1px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: var(--gals-btn-radius);
  /* <button> would otherwise fall back to the UA font while <a class="btn"> inherits ours. */
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 2px;
}

.btn:not(.btn-link):active:not(:disabled):not(.is-disabled) {
  transform: scale(0.98);
}

/* The one action of a screen: taller, full width unless the place says otherwise. */
.btn-wide {
  display: flex;
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.btn-primary {
  background: var(--gals-btn-main);
  color: #fff;
}

.btn-primary:hover {
  background: var(--gals-btn-main-hover);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: #fff;
  color: var(--gals-btn-ink);
  box-shadow: inset 0 0 0 1px var(--gals-btn-line);
}

.btn-secondary:hover {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 27, 0.3);
  text-decoration: none;
}

.btn-danger {
  background: var(--gals-color-danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--gals-color-danger-hover);
  text-decoration: none;
  color: #fff;
}

.btn:disabled,
.btn.is-disabled,
a.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Off: an outline with muted text, not a pale fill. A quiet link just fades. */
.btn:not(.btn-link):disabled,
.btn:not(.btn-link).is-disabled,
a.btn:not(.btn-link)[aria-disabled="true"] {
  background: transparent;
  color: var(--gals-btn-muted);
  box-shadow: inset 0 0 0 1px var(--gals-btn-line);
  opacity: 1;
}

.btn-primary:disabled:hover,
.btn-primary.is-disabled:hover,
.btn-secondary:disabled:hover,
.btn-secondary.is-disabled:hover,
.btn-danger:disabled:hover,
.btn-danger.is-disabled:hover {
  background: transparent;
  color: var(--gals-btn-muted);
  box-shadow: inset 0 0 0 1px var(--gals-btn-line);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

.link-danger {
  color: var(--gals-color-danger);
  font-weight: 600;
}

.link-danger:hover {
  color: var(--gals-color-danger-hover);
}

.btn-link {
  min-height: 0;
  background: none;
  color: var(--gals-color-text-muted);
  font-size: 1rem;
  font-weight: 500;
  padding: var(--gals-space-sm);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.language-switcher-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.language-switcher {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
}

.lang-picker__details {
  position: relative;
}

.lang-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--gals-color-border);
  background: transparent;
  border-radius: var(--gals-radius-sm);
  cursor: pointer;
  list-style: none;
  color: var(--gals-color-text-muted);
  line-height: 1.4;
}

.lang-picker__trigger::-webkit-details-marker {
  display: none;
}

.lang-picker__trigger:hover {
  color: var(--gals-color-text);
  border-color: var(--gals-color-text-muted);
}

.lang-picker__trigger:focus-visible {
  outline: 2px solid var(--gals-focus-ring-color, var(--gals-color-accent));
  outline-offset: 2px;
}

.lang-picker__flag {
  display: block;
  width: 1.25rem;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.lang-picker__chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.55;
}

.lang-picker__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 9.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.25rem;
  border: 1px solid var(--gals-color-border);
  border-radius: var(--gals-radius-sm);
  background: var(--gals-color-surface, #fff);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.lang-picker__option {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: calc(var(--gals-radius-sm) - 2px);
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gals-color-text);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.lang-picker__option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.lang-picker__option:focus-visible {
  outline: 2px solid var(--gals-focus-ring-color, var(--gals-color-accent));
  outline-offset: -2px;
}

.language-switcher--prominent {
  gap: 0.65rem;
}

.lang-picker__langs {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.lang-picker__link {
  display: block;
  padding: 0.55rem 0.6rem;
  border-radius: calc(var(--gals-radius-sm) - 2px);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gals-color-text);
  text-decoration: none;
}

.lang-picker__link:hover {
  background: var(--gals-color-accent-soft);
  text-decoration: none;
}

.lang-picker__link:focus-visible {
  outline: 2px solid var(--gals-focus-ring-color, var(--gals-color-accent));
  outline-offset: -2px;
}

.lang-picker__link:has(.landing-staff-count) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ☰ drawn with borders: three 2px bars, 14px wide. */
.lang-picker__burger {
  display: block;
  width: 14px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  position: relative;
}

.lang-picker__burger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  border-top: 2px solid currentColor;
}

/* The phone menu of the header (includes/header_menu.html): «Children», «Staff». Wide screens show
   those links in the row. */
.header-menu {
  display: none;
}

.header-menu .lang-picker__trigger {
  position: relative;
}

.header-menu .lang-picker__menu {
  min-width: 12rem;
  width: max-content;
  max-width: calc(100vw - 32px);
}

/* Unread support requests and firing alerts: a count on the burger, for staff only. */
.header-menu__badge {
  position: absolute;
  top: -6px;
  right: -8px;
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--gals-color-status-gap-bg, #fee2e2);
  color: var(--gals-color-status-gap, #991b1b);
  box-shadow: 0 0 0 2px var(--landing-surface, #fff);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .header-menu {
    display: inline-flex;
  }
}

/* A child's screens: the menu with «Log out» is there at every width. */
.header-menu--always {
  display: inline-flex;
}

.lang-picker__link--button {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.language-switcher--prominent .lang-picker__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gals-color-text-muted);
  white-space: nowrap;
}

.language-switcher--prominent .lang-picker__details {
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.language-switcher--prominent .lang-picker__trigger {
  padding: 0.5rem 0.85rem;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(232, 237, 245, 0.88);
}

.language-switcher--prominent .lang-picker__trigger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.language-switcher--prominent .lang-picker__current-name {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .language-switcher--prominent .lang-picker__label,
  .language-switcher--prominent .lang-picker__current-name {
    display: none;
  }

  .language-switcher--prominent .lang-picker__trigger {
    padding: 0.45rem 0.5rem;
  }
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gals-color-text-strong);
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.messages li {
  padding: 0.75rem 1rem;
  border-radius: var(--gals-radius-sm);
  margin-bottom: var(--gals-space-sm);
  background: var(--gals-color-success-bg);
  color: var(--gals-color-success-text);
}

.messages li.error {
  background: var(--gals-color-error-bg);
  color: var(--gals-color-error-text);
}

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

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.task-item:last-child {
  border-bottom: none;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: #94a3b8;
}

.task-list--detailed .task-item--detailed {
  display: block;
  padding: 1.25rem 0;
}

.task-item--collapsible {
  /* Full-width block so summary/body don't sit in a row flex with siblings. */
  display: block;
  padding: 0;
  border-bottom: 1px solid var(--gals-color-border-subtle);
}

.task-item--collapsible:last-child {
  border-bottom: none;
}

.task-details {
  padding: 0;
}

.task-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
}

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

.task-summary::before {
  content: "▸";
  flex-shrink: 0;
  color: var(--gals-color-text-muted);
  transition: transform 0.15s ease;
}

.task-details[open] > .task-summary::before {
  transform: rotate(90deg);
}

.task-summary-title {
  flex: 1 1 12rem;
  font-weight: 600;
  color: var(--gals-color-text-strong);
}

.task-summary-main {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.task-summary-main .task-summary-title {
  flex: none;
  width: 100%;
}

.task-summary:has(.task-summary-aside) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.75rem;
  row-gap: 0.2rem;
}

.task-summary:has(.task-summary-aside)::before {
  grid-column: 1;
  grid-row: 1;
}

.task-summary:has(.task-summary-aside) .task-summary-main {
  grid-column: 2;
  grid-row: 1;
  flex: none;
}

.task-summary:has(.task-summary-aside) .task-summary-aside {
  grid-column: 3;
  grid-row: 1;
}

.task-summary-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.task-summary-meta,
.task-summary-duration,
.task-summary-subject,
.task-summary-checks {
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}

.task-summary-checks,
.task-summary-aside .task-summary-duration {
  white-space: nowrap;
}

@media (max-width: 540px) {
  .task-summary:has(.task-summary-aside) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-summary:has(.task-summary-aside) .task-summary-aside {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem 0.65rem;
  }

  .task-summary-aside .task-summary-duration {
    white-space: normal;
  }
}

.work-time-assignment {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--gals-color-text-muted);
}

.assignment-nav-fallback {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.9rem;
}

.task-summary-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  min-width: 0;
}

.task-summary-badge--done {
  background: var(--gals-color-status-correct-bg);
  color: var(--gals-color-status-correct);
}

.task-summary-badge--notes {
  background: var(--gals-color-status-notes-bg);
  color: var(--gals-color-status-notes);
}

.task-summary-badge--pending {
  background: var(--gals-color-status-in-progress-bg);
  color: var(--gals-color-status-in-progress);
}

.task-summary-badge--draft {
  background: var(--gals-color-secondary-bg);
  color: var(--gals-color-secondary-text);
}

.task-summary-badge--review {
  background: var(--gals-color-status-gap-bg);
  color: var(--gals-color-status-gap);
}

.task-details-body {
  padding: 0 0 1.25rem 1.1rem;
  min-width: 0;
}

.task-set-meta {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}

.task-list-filter {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.875rem;
}

.task-list-filter .btn-link {
  font-size: inherit;
}

.cycle-action-banner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cycle-action-banner p {
  margin: 0;
}

/* Weak client + LaTeX: inside expanded task body only. */
.task-details-body > .math-weak-banner {
  margin: 0 0 1rem;
}

.math-weak-banner {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: var(--gals-radius-sm);
  color: #9a3412;
}

.math-weak-banner[hidden] {
  display: none !important;
}

.math-weak-banner__text {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.math-weak-banner__actions {
  margin: 0;
}

.math-weak-banner .btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

.task-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.task-item-heading {
  flex: 1;
  min-width: 0;
}

.task-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
  margin-left: 2rem;
}

.task-instructions {
  position: relative;
  margin: 0;
  padding: 1rem 1.1rem;
  background: #f8fafc;
  border-left: 3px solid #14b8a6;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #334155;
}
.task-instructions:has(> .task-flag) {
  padding-right: 4.75rem;
}
.task-instructions > .task-flag {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  left: auto;
  width: max-content;
  z-index: 1;
  margin: 0;
}

.task-instructions.markdown-body {
  white-space: normal;
}

.task-instructions.markdown-body p {
  margin: 0 0 0.65rem;
}

.task-instructions.markdown-body p:last-child {
  margin-bottom: 0;
}

.task-instructions.markdown-body ul,
.task-instructions.markdown-body ol {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.35rem;
}

/* 1.35rem holds "9." and nothing wider. The marker hangs outside the line,
   and overflow-x on .markdown-body clips the tens digit from 10 on. */
.task-instructions.markdown-body ol {
  padding-left: 2.5em;
}

.task-instructions.markdown-body li {
  margin: 0.2rem 0;
}

.task-instructions.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.65rem 0;
}

.task-instructions.markdown-body th,
.task-instructions.markdown-body td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.task-instructions.markdown-body th {
  background: #f1f5f9;
  font-weight: 600;
}

.task-instructions.markdown-body strong {
  font-weight: 600;
  color: #1e293b;
}

.task-instructions.markdown-body blockquote {
  margin: 0.5rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--gals-color-border);
  color: var(--gals-color-text-muted);
}

.task-instructions.markdown-body blockquote p {
  margin-bottom: 0.35rem;
}

.task-instructions.markdown-body .task-blank,
.draft-markdown .task-blank {
  display: inline-block;
  min-width: 2.5em;
  border-bottom: 1.5px solid #94a3b8;
  vertical-align: baseline;
  margin: 0 0.15em;
}

.task-instructions.markdown-body .task-math,
.draft-markdown .task-math,
.task-check-analysis.markdown-body .task-math {
  display: inline-block;
  vertical-align: -0.15em;
  line-height: 1;
}

.task-instructions.markdown-body .task-math math,
.draft-markdown .task-math math,
.task-check-analysis.markdown-body .task-math math {
  font-size: 1.05em;
}

.task-instructions.markdown-body .task-math--display,
.draft-markdown .task-math--display,
.task-check-analysis.markdown-body .task-math--display {
  display: block;
  margin: 0.75em auto;
  text-align: center;
  vertical-align: baseline;
  overflow-x: auto;
  max-width: 100%;
}

.task-instructions a {
  color: #0d9488;
  font-weight: 600;
  word-break: break-all;
}

.task-instructions a:hover {
  color: #0f766e;
}

.task-item.done .task-instructions {
  opacity: 0.55;
}

.task-fluentto {
  margin: 0.25rem 0 0.5rem;
  display: block;
  width: fit-content;
  max-width: 100%;
  align-self: flex-start;
}

.btn-fluentto {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  width: auto;
}

.btn-fluentto:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
}

.btn-fluentto--link {
  background: transparent;
  color: #4f46e5;
  border: none;
  width: auto;
  min-height: 0;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-fluentto--link:hover {
  background: transparent;
  color: #4338ca;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.landing-page:not(.app-page) .task-instructions {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border-left-color: #5eead4;
}

.task-title {
  font-weight: 600;
  margin: 0;
}

.task-duration {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.25rem 0 0;
}

.progress {
  background: #e2e8f0;
  border-radius: 999px;
  height: 8px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar {
  background: #22c55e;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.dash {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.dash-head-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem 1rem;
}

.dash-head-actions .btn {
  white-space: nowrap;
}

.dash-head-actions .btn-link {
  padding-left: 0;
  padding-right: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 480px) {
  /* Заголовок отдельной строкой, кнопки под ним в один ряд: с длинными подписями
     («Добавить профиль») в одну строку с заголовком они не помещаются. */
  .dash-head-actions {
    width: 100%;
  }
}

.dash-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-title-row .dash-title {
  margin: 0;
}

.dash-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border: 1.5px solid var(--landing-border, var(--gals-color-border-subtle));
  border-radius: 50%;
  color: var(--gals-color-text-muted);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.dash-add-icon:hover,
.dash-add-icon:focus-visible {
  border-color: var(--landing-accent, var(--gals-color-accent));
  color: var(--landing-accent, var(--gals-color-accent));
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 55%, #fff);
  outline: none;
}

.dash-title {
  margin: 0 0 0.2rem;
  font-family: var(--gals-font-display);
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* The cabinet's tabs: the three things the product does (templates/parent/dashboard.html).
   Typographic, as the audience tabs of the main page: a rule under the open one. */
.dash-tabs {
  display: inline-flex;
  gap: 0 1.75rem;
  border-bottom: 1px solid var(--landing-border-strong, var(--gals-color-border-subtle));
}

.dash-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: -1px;
  padding: 0.5rem 0 0.85rem;
  font-size: 1rem;
  /* one weight for every tab: a bolder open tab would be wider and push its neighbours */
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--gals-color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.dash-tab svg {
  flex: none;
  color: var(--landing-faint, var(--gals-color-text-subtle));
  transition: color 0.15s ease;
}

.dash-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--landing-accent, var(--gals-color-accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.dash-tab:hover {
  color: var(--landing-ink, var(--gals-color-text-strong));
  text-decoration: none;
}

.dash-tab:hover::after {
  transform: scaleX(0.35);
}

.dash-tab[aria-current="page"] {
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.dash-tab[aria-current="page"] svg {
  color: var(--landing-accent, var(--gals-color-accent));
}

.dash-tab[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Switching a tab must not move anything but the panel: a hidden panel takes no room, and
   the cards do not replay their entrance (static/js/dash_tabs.js sets .dash--switched). */
.dash-panel[hidden] {
  display: none;
}

.dash--switched .dash-list > li .dash-profile {
  animation: none;
}

/* A tab not started yet: one offer card, not stretched over the whole cabinet. */
.dash-offer {
  max-width: 34rem;
}

@media (max-width: 640px) {
  /* Three names do not fit one line on a phone: the mark above the name, which may break
     over two lines. Columns follow the names (equal columns made a long German word run
     into its neighbour); a word too long even so is hyphenated instead of overflowing. */
  .dash-head {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .dash-tabs {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: space-between;
    gap: 0 0.75rem;
  }

  .dash-tab {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.25rem 0 0.75rem;
    font-size: 0.875rem;
    white-space: normal;
    hyphens: auto;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dash-tab,
  .dash-tab svg,
  .dash-tab::after {
    transition: none;
  }
}

/* Переключатель профилей у ребёнка. Показывается только когда профилей больше одного. */
.child-profiles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
}

.child-profiles-label {
  font-size: 0.9rem;
  color: var(--text-muted, #6b7280);
}

.child-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.child-profile.is-current {
  border-color: var(--accent, #16a34a);
  background: var(--accent-soft, #ecfdf5);
  font-weight: 600;
  cursor: default;
}

.child-profile-todo {
  min-width: 1.4em;
  padding: 0 0.35em;
  border-radius: 999px;
  background: var(--accent, #16a34a);
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
}

.dash-profile {
  --dash-rail: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 1.15rem 1.35rem;
  border: 1px solid var(--landing-border, var(--gals-color-border-subtle));
  border-radius: var(--landing-radius, var(--gals-radius-md));
  background: var(--gals-color-surface);
  box-shadow: var(--landing-shadow, var(--gals-shadow-card));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dash-profile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--dash-rail);
}

a.dash-profile:hover {
  text-decoration: none;
  border-color: var(--landing-accent, var(--gals-color-accent));
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 55%, #fff);
  transform: translateY(-2px);
  box-shadow: var(--landing-shadow-lg, 0 8px 24px rgba(20, 32, 27, 0.08));
}

a.dash-profile:focus-visible {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: 2px;
}

.dash-profile--attention {
  --dash-rail: var(--landing-accent, var(--gals-color-accent));
  border-color: color-mix(in srgb, var(--landing-accent, #0d9488) 45%, var(--landing-border, #e2e8f0));
}

.dash-profile--waiting {
  --dash-rail: var(--gals-color-status-in-progress);
  border-style: dashed;
}

.dash-profile--calm {
  --dash-rail: var(--landing-border, var(--gals-color-border-subtle));
}

.dash-profile--setup {
  gap: 0.85rem;
}

.dash-profile-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

/* The delete "×" is absolutely placed in the card's top-right 2rem; keep a long name from running under it. */
.dash-item:has(.dash-profile-delete) .dash-profile-main {
  padding-right: 1.25rem;
}

.dash-profile-name {
  margin: 0;
  font-family: var(--gals-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.dash-profile-gate {
  flex-shrink: 0;
  max-width: 14rem;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
  line-height: 1.25;
}

.dash-profile--waiting .dash-profile-gate {
  color: var(--gals-color-status-in-progress);
}

.dash-profile-meta,
.dash-profile-status {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--landing-ink, var(--gals-color-text-strong));
  line-height: 1.35;
}

.dash-profile-meta {
  font-weight: 400;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.dash-profile-meter {
  height: 0.65rem;
  background: color-mix(in srgb, var(--landing-border, #e2e8f0) 70%, #fff);
  border-radius: 999px;
  overflow: hidden;
}

.dash-profile-meter-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--landing-accent, var(--gals-color-accent)),
    color-mix(in srgb, var(--landing-accent, #0d9488) 70%, #5eead4)
  );
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* HUD — numbers in the heading face, captions in the promo video's monospace ("II · ЕВРОПА"). */
.hud-label {
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.hud-num {
  font-family: var(--gals-font-display);
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1;
  color: var(--landing-ink, var(--gals-color-text));
  font-variant-numeric: lining-nums tabular-nums;
}

.hud-num small {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

/* Dashboard card (2026-09-29): whose profile, today, the knowledge map, and both ways in. */
.dash-card-head .landing-eyebrow {
  font-size: 11px;
}

.dash-card-head .dash-profile-name {
  margin-top: 6px;
}

.dash-profile-name a {
  color: inherit;
  text-decoration: none;
}

.dash-profile-name a:hover {
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
}

/* The name (or the setup CTA) covers the card. Buttons and delete sit above that hit area. */
.dash-card-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.dash-card-actions,
.dash-profile-cta.dash-card-hit {
  position: relative;
  z-index: 1;
}

.dash-profile:has(.dash-card-hit:hover) {
  border-color: var(--landing-accent, var(--gals-color-accent));
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 55%, #fff);
  transform: translateY(-2px);
  box-shadow: var(--landing-shadow-lg, 0 8px 24px rgba(20, 32, 27, 0.08));
}

.dash-profile:has(.dash-card-hit:focus-visible) {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: 2px;
}

.dash-card-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 16px 24px;
  align-items: end;
}

.dash-stat {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.dash-stat-empty {
  font-size: 0.95rem;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.dash-seg {
  display: flex;
  gap: 3px;
  height: 8px;
}

.dash-seg-item {
  flex: 1;
  min-width: 0;
  border-radius: 3px;
  background: #e7eeeb;
}

/* same kinds as the task badges (core/parent_task_ui.py) */
.dash-seg-item--done { background: var(--landing-accent, #0d9488); }
.dash-seg-item--notes { background: #34d399; }
.dash-seg-item--review { background: #f87171; }
.dash-seg-item--draft { background: #fbbf24; }

.dash-mapbar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e7eeeb;
}

.dash-mapbar i {
  display: block;
  height: 100%;
}

.dash-map--solid { background: #22c55e; }
.dash-map--in_progress { background: #f59e0b; }
.dash-map--gap { background: #f43f5e; }
.dash-map--untouched { background: #cbd5e1; }
.dash-map--assumed { background: #99f6e4; }

.dash-maplegend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-size: 13px;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.dash-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
}

.dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--landing-border, var(--gals-color-border));
}

.dash-rhythm-line {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--landing-faint, var(--gals-color-text-subtle));
}

@media (max-width: 600px) {
  .dash-card-stats {
    grid-template-columns: 1fr;
  }

  .dash-rhythm-line {
    flex-basis: 100%;
    margin-left: 0;
  }
}

.progress-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.progress-period {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.progress-period-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}

.progress-period-field {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin: 0;
  font-size: 0.9rem;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.progress-period-field select {
  box-sizing: border-box;
  font: inherit;
  line-height: 1.2;
  color: inherit;
  height: 2rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--landing-border, #e2e8f0) 80%, transparent);
  border-radius: 0.4rem;
  background: var(--landing-bg, #fff);
}

.progress-check-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.progress-stat {
  padding: 0.85rem 0 0;
  border-top: 1px solid color-mix(in srgb, var(--landing-border, #e2e8f0) 80%, transparent);
}

.progress-stat-title {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.progress-movement-list,
.progress-long-lived {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.progress-long-lived a,
.progress-movement-list a {
  color: inherit;
  text-underline-offset: 0.15em;
}

.progress-movement-item--up::before {
  content: "↑ ";
  color: var(--landing-accent, var(--gals-color-accent));
}

.progress-movement-item--down::before {
  content: "↓ ";
  color: var(--gals-color-status-gap, #dc2626);
}

.dash-profile-cta {
  align-self: flex-start;
}

.dash-item {
  position: relative;
}

.dash-profile-delete {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  color: var(--gals-color-text-muted);
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.dash-profile-delete:hover,
.dash-profile-delete:focus-visible {
  background: color-mix(in srgb, var(--gals-color-danger) 12%, transparent);
  color: var(--gals-color-danger);
  outline: none;
}

@keyframes dash-profile-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dash-list > li .dash-profile {
  animation: dash-profile-in 0.4s ease both;
}

.dash-list > li:nth-child(2) .dash-profile {
  animation-delay: 0.05s;
}

.dash-list > li:nth-child(3) .dash-profile {
  animation-delay: 0.1s;
}

.dash-list > li:nth-child(4) .dash-profile {
  animation-delay: 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  .dash-list > li .dash-profile {
    animation: none;
  }

  a.dash-profile:hover,
  .dash-profile:has(.dash-card-hit:hover) {
    transform: none;
  }

  .dash-profile-meter-bar {
    transition: none;
  }
}

@media (max-width: 540px) {
  .dash-profile {
    padding: 1rem 1rem 1rem 1.15rem;
  }

  .dash-profile-gate {
    max-width: 9.5rem;
    font-size: 0.85rem;
  }
}


.empty {
  text-align: center;
  color: #64748b;
  padding: 2rem 1rem;
}

.form-errors {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

textarea.input {
  resize: vertical;
  min-height: 6rem;
  font-family: inherit;
}

.help-text {
  font-size: 0.8rem;
  color: #64748b;
  margin: -0.5rem 0 1rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.home-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Landing page ── */

body.landing-page {
  --landing-ground: #fbfcfc;
  --landing-surface: #fff;
  --landing-ink: #14201b;
  --landing-muted: #5c6b64;
  /* ui.md § Доступность: контраст вторичного текста на лендинге не ниже #78716c
     (4.8:1 на белом). Old #8a9691 was 3.06:1 — failed AA at the 12.5-13.5px sizes
     it's actually used at (landing-review.md §14). */
  --landing-faint: #78716c;
  --landing-border: #e4eae7;
  --landing-border-strong: #d2dcd7;
  --landing-accent: #0d9488;
  --landing-accent-ink: #0f766e;
  --landing-accent-soft: #e6f5f3;
  --landing-shadow: 0 1px 2px rgba(20, 32, 27, 0.04), 0 12px 32px -12px rgba(20, 32, 27, 0.14);
  --landing-shadow-lg: 0 1px 2px rgba(20, 32, 27, 0.05), 0 40px 80px -32px rgba(13, 148, 136, 0.22);
  --landing-radius: 14px;
  --landing-max: 1120px;

  --gals-color-bg: var(--landing-ground);
  --gals-color-surface: var(--landing-surface);
  --gals-color-text: var(--landing-ink);
  --gals-color-text-muted: var(--landing-muted);
  --gals-color-text-subtle: var(--landing-faint);
  --gals-color-border: var(--landing-border);
  --gals-color-border-subtle: var(--landing-border-strong);
  --gals-color-accent: var(--landing-accent);
  --gals-color-accent-dark: var(--landing-accent-ink);
  --gals-color-accent-soft: var(--landing-accent-soft);
  --gals-focus-ring-color: var(--landing-accent);

  --gals-font-body: "DM Sans", var(--gals-font-sans);

  margin: 0;
  font-family: var(--gals-font-body);
  color: var(--landing-ink);
  background: var(--landing-ground);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.landing-page .container.landing-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.landing-page h1,
body.landing-page h2,
body.landing-page h3 {
  font-family: var(--gals-font-display);
}

.landing-wrap {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 0 24px;
}

.landing-site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 252, 252, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--landing-border);
  padding-top: env(safe-area-inset-top, 0);
}

.landing-site-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Anchored sections (#pricing from the tutor page and /billing/ru/) stop below the sticky 64px header. */
body.landing-page section[id] {
  scroll-margin-top: 64px;
}

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--landing-ink);
  font-weight: 650;
}

.landing-logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

/* В шапке — только слово GALS: знак бренда (древо познания из промо-ролика) рисуется
   на самой странице в полном размере, см. static/js/knowledge-tree.js. Плитка со знаком
   (тот же static/favicon.svg) осталась в app/layout ради одного случая — staff на телефоне,
   где слово не помещается (ниже). */
.landing-logo-mark {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px -4px rgba(13, 148, 136, 0.6);
}

.landing-logo-text {
  letter-spacing: 0.14em;
  font-size: 17px;
  font-family: var(--gals-font-display);
  font-weight: 700;
}

.landing-nav-end {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* The account slot («Log in» / «Log out») is the last thing in the row, the language stands before
   it (includes/site_nav_end.html). The language keeps its size: whatever changes width — links,
   badge — gives way to the left of it. */
.landing-nav-end > .lang-picker {
  flex: none;
}

.lang-picker--landing .lang-picker__trigger {
  padding: 6px 9px;
  border-color: var(--landing-border);
  background: var(--landing-surface);
  color: var(--landing-faint);
}

.lang-picker--landing .lang-picker__trigger:hover {
  color: var(--landing-muted);
}

.lang-picker--landing .lang-picker__flag {
  width: 1.15rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.lang-picker--landing .lang-picker__menu {
  border-color: var(--landing-border);
  background: var(--landing-surface);
  box-shadow: 0 8px 24px rgba(12, 18, 34, 0.14);
}

.lang-picker--landing .lang-picker__option {
  color: var(--landing-muted);
}

.lang-picker--landing .lang-picker__option:hover {
  color: var(--landing-ink);
  background: var(--landing-accent-soft);
}

.landing-docs-link {
  font-size: 14px;
  font-weight: 550;
  color: var(--landing-muted);
  text-decoration: none;
}

.landing-docs-link:hover {
  color: var(--landing-ink);
  text-decoration: none;
}

.landing-staff-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
  color: var(--landing-faint);
  text-decoration: none;
  white-space: nowrap;
}

.landing-staff-link:hover {
  color: var(--landing-muted);
  text-decoration: none;
}

.landing-staff-count {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--gals-color-status-gap-bg, #fee2e2);
  color: var(--gals-color-status-gap, #991b1b);
  box-shadow: inset 0 0 0 1px rgba(153, 27, 27, 0.28);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Hero on squared paper, as in the promo video: faint teal grid that fades out towards the
   edges so it never sits hard behind the text. */
.landing-hero {
  position: relative;
  isolation: isolate;
  padding: 72px 0 56px;
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to right, rgba(13, 148, 136, 0.1) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(to bottom, rgba(13, 148, 136, 0.1) 1px, transparent 1px) 0 0 / 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 75% 85% at 50% 45%, #000 35%, transparent 90%);
  mask-image: radial-gradient(ellipse 75% 85% at 50% 45%, #000 35%, transparent 90%);
  pointer-events: none;
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 64px;
  align-items: center;
}

/* Parent hero is text only: the tree lives once, in the dark band below. */
.landing-hero-solo {
  grid-template-columns: minmax(0, 40rem);
}

/* Caption above a headline, in the promo video's caption style ("II · ЕВРОПА"): spaced
   monospace caps after a short teal rule — not a pill. */
.landing-eyebrow {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--landing-muted);
}

/* The rule sits on the first line's middle, also when a long caption wraps (fr, es). */
.landing-eyebrow-dot {
  flex: none;
  width: 18px;
  height: 2px;
  margin-top: calc(0.75em - 1px);
  background: var(--landing-accent);
}

/* Wide tracking breaks Devanagari shaping and looks loose in CJK. */
.landing-eyebrow:lang(hi),
.landing-eyebrow:lang(ja),
.landing-eyebrow:lang(ko),
.landing-eyebrow:lang(zh-hans) {
  letter-spacing: 0.06em;
}

body.landing-page .landing-hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 700;
  margin: 22px 0 0;
  text-wrap: balance;
}

.landing-lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--landing-muted);
  max-width: 42ch;
  margin: 20px 0 0;
  white-space: pre-line;
}

.landing-compare {
  width: 100%;
  max-width: 44rem;
  border-collapse: collapse;
  margin: 1.25rem 0 0;
  font-size: 16px;
  line-height: 1.45;
}

.landing-compare th,
.landing-compare td {
  border-bottom: 1px solid #e7e5e4;
  padding: 0.7rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.landing-compare th {
  font-weight: 650;
}

.landing-answer {
  max-width: 40rem;
  font-size: 18px;
  line-height: 1.55;
}

.landing-updated {
  color: var(--landing-faint, #78716c);
  font-size: 14px;
  margin: 1.5rem 0 0;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 32px;
}

.landing-cta-row-center {
  justify-content: center;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 11px;
  cursor: pointer;
  border: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.landing-btn-primary {
  /* Darker shade as the resting background: white text on --landing-accent is
     3.74:1 (fails AA), on --landing-accent-ink it's 5.47:1 (ui.md § Доступность). */
  background: var(--landing-accent-ink);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(15, 118, 110, 0.65);
}

.landing-btn-primary:hover {
  background: var(--landing-accent);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

.landing-btn-primary svg {
  transition: transform 0.15s ease;
}

.landing-btn-primary:hover svg {
  transform: translateX(3px);
}

.landing-link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 560;
  color: var(--landing-muted);
  text-decoration: none;
}

.landing-link-secondary:hover {
  color: var(--landing-accent-ink);
  text-decoration: none;
}

.landing-link-secondary svg {
  transition: transform 0.15s ease;
}

.landing-link-secondary:hover svg {
  transform: translateX(3px);
}

.landing-trust {
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--landing-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-trust svg {
  color: var(--landing-accent);
  flex: none;
}

.landing-pains {
  padding: 56px 0 64px;
  border-top: 1px solid var(--landing-border);
  background: linear-gradient(180deg, #fff 0%, var(--landing-ground) 100%);
}

.landing-pains-head {
  text-align: center;
  max-width: 58ch;
  margin: 0 auto 44px;
}

.landing-pains-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

.landing-pains-head p {
  color: var(--landing-muted);
  font-size: 16px;
  margin: 12px 0 0;
}

.landing-pains-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.landing-pain-card {
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--landing-shadow);
}

.landing-pain-q {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--landing-ink);
  letter-spacing: -0.01em;
}

.landing-pain-a {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--landing-accent-ink);
  line-height: 1.45;
}

.landing-pains-anchor {
  text-align: center;
  margin: 32px auto 0;
  max-width: 52ch;
  font-size: 17px;
  font-weight: 600;
  color: var(--landing-ink);
  letter-spacing: -0.01em;
  font-family: var(--gals-font-display);
}

.landing-steps {
  padding: 20px 0 84px;
}

.landing-steps-head {
  text-align: center;
  max-width: 52ch;
  margin: 0 auto 40px;
}

.landing-steps-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

.landing-steps-head p {
  color: var(--landing-muted);
  font-size: 16px;
  margin: 12px 0 0;
}

.landing-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Five steps: three on the first row, two centered on the second, same card width. */
.landing-steps-grid:has(> :nth-child(5):last-child) {
  grid-template-columns: repeat(6, 1fr);
}

.landing-steps-grid:has(> :nth-child(5):last-child) > :nth-child(n) {
  grid-column: span 2;
}

.landing-steps-grid:has(> :nth-child(5):last-child) > :nth-child(4) {
  grid-column: 2 / span 2;
}

.landing-steps-grid:has(> :nth-child(5):last-child) > :nth-child(5) {
  grid-column: 4 / span 2;
}

.landing-step {
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: var(--landing-shadow);
}

.landing-step-ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--landing-accent-soft);
  color: var(--landing-accent-ink);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.landing-step h3,
.landing-step h4 {
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -0.01em;
  margin: 0;
}

.landing-step p {
  font-size: 14.5px;
  color: var(--landing-muted);
  margin: 8px 0 0;
  line-height: 1.5;
}

/* Main page, first screen: «Для ребёнка / Для себя». Two links to the same page in its two
   positions (/ and /self/), set as a pair of tabs in the voice of the promo video's captions
   (spaced monospace caps, the hero's former eyebrow): both stand on one hairline, and the
   current one carries the teal rule. Typography, not a control from an app. */
.landing-audience {
  display: inline-flex;
  gap: 34px;
  border-bottom: 1px solid var(--landing-border-strong);
}

.landing-audience-option {
  position: relative;
  padding: 10px 0 13px;
  margin-bottom: -1px;
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--landing-faint);
  text-decoration: none;
  transition: color 0.15s ease;
}

/* The rule under a tab: full width when current, grows from the left on hover. */
.landing-audience-option::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--landing-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.landing-audience-option:hover {
  color: var(--landing-ink);
  text-decoration: none;
}

.landing-audience-option:hover::after {
  transform: scaleX(0.35);
}

.landing-audience-option[aria-current="page"] {
  color: var(--landing-ink);
  font-weight: 600;
}

.landing-audience-option[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Wide tracking breaks Devanagari shaping and looks loose in CJK (as .landing-eyebrow). */
.landing-audience-option:lang(hi),
.landing-audience-option:lang(ja),
.landing-audience-option:lang(ko),
.landing-audience-option:lang(zh-hans) {
  letter-spacing: 0.06em;
  font-size: 14px;
}

@media (max-width: 480px) {
  .landing-audience {
    gap: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-audience-option,
  .landing-audience-option::after {
    transition: none;
  }
}

/* Three things to do here, each with its own button. The button sits on the card's floor,
   so three cards with texts of different length still end on one line. */
.landing-offers {
  padding: 0 0 72px;
}

.landing-offer {
  display: flex;
  flex-direction: column;
}

body.landing-page .landing-offer h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
}

.landing-offer p {
  flex: 1;
}

.landing-offer .landing-btn {
  align-self: flex-start;
  margin-top: 20px;
}

/* «Как это работает»: one slide per scenario, the steps of each as numbered cards. The track
   scrolls sideways with snap, so a swipe works without the script. static/js/landing-how.js
   turns on the tabs (.is-ready). Wider than 860px the track stays as tall as the tallest
   slide, so the section below does not jump; cards keep their own height (flex-start).
   At 860px and below the cards stack and the track follows the current slide. */
.landing-how {
  padding: 64px 0 56px;
}

.landing-how .landing-steps-head {
  margin-bottom: 18px;
}

/* The scenarios as tabs in the same voice as «Для ребёнка / Для себя» above: spaced monospace
   caps on one hairline, the teal rule under the current one. On a phone the row is wider than
   the screen and scrolls; the script keeps the current tab in view. */
.landing-how-tabs {
  display: none;
  gap: 34px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 34px;
  border-bottom: 1px solid var(--landing-border-strong);
  overflow-x: auto;
  scrollbar-width: none;
}

.landing-how-tabs::-webkit-scrollbar {
  display: none;
}

.landing-how.is-ready .landing-how-tabs {
  display: flex;
}

.landing-how-tab {
  position: relative;
  flex: none;
  padding: 10px 0 13px;
  border: 0;
  background: none;
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--landing-faint);
  cursor: pointer;
  transition: color 0.15s ease;
}

.landing-how-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--landing-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.landing-how-tab:hover {
  color: var(--landing-ink);
}

.landing-how-tab:hover::after {
  transform: scaleX(0.35);
}

.landing-how-tab[aria-selected="true"] {
  color: var(--landing-ink);
  font-weight: 600;
}

.landing-how-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.landing-how-tab:lang(hi),
.landing-how-tab:lang(ja),
.landing-how-tab:lang(ko),
.landing-how-tab:lang(zh-hans) {
  letter-spacing: 0.06em;
  font-size: 14px;
}

.landing-how-track {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* room for the cards' shadows, which the scroll box would cut */
  margin: 0 -12px;
  transition: height 0.25s ease;
}

.landing-how-track::-webkit-scrollbar {
  display: none;
}

/* With the tabs on, only a tap on a tab switches the scenario: a sideways swipe over the steps
   must not. landing-how.js still moves the track itself; without the script the slides scroll.
   No snap either: it is there for the swipe, and it stops the script's smooth scroll. */
.landing-how.is-ready .landing-how-track {
  overflow-x: hidden;
  scroll-snap-type: none;
}

.landing-how-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 12px 30px;
  scroll-snap-align: start;
}

/* The scenario's name over its steps: needed only while the tabs are not there (no script). */
body.landing-page .landing-how-title {
  margin: 0 0 22px;
  text-align: center;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--landing-accent-ink);
}

/* With the tabs on, the name is on the tab and in the slide's aria-label. Not the usual
   absolute "visually hidden": an absolute box escapes the track's clipping and widens the page. */
.landing-how.is-ready .landing-how-title {
  display: none;
}

/* A step carries its number in the caption voice: the steps are a sequence, not a set. */
.landing-how .landing-steps-grid {
  counter-reset: how-step;
}

.landing-how .landing-step {
  counter-increment: how-step;
}

.landing-how .landing-step::before {
  content: counter(how-step, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-family: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--landing-accent);
}

@media (max-width: 480px) {
  .landing-how-tabs {
    gap: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-how-track,
  .landing-how-tab,
  .landing-how-tab::after {
    transition: none;
  }
}

/* Second-rank button: the first screen keeps the only filled one. */
.landing-btn-quiet {
  padding: 10px 16px;
  background: var(--landing-accent-soft);
  color: var(--landing-accent-ink);
}

.landing-btn-quiet:hover {
  background: var(--landing-accent-ink);
  color: #fff;
  text-decoration: none;
}

.landing-pricing {
  padding: 56px 0 84px;
  border-top: 1px solid var(--landing-border);
}

.landing-pricing-head {
  text-align: center;
  max-width: 42ch;
  margin: 0 auto 36px;
}

.landing-pricing-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

.landing-pricing-head p {
  color: var(--landing-muted);
  font-size: 16px;
  margin: 12px 0 0;
  line-height: 1.5;
}

/* Три карточки. Сверху и заметнее всего ярлык тарифа (Неспешно / Спокойно / Усердно —
   сколько работы в месяц), под ним цена и число проверенных заданий, внизу тихо название
   тарифа (Бесплатно / Тариф S / Тариф M). Название постоянное, ярлык может меняться. */
.landing-pricing-ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 56rem;
  margin: 0 auto;
}

.landing-pricing-tier {
  padding: 26px 20px 22px;
  text-align: center;
  border: 1px solid var(--landing-border);
  border-radius: 16px;
  background: var(--landing-surface);
  box-shadow: var(--landing-shadow);
}

.landing-pricing-plan {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--landing-accent-ink);
}

.landing-pricing-amount {
  font-family: var(--gals-font-display);
  font-size: clamp(30px, 4.4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--landing-ink);
  margin: 12px 0 0;
  line-height: 1.1;
}

.landing-pricing-amount span {
  font-family: var(--gals-font-body, inherit);
  font-size: 0.4em;
  font-weight: 500;
  color: var(--landing-muted);
  letter-spacing: 0;
}

/* Знак валюты — того же размера, что и сумма (иначе «1790 ₽» читается как «1790» с пылинкой). */
.landing-pricing-amount .landing-pricing-currency {
  font-family: var(--gals-font-body, inherit);
  font-size: 1em;
  font-weight: 650;
  color: inherit;
  letter-spacing: 0;
}

.landing-pricing-detail {
  font-size: 16px;
  color: var(--landing-ink);
  margin: 14px 0 0;
  line-height: 1.4;
}

.landing-pricing-tag {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--landing-faint);
}

.landing-pricing-usd-note {
  text-align: center;
  margin: 18px auto 0;
  font-size: 14px;
  color: var(--landing-muted);
}

.landing-pricing-cta-row {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.landing-pricing-cta-row .landing-btn {
  min-width: 11.5rem;
  justify-content: center;
}

/* Телефон: карточка — одна компактная строка (имя и число заданий слева, цена справа), чтобы
   три карточки не превращались в экран прокрутки. */
@media (max-width: 760px) {
  .landing-pricing-ladder {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 26rem;
  }

  .landing-pricing-tier {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 14px;
    padding: 16px 18px;
    text-align: left;
  }

  .landing-pricing-tier .landing-pricing-plan,
  .landing-pricing-tier .landing-pricing-detail,
  .landing-pricing-tier .landing-pricing-tag {
    grid-column: 1;
  }

  .landing-pricing-tier .landing-pricing-tag {
    margin: 2px 0 0;
  }

  .landing-pricing-tier .landing-pricing-amount {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0;
    text-align: right;
    font-size: 28px;
  }

  .landing-pricing-tier .landing-pricing-detail {
    margin: 4px 0 0;
    font-size: 15px;
  }
}

.landing-pricing-note {
  text-align: center;
  margin: 28px auto 0;
  max-width: 52ch;
  font-size: 13.5px;
  color: var(--landing-faint);
}

.landing-pricing-note a,
.landing-pricing-legal a {
  color: var(--landing-accent-ink);
}

.landing-pricing-legal {
  padding: 0 0 64px;
  text-align: center;
  font-size: 13.5px;
  color: var(--landing-faint);
}

.landing-pricing-legal p {
  margin: 0;
}

body.app-page .landing-pricing {
  padding: 8px 0 28px;
  border-top: none;
}

body.app-page .landing-pricing-head {
  text-align: left;
  margin: 0 0 20px;
  max-width: none;
}

body.app-page .landing-pricing-cta-row {
  justify-content: flex-start;
}

.landing-home-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--landing-accent);
  text-decoration: none;
}

.landing-home-link:hover {
  color: var(--landing-accent-ink);
}

body.auth-page {
  display: flex;
  flex-direction: column;
}

body.auth-page .landing-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  min-height: 100vh;
}

body.auth-page .auth-backdrop-header {
  position: relative;
  z-index: 50;
}

.auth-backdrop {
  position: relative;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* ── Sign-in window (docs/dev/sso.md) ──
   One window for the sign-in page (auth/layout.html, over the night) and over the cabinet
   (app/layout.html, guest_auth.js). White card, one column, the steps of parent/go.html and
   parent/verify_email.html. Anchored from the top, not centred: a shorter step (the child's
   sign-in) must not move the switch out from under the finger. */

.auth-overlay[hidden] {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: max(9vh, 16px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
}

.auth-overlay__scrim {
  position: fixed;
  inset: 0;
  background: rgba(3, 17, 14, 0.55);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.auth-overlay__stage {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
}

.auth-overlay__panel {
  position: relative;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: auth-rise 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* On the sign-in page the backdrop header (z-index 50) sits above the window: start below it,
   or the back and close buttons are hidden under it on a short phone screen. */
body.auth-page .auth-overlay { padding-top: max(9vh, 76px); }

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-overlay__panel { animation: none; }
}

button.auth-overlay__close {
  border: 0;
  padding: 0;
  cursor: pointer;
}

.auth-overlay__close,
.auth-back {
  position: absolute;
  top: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #5c6b64;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-overlay__close { right: 18px; }
.auth-back { left: 18px; }

.auth-overlay__close:hover,
.auth-back:hover {
  color: #14201b;
  background: #f6f8f7;
}

.auth-back-form { margin: 0; }

/* The last line of the window: the address for those who cannot sign in at all. */
.auth-support-note {
  margin: 0;
  padding: 0 36px 24px;
  text-align: center;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: #8a9893;
}

.auth-support-note a { color: #5c6b64; }

.auth-messages {
  list-style: none;
  margin: 0;
  padding: 70px 36px 0;
}

.auth-messages + .auth-card--window { padding-top: 16px; }

.auth-messages li {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 8px;
  background: var(--gals-color-success-bg);
  color: var(--gals-color-success-text);
}

.auth-messages li.error {
  background: rgba(226, 75, 74, 0.1);
  color: #a32d2d;
}

.auth-card--window {
  position: relative;
  padding: 70px 36px 26px;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  color: #14201b;
  text-align: center;
}

.auth-card--window h1 {
  margin: 0;
  font-family: inherit;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: inherit;
}

.auth-eyebrow {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.auth-eyebrow span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f5f57;
  font-size: 12.5px;
  font-weight: 500;
}

.auth-eyebrow span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #14b8a6;
}

.auth-lead {
  margin: 10px 0 0;
  color: #5c6b64;
  font-size: 15px;
  line-height: 1.45;
  text-wrap: balance;
}

.auth-lead strong {
  color: #14201b;
  font-weight: 500;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  text-align: left;
}

.auth-field { margin: 0; }

/* Shared with the child forms (docs/dev/child-uploads-handover.md § 5, stage 2).
   The sign-in window keeps `.input`; both selectors are this one rule. */
.auth-control,
.auth-card--window .input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(20, 32, 27, 0.22);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: #14201b;
  box-shadow: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.auth-control::placeholder,
.auth-card--window .input::placeholder { color: #8a9893; }

.auth-control:focus,
.auth-card--window .input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16);
}

.password-field .auth-control,
.auth-card--window .password-field .input { padding-right: 52px; }

.auth-field.has-error .auth-control,
.auth-card--window .auth-field.has-error .input,
.child-field.has-error .auth-control { border-color: #c47878; }

.auth-field-error {
  margin: 7px 2px 0;
  font-size: 13px;
  line-height: 1.35;
  color: #8f3d3d;
}

.auth-errors {
  background: rgba(226, 75, 74, 0.1);
  color: #a32d2d;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 0 0 4px;
}

.auth-errors .errorlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-submit {
  display: block;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--gals-btn-radius);
  background: var(--gals-btn-main);
  color: #fff;
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

a.auth-submit {
  display: grid;
  place-items: center;
  box-sizing: border-box;
}

.auth-submit[hidden] { display: none; }
.auth-submit:hover { background: var(--gals-btn-main-hover); }
.auth-submit:active { transform: scale(0.99); }

.auth-submit:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

.auth-submit--link {
  display: grid;
  place-items: center;
  margin-top: 26px;
  text-decoration: none;
}

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 0;
}

.auth-forgot,
.auth-text-button,
.auth-chip button {
  font: inherit;
  font-size: 14px;
  color: #5c6b64;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(20, 32, 27, 0.22);
  text-underline-offset: 3px;
}

.auth-forgot:hover,
.auth-text-button:hover { color: #14201b; text-decoration-color: currentColor; }

.auth-chip-row { margin: 14px 0 0; }

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 6px 6px 12px;
  border-radius: 20px;
  background: #f6f8f7;
  font-size: 14px;
}

/* The address breaks only before «@» (a <wbr> in go.html), never mid-word; the chip becomes
   a rounded box instead of a pill when it has to take two lines. */
.auth-chip__email {
  min-width: 0;
  overflow-wrap: anywhere; /* only when a part before «@» alone is wider than the chip */
}

@media (max-width: 480px) {
  .auth-card--window { padding-left: 24px; padding-right: 24px; }
  .auth-chip { font-size: 13px; }
}

.auth-chip button {
  flex: none;
  font-size: 13px;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(20, 32, 27, 0.12);
  border-radius: 999px;
  padding: 2px 10px;
}

.auth-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
}

.auth-legal {
  margin: 22px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #5c6b64;
}

.auth-legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Provider buttons (includes/auth_provider_buttons.html): one width, logo at the left edge,
   label centred; «Last used» sits on the top edge of the button the browser used last. */
.auth-providers {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
}

.auth-provider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 52px;
  border: 1px solid rgba(20, 32, 27, 0.22);
  border-radius: 14px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: #14201b;
  text-decoration: none;
  transition: background 0.12s ease, transform 0.12s ease;
}

.auth-provider:hover { background: #f6f8f7; color: #14201b; }
.auth-provider:active { transform: scale(0.99); }

.auth-provider:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

/* Sign in with Apple, web: white with a black outline is one of the allowed styles. */
.auth-provider--apple { border-color: #000; }

.auth-provider.is-last {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.auth-provider__logo {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-provider__logo--yandex {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fc3f1d;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.auth-provider__last {
  position: absolute;
  right: 14px;
  top: 0;
  transform: translateY(-50%);
  padding: 4px 9px;
  border-radius: 999px;
  background: #ccfbf1;
  box-shadow: 0 0 0 3px #fff;
  color: #0f5f57;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 -8px;
  color: #5c6b64;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(20, 32, 27, 0.12);
}

.auth-submit--soft {
  background: #f6f8f7;
  color: #14201b;
  border: 1px solid rgba(20, 32, 27, 0.12);
}

.auth-submit--soft:hover { background: #edf1ef; }

.auth-errors--top { margin: 22px 0 0; text-align: left; }

/* «Child sign-in»: a switch in the top row, opposite the close button. */
.auth-kid {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  font-size: 14px;
  font-weight: 500;
  color: #5c6b64;
  text-decoration: none;
}

.auth-kid:hover,
.auth-kid[aria-checked="true"] { color: #14201b; }

/* Shared track: the sign-in window (.auth-kid) and the child-form switch (.gals-switch). */
.switch-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: #d5dcd9;
  transition: background 0.16s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.16s ease;
}

.auth-kid[aria-checked="true"] .switch-track,
.gals-switch__input:checked + .switch-track { background: #14b8a6; }
.auth-kid[aria-checked="true"] .switch-track::after,
.gals-switch__input:checked + .switch-track::after { transform: translateX(16px); }

.gals-switch-row { margin: 0.25rem 0 1rem; }

.gals-switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: #5c6b64;
  cursor: pointer;
}

.gals-switch:hover,
.gals-switch:has(.gals-switch__input:checked) { color: #14201b; }

.gals-switch__input {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.gals-switch__input:focus-visible + .switch-track {
  outline: 2px solid #14b8a6;
  outline-offset: 4px;
}

.gals-switch .switch-track { margin-top: 1px; }
.gals-switch__text { min-width: 0; }

.auth-kid:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 4px;
  border-radius: 8px;
}

.auth-child { display: none; }
.auth-card--window.is-kid .auth-child { display: block; }
.auth-card--window.is-kid .auth-adult { display: none; }

/* The code: one real input, laid out by auth_card.js as six cells. */
.auth-card--window .auth-code {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.5em;
  font-variant-numeric: tabular-nums;
}

.auth-code-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.auth-code-cell {
  width: 100%;
  min-width: 0;
  height: 60px;
  border: 1px solid rgba(20, 32, 27, 0.22);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  font: inherit;
  font-size: 24px;
  font-weight: 600;
  color: #14201b;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.auth-code-cell:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16);
}

.auth-code-cells.is-done .auth-code-cell {
  border-color: #14b8a6;
  background: #f0fdfa;
}

.auth-field.has-error .auth-code-cell { border-color: #c47878; }

@media (max-width: 520px) {
  .auth-overlay { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
  .auth-overlay__panel { border-radius: 24px; }
  /* The window scrolls on a short screen: let it pass over the header instead of its top
     (the back and close buttons) hiding under it. */
  body.auth-page .auth-backdrop-header { z-index: 0; }
  .auth-card--window { padding: 66px 20px 22px; }
  .auth-messages { padding: 66px 20px 0; }
  .auth-support-note { padding: 0 20px 20px; }
  .auth-card--window h1 { font-size: 23px; }
  .auth-code-cells { gap: 6px; }
  .auth-code-cell { height: 54px; font-size: 22px; }

  .landing-home-link {
    display: none;
  }
}

/* ── App (logged-in) shell — landing tokens + green actions ── */

body.landing-page.app-page {
  --gals-color-primary: var(--landing-accent);
  --gals-color-primary-hover: var(--landing-accent-ink);
  --gals-color-link: var(--landing-accent);
  --gals-color-link-hover: var(--landing-accent-ink);
}

body.app-page .container.app-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.app-page .app-site {
  margin-bottom: 0;
  background: var(--landing-ground);
  backdrop-filter: none;
}

body.app-page .app-main {
  padding: 28px 0 48px;
}

body.app-page .app-messages {
  margin: 0 0 1.25rem;
}

body.app-page .card {
  border: 1px solid var(--landing-border);
  box-shadow: var(--landing-shadow);
  border-radius: var(--landing-radius);
}

/* ---- Profile screens, cabinet redesign (2026-09-29) ---- */

body.app-page .app-main {
  overflow-x: clip; /* nothing wide (the map's labels) may make the page scroll sideways */
}

/* Head of Tasks / Plan / Progress / Profile: a quiet grey line (whose profile) above the
   course name. Calm pass 2026-10-16: no squared paper, no dash, no monospace caps. */
.profile-head {
  padding: 18px 0 14px;
  margin-bottom: 6px;
}

.profile-head .landing-eyebrow {
  display: block;
  font-family: var(--gals-font-body, inherit);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  color: var(--landing-muted);
}

.profile-head .landing-eyebrow-dot {
  display: none;
}

body.app-page .profile-head h1 {
  margin: 4px 0 0;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  body.app-page .profile-head h1 {
    font-size: 32px;
  }
}

/* Set summary on «Задания»: checked N / M with a segment per task, then the set's facts. */
.today-hud {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) 1.6fr;
  gap: 14px 24px;
  align-items: center;
  margin: 0 0 14px;
  padding: 16px 20px;
  border: 1px solid var(--landing-border);
  border-radius: var(--landing-radius);
  background: var(--landing-surface, #fff);
  box-shadow: var(--landing-shadow);
}

.today-hud .child-subtitle-row {
  margin: 0;
}

.today-hud__checked .hud-num {
  font-size: 1.9rem;
}

/* «Ваше задание» of a test preparation (2026-11-12, core/prep_brief.py): what the person gave,
   in the right half of the summary card; under the counter on a phone. */
.prep-brief {
  min-width: 0;
}

.prep-brief__label {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}

.prep-brief__body {
  display: flex;
  flex-direction: column;
}

.prep-brief__text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gals-color-text);
  max-width: 42rem;
  overflow-wrap: anywhere;
}

.prep-brief__text--folded {
  order: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Without a script: the folded text and «Показать полностью»; open, the full text instead. */
.prep-brief__more {
  order: 1;
}

.prep-brief__more > .prep-brief__text {
  display: none;
}

.prep-brief__more[open] > .prep-brief__text {
  display: block;
}

.prep-brief__more[open] > summary,
.prep-brief__more[open] ~ .prep-brief__text--folded {
  display: none;
}

.prep-brief__more > summary {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--gals-color-accent-hover);
  cursor: pointer;
  list-style: none;
}

.prep-brief__more > summary::-webkit-details-marker {
  display: none;
}

.prep-brief__caption {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  color: var(--gals-color-text);
  overflow-wrap: anywhere;
}

.prep-brief__files {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.prep-brief__thumb,
.prep-brief__pdf {
  display: block;
  width: 60px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--gals-color-border-subtle);
  overflow: hidden;
  background: var(--gals-color-surface);
}

.prep-brief__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prep-brief__pdf {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4px;
  box-sizing: border-box;
  background: var(--gals-color-bg);
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--gals-color-text-muted);
  text-align: center;
  text-decoration: none;
}

.prep-brief__pdf b {
  margin-bottom: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gals-color-danger);
}

.prep-brief__pdf span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prep-brief__note {
  margin: 0.6rem 0 0;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}

/* Tasks as separate cards. The state is said by the badge in the summary line (kept live by
   parent_task_report.js), not by a coloured edge: until 2026-10-16 the left edge took the
   badge's colour, and an unchecked task wore a yellow stripe. */
body.app-page .card.task-list-card,
.card.task-list-card {
  padding: 0;
  border: 0 !important;
  background: none;
  box-shadow: none !important;
}

.task-list-card .task-item--collapsible {
  margin: 0 0 10px;
  padding: 0 18px;
  border: 1px solid var(--landing-border);
  border-radius: 14px;
  background: var(--landing-surface, #fff);
  box-shadow: var(--landing-shadow);
}

.task-list-card .task-item--collapsible:last-child {
  border-bottom: 1px solid var(--landing-border);
}

/* «Set checked»: the map as the video's tree on the night of the landing's tree band. */
.set-moment {
  display: grid;
  grid-template-columns: minmax(280px, 600px) 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 14px 22px;
  border-radius: var(--landing-radius);
  color: #eefbf7;
  background: radial-gradient(ellipse at 18% 60%, var(--gals-color-night-glow) 0%, var(--gals-color-night) 80%);
  overflow: hidden;
}

.set-moment__tree {
  --kt-branch: #2dd4bf;
  --kt-tip: #ccfbf1;
  --kt-fruit: var(--gals-color-accent-warm);
}

/* Beside the roots the legend has the colours of the roots: a dot is the status of the root it names.
   The shared .dash-map--* colours and the badges of the topic list stay as they are. */
.set-moment .dash-map--solid,
.map-hero .dash-map--solid {
  background: #2dd4bf;
}

.set-moment .dash-map--in_progress,
.map-hero .dash-map--in_progress {
  background: var(--kt-root-in-progress);
}

.set-moment .dash-map--gap,
.map-hero .dash-map--gap {
  background: var(--kt-root-gap);
}

.set-moment .dash-map--untouched,
.map-hero .dash-map--untouched {
  background: var(--kt-root-untouched);
}

.set-moment .dash-map--assumed,
.map-hero .dash-map--assumed {
  background: var(--kt-root-assumed);
}

.set-moment__caption {
  min-height: 2.9em;
  white-space: pre-line;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  color: rgba(238, 251, 247, 0.85);
}

.set-moment .hud-label {
  color: rgba(238, 251, 247, 0.7);
}

.set-moment .dash-maplegend {
  margin: 8px 0 10px;
  color: rgba(238, 251, 247, 0.85);
}

.set-moment__link {
  color: #5eead4;
  font-weight: 600;
  text-decoration: none;
}

.set-moment__link:hover {
  color: #ccfbf1;
}

.set-moment-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 18px;
}

.set-moment-next__note {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted, #5c6560);
}

.set-moment-next__note[hidden] {
  display: none;
}

/* The lock on the next-set button, only while it is off. */
.set-moment-next__lock {
  display: none;
  flex: none;
}

.set-moment-next .btn:disabled .set-moment-next__lock {
  display: block;
}

/* «Прогресс»: the map as a tree of its real links (knowledge-tree.js, variant graph). */
.map-hero {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) 1.8fr;
  gap: 10px 28px;
  align-items: center;
  margin: 8px 0 18px;
  padding: 24px 28px;
  border-radius: var(--landing-radius);
  color: #eefbf7;
  background: radial-gradient(ellipse at 65% 55%, var(--gals-color-night-glow) 0%, var(--gals-color-night) 78%);
  overflow: hidden;
}

.map-hero .hud-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(238, 251, 247, 0.62);
}

.map-hero__stats {
  display: grid;
  gap: 10px;
}

.map-hero__stat {
  display: grid;
  grid-template-columns: 12px auto 1fr;
  gap: 10px;
  align-items: baseline;
  margin: 0;
}

.map-hero__stat .dash-dot {
  align-self: center;
}

.map-hero__stat .hud-num {
  color: #eefbf7;
  font-size: 28px;
}

.map-hero__label {
  font-size: 14px;
  color: rgba(238, 251, 247, 0.78);
}

.map-hero__hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(238, 251, 247, 0.55);
}

.map-hero__tree {
  --kt-branch: #2dd4bf;
  --kt-tip: #ccfbf1;
  --kt-fruit: var(--gals-color-accent-warm);
  min-width: 0;
}

/* The map as the roots of the tree (knowledge-tree.js, variant graph): the colour of a root is its
   status, a solid one is the tree's own. Muted or brightened here, in one place. */
.set-moment,
.map-hero,
[data-knowledge-tree][data-variant="graph"] {
  --kt-root-in-progress: #facc15;
  --kt-root-gap: #f87171;
  --kt-root-untouched: #94a3b8;
  --kt-root-assumed: #99f6e4; /* legend dot only: the tree draws these roots in its own branch colour */
}

/* The picture of the map follows the frame the script gives it. */
.kt-pic {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* A tap would otherwise flash a grey rectangle the size of the whole picture. The lit root is the feedback. */
.kt-pic,
.kt-pic * {
  -webkit-tap-highlight-color: transparent;
}

/* The button on the end of the trunk that unfolds the tree: quiet, no text. 44px to press, a ring of 26px. */
.kt-toggle {
  position: absolute;
  top: 0;
  left: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  background: none;
  transform: translateX(-50%);
  cursor: pointer;
}

.kt-toggle span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(204, 251, 241, 0.2);
  border-radius: 50%;
  background: var(--gals-color-night, #03110e);
  color: rgba(204, 251, 241, 0.62);
  transition: color 0.15s, border-color 0.15s;
}

.kt-toggle:hover span {
  border-color: rgba(204, 251, 241, 0.5);
  color: #ccfbf1;
}

.kt-toggle:focus-visible {
  outline: none;
}

.kt-toggle:focus-visible span {
  outline: 2px solid #2dd4bf;
  outline-offset: 2px;
}

.kt-toggle svg {
  display: block;
  transition: transform 0.3s;
}

.kt-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .kt-toggle svg,
  .kt-toggle span {
    transition: none;
  }
}

/* Under the crown (knowledge-tree.js puts the tree before it), so its height never moves the lights. */
.map-hero__caption {
  min-height: 2.9em;
  white-space: pre-line;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  color: rgba(238, 251, 247, 0.85);
}

@media (max-width: 720px) {
  .map-hero {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .map-hero__stats {
    grid-template-columns: 1fr 1fr;
  }

  .map-hero__stats > .hud-label,
  .map-hero__hint {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .today-hud {
    grid-template-columns: 1fr;
  }

  .set-moment {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
}

body.app-page h1 {
  font-family: var(--gals-font-display);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  letter-spacing: -0.01em;
}

body.app-page h2,
body.app-page h3 {
  font-family: var(--gals-font-display);
}

body.app-page .progress-text,
body.app-page .empty {
  color: var(--landing-muted);
}

body.app-page .app-subnav {
  border-bottom: 1px solid var(--landing-border);
  background: var(--landing-surface);
}

body.app-page .app-subnav-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 14px;
}

body.app-page .app-subnav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  margin: -8px 4px -8px -12px;
  color: var(--landing-muted);
  text-decoration: none;
}

body.app-page .app-subnav-back:hover {
  color: var(--landing-accent-ink);
  text-decoration: none;
}

body.app-page .app-subnav-back:focus-visible {
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 2px;
  border-radius: var(--gals-radius-sm);
}

body.app-page .app-subnav-back-icon {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

body.app-page .app-subnav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}

body.app-page .app-subnav-link {
  color: var(--landing-muted);
  text-decoration: none;
  font-weight: 560;
}

body.app-page .app-subnav-link:hover {
  color: var(--landing-accent-ink);
  text-decoration: none;
}

body.app-page .app-subnav-link.is-active {
  color: var(--landing-accent-ink);
  font-weight: 600;
  cursor: default;
}

body.app-page .app-toolbar-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--landing-muted);
  text-decoration: none;
}

body.app-page .app-toolbar-link:hover {
  color: var(--landing-accent-ink);
  text-decoration: none;
}

body.app-page .app-toolbar-sep {
  color: var(--landing-faint);
  padding: 0 6px;
  user-select: none;
}

body.app-page .app-toolbar-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--landing-accent-soft, #e6f5f3);
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

body.app-page .app-toolbar-badge:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

body.app-page .app-toolbar-form {
  display: inline;
}

/* «Children» in the cabinet's header row (includes/app_nav_links.html). */
body.app-page .app-toolbar-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--landing-muted);
  text-decoration: none;
}

body.app-page .app-toolbar-link:hover {
  color: var(--landing-accent-ink);
  text-decoration: none;
}

@media (max-width: 860px) {
  /* Phone: «Children» and «Staff» leave the row for the burger menu; the plan badge and the account
     slot («Log in» / «Log out», one place, never both) stay in the row. Until 2026-10-11 «Children» stood under the cabinet's tabs as if it belonged to
     the open tab, and the row with «Staff» and «Log out» did not fit a staff phone. */
  body.app-page .app-site .landing-nav-end > .landing-staff-link,
  body.app-page .app-site .landing-nav-end > .app-toolbar-link:not(.app-guest-login) {
    display: none;
  }
}

body.app-page .app-toolbar-form .btn-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--landing-muted);
  padding: 0;
}

body.app-page .app-toolbar-form .btn-link:hover {
  color: var(--landing-accent-ink);
}

body.app-page .landing-site-inner {
  gap: 12px;
}

body.app-page .landing-nav-end {
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  /* Шапка телефона — одна строка. У staff (со ссылкой «Служебное») слово GALS скрыто:
     вместе с ним она шире экрана и страница ползёт вбок. `flex-wrap` оставлен запасным: на
     совсем узком экране кнопки уйдут на вторую строку. */
  body.app-page .landing-wrap {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  body.app-page .landing-site-inner {
    height: auto;
    padding-block: 10px;
    gap: 8px;
  }

  /* Слово GALS убираем только там, где шапка иначе не помещается — рядом со ссылкой
     «Служебное» (её видят staff). У остальных оно на месте. */
  body.app-page .landing-site-inner:has(.landing-staff-link) .landing-logo-text {
    display: none;
  }

  body.app-page .landing-site-inner:has(.landing-staff-link) .landing-logo-mark {
    display: block;
  }

  body.app-page .landing-nav-end {
    justify-content: flex-end;
    gap: 6px 8px;
    flex-wrap: wrap;
    /* Без этого блок не сжимается и `flex-wrap` не срабатывает. */
    flex-shrink: 1;
    min-width: 0;
  }

  body.app-page .app-toolbar-badge {
    padding: 0.15rem 0.5rem;
  }

  body.app-page .app-toolbar-link,
  body.app-page .app-toolbar-form .btn-link {
    font-size: 13px;
  }

  body.app-page .lang-picker--landing .lang-picker__trigger {
    padding: 5px 9px;
  }
}

body.app-page .input:focus {
  outline: none;
  border-color: var(--landing-accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* ── Calm pass for the four course tabs (2026-10-16) ─────────────────────────────────────
   Tasks / Plan / Progress / Profile carry `app-course` on <body> (not under the onboarding
   stepper). The rest of the cabinet and the landing are untouched.
   One typeface (Inter, as on the landing: DM Sans has no Cyrillic; only the course title H1
   stays in Literata), a short type scale, three radii, two shadows, three text colours;
   colour only where it means something (a mastery status, a check result). */
body.app-course {
  --gals-font-body: Inter, "Inter Fallback", var(--gals-font-sans);
  font-optical-sizing: auto;
  /* The bundled Inter stops at 600: a 700 left anywhere renders as 600, not a smeared fake bold. */
  font-synthesis-weight: none;
  /* Type scale */
  --gals-text-caption: 13px;
  --gals-text-body: 15px;
  --gals-text-reading: 17px;
  --gals-text-title: 21px;
  --gals-text-display: 28px;
  --gals-text-hero: 40px;
  /* Weights: regular, semibold, bold — nothing in between */
  --gals-weight-regular: 400;
  --gals-weight-semibold: 600;
  --gals-weight-bold: 700;
  /* Text colours */
  --gals-ink-primary: var(--landing-ink);
  --gals-ink-secondary: var(--landing-muted);
  --gals-ink-tertiary: var(--landing-faint);
  --gals-color-text-strong: var(--gals-ink-primary);
  --gals-color-secondary-text: var(--gals-ink-primary);
  /* Radii: controls, cards, pills */
  --gals-radius-control: 8px;
  --gals-radius-card: 14px;
  --gals-radius-pill: 999px;
  --gals-radius-sm: var(--gals-radius-control);
  --gals-radius-md: var(--gals-radius-card);
  --gals-radius-lg: var(--gals-radius-card);
  /* Shadows: the soft card one, and one for what floats above the page */
  --gals-shadow-card: var(--landing-shadow);
  --gals-shadow-raised: 0 8px 24px rgba(15, 23, 42, 0.12);

  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-regular);
}

body.app-course h2,
body.app-course h3,
body.app-course h4 {
  font-family: var(--gals-font-body);
  font-weight: var(--gals-weight-semibold);
}

body.app-course .section-title,
body.app-course .mastery-subject-title {
  font-size: var(--gals-text-reading);
  font-weight: var(--gals-weight-semibold);
  letter-spacing: -0.01em;
  color: var(--gals-ink-primary);
}

body.app-course .subtitle,
body.app-course .strategy-hint,
body.app-course .strategy-intro p,
body.app-course .progress-check-summary,
body.app-course .work-time-assignment {
  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-regular);
  color: var(--gals-ink-secondary);
}

body.app-course .help-text,
body.app-course .task-set-meta,
body.app-course .task-check-by,
body.app-course .task-check-when,
body.app-course .task-check-photos-label {
  font-size: var(--gals-text-caption);
  color: var(--gals-ink-secondary);
}

/* Captions that were monospace caps ("CHECKED", "KNOWLEDGE MAP: 29 TOPICS"): the plain body face. */
body.app-course .hud-label {
  font-family: var(--gals-font-body);
  font-size: var(--gals-text-caption);
  font-weight: var(--gals-weight-semibold);
  letter-spacing: 0;
  text-transform: none;
  color: var(--gals-ink-secondary);
}

body.app-course .map-hero .hud-label,
body.app-course .set-moment .hud-label {
  color: rgba(238, 251, 247, 0.7);
}

/* Numbers in the summary and on the map: the body face like everything else. */
body.app-course .hud-num {
  font-family: var(--gals-font-body);
  font-weight: var(--gals-weight-bold);
  letter-spacing: -0.02em;
}

body.app-course .today-hud__checked .hud-num,
body.app-course .map-hero__stat .hud-num {
  font-size: var(--gals-text-display);
}

body.app-course .hud-num small {
  font-size: var(--gals-text-reading);
  font-weight: var(--gals-weight-semibold);
}

body.app-course .map-hero__label,
body.app-course .set-moment__caption,
body.app-course .map-hero__caption,
body.app-course .set-moment-next__note,
body.app-course .dash-maplegend {
  font-size: var(--gals-text-body);
}

body.app-course .map-hero__hint {
  font-size: var(--gals-text-caption);
}

/* Tabs, buttons, fields */
body.app-course .app-subnav-inner,
body.app-course .app-subnav-link {
  font-size: var(--gals-text-body);
}

body.app-course .app-subnav-link {
  font-weight: var(--gals-weight-semibold);
}

body.app-course .btn-link {
  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-semibold);
}

body.app-course .btn-sm,
body.app-course .btn.btn-sm {
  font-size: var(--gals-text-caption);
}

body.app-course label {
  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-semibold);
}

/* 17px keeps iOS from zooming into a field on focus. */
body.app-course .input,
body.app-course input[type="text"],
body.app-course input[type="number"],
body.app-course input[type="email"],
body.app-course input[type="password"],
body.app-course textarea,
body.app-course select {
  font-family: inherit;
  font-size: var(--gals-text-reading);
  border-radius: var(--gals-radius-control);
}

/* A native <select> wears the same chevron in every browser. */
body.app-course select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 2.25rem;
  background-color: var(--landing-surface, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%235c6b64' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 8px;
  cursor: pointer;
}

body.app-course input[type="checkbox"],
body.app-course input[type="radio"] {
  accent-color: var(--landing-accent);
}

body.app-course .progress-period-field select {
  height: 2.25rem;
  padding: 0.25rem 2.25rem 0.25rem 0.75rem;
  font-size: var(--gals-text-body);
  border: 1px solid var(--landing-border-strong);
  border-radius: var(--gals-radius-control);
  color: var(--gals-ink-primary);
}

body.app-course .progress-period-field {
  font-size: var(--gals-text-body);
}

body.app-course .progress-stat-title {
  font-size: var(--gals-text-caption);
  color: var(--gals-ink-secondary);
}

body.app-course .progress-long-lived {
  font-size: var(--gals-text-body);
}

/* Floating things share the one raised shadow */
body.app-course .mastery-status-picker-menu,
body.app-course .briefing-field-tooltip,
body.app-course .lang-picker--landing .lang-picker__menu,
body.app-course .confirm-dialog,
body.app-course .control-work-modal {
  box-shadow: var(--gals-shadow-raised);
}

body.app-course .photo-stack-remove {
  box-shadow: none;
}

/* Radii on the controls and blocks that carried their own value */
body.app-course .mastery-status-picker-menu,
body.app-course .strategy-plan-mode-btn,
body.app-course .task-report-attach-list img,
body.app-course .photo-stack-thumb,
body.app-course .photo-stack-add,
body.app-course .task-check-photos-link,
body.app-course .task-check-photos-compare-link,
body.app-course .task-recognized-answer-body,
body.app-course .task-recognized-edit-btn {
  border-radius: var(--gals-radius-control);
}

body.app-course .task-check,
body.app-course .task-check-history,
body.app-course .task-recognized-answer,
body.app-course .control-work-topic-list,
body.app-course .task-list-card .task-item--collapsible {
  border-radius: var(--gals-radius-card);
}

/* ── Task cards ── */

body.app-course .task-summary {
  align-items: center;
  padding: 16px 0;
}

body.app-course .task-summary-title {
  font-size: var(--gals-text-reading);
  font-weight: var(--gals-weight-semibold);
  line-height: 1.35;
  color: var(--gals-ink-primary);
}

body.app-course .task-summary-meta,
body.app-course .task-summary-duration,
body.app-course .task-summary-subject,
body.app-course .task-summary-checks {
  font-size: var(--gals-text-caption);
  color: var(--gals-ink-secondary);
}

/* The native ▸ becomes a small chevron at the right edge that turns over when the card is
   open. The <summary> and its keyboard behaviour stay as they were. */
body.app-course .task-summary::before {
  content: none;
}

body.app-course .task-summary::after {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  margin: 0 4px 3px 2px;
  border-right: 1.75px solid var(--gals-ink-tertiary);
  border-bottom: 1.75px solid var(--gals-ink-tertiary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

body.app-course .task-details[open] > .task-summary::after {
  margin-bottom: 0;
  margin-top: 3px;
  transform: rotate(225deg);
}

body.app-course .task-summary:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 2px;
  border-radius: var(--gals-radius-control);
}

body.app-course .task-summary:has(.task-summary-aside) {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

body.app-course .task-summary:has(.task-summary-aside) .task-summary-main {
  grid-column: 1;
  grid-row: 1;
}

body.app-course .task-summary:has(.task-summary-aside) .task-summary-aside {
  grid-column: 2;
  grid-row: 1;
}

body.app-course .task-summary:has(.task-summary-aside)::after {
  grid-column: 3;
  grid-row: 1;
}

@media (max-width: 540px) {
  body.app-course .task-summary:has(.task-summary-aside) {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.app-course .task-summary:has(.task-summary-aside) .task-summary-aside {
    grid-column: 1;
    grid-row: 2;
  }

  body.app-course .task-summary:has(.task-summary-aside)::after {
    grid-column: 2;
    grid-row: 1;
  }
}

/* Pills say what a check found, never «nothing yet»: the pending pill is not drawn (the
   template skips it; this catches the one the page script may bring back). */
body.app-course .task-summary-badge--pending {
  display: none;
}

body.app-course .task-summary-badge,
body.app-course .mastery-status-badge {
  font-size: var(--gals-text-caption);
  font-weight: var(--gals-weight-semibold);
  padding: 2px 10px;
  border-radius: var(--gals-radius-pill);
}

/* ── An opened task reads like a page ── */

body.app-course .task-details-body {
  padding: 0 0 20px;
}

body.app-course .task-body {
  margin-left: 0;
  margin-top: 4px;
}

body.app-course .task-instructions {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: var(--gals-text-reading);
  line-height: 1.6;
  color: var(--gals-ink-primary);
}

/* The thumbs sit at the top right of the text and the text wraps around them: no column
   of its own, so a phone keeps its full width. */
body.app-course .task-instructions:has(> .task-flag) {
  padding-right: 0;
}

body.app-course .task-instructions > .task-flag {
  position: static;
  float: right;
  margin: 0 0 8px 16px;
}

/* The reading column is the text's, not the block's: the thumbs stay at the card's edge. */
body.app-course .task-instructions > :not(.task-flag) {
  max-width: 680px;
}

body.app-course .task-instructions.markdown-body p {
  margin: 0 0 12px;
}

body.app-course .task-instructions.markdown-body ul,
body.app-course .task-instructions.markdown-body ol {
  margin: 4px 0 12px;
}

body.app-course .task-instructions.markdown-body li {
  margin: 4px 0;
}

body.app-course .task-instructions.markdown-body strong {
  font-weight: var(--gals-weight-semibold);
  color: var(--gals-ink-primary);
}

body.app-course .task-instructions.markdown-body table {
  font-size: var(--gals-text-body);
}

body.app-course .task-instructions.markdown-body th {
  font-weight: var(--gals-weight-semibold);
  background: var(--landing-ground);
}

body.app-course .task-instructions.markdown-body th,
body.app-course .task-instructions.markdown-body td {
  border-color: var(--landing-border);
}

/* Headings inside the content («Мини-теория»): the body face, not the serif */
body.app-course .task-instructions h1,
body.app-course .task-instructions h2,
body.app-course .task-instructions h3,
body.app-course .markdown-body h2 {
  margin: 20px 0 8px;
  font-family: var(--gals-font-body);
  font-size: var(--gals-text-title);
  font-weight: var(--gals-weight-semibold);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--gals-ink-primary);
}

body.app-course .task-instructions h4,
body.app-course .task-instructions h5,
body.app-course .task-instructions h6 {
  margin: 16px 0 6px;
  font-family: var(--gals-font-body);
  font-size: var(--gals-text-reading);
  font-weight: var(--gals-weight-semibold);
}

body.app-course .task-instructions > :first-child:not(.task-flag),
body.app-course .task-instructions > .task-flag + * {
  margin-top: 0;
}

/* Real code stays monospace; nothing else does. */
body.app-course .task-instructions code,
body.app-course .task-instructions pre {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.92em;
}

body.app-course .task-instructions a {
  font-weight: var(--gals-weight-semibold);
}

/* A check result is a quiet panel; the verdict is said by the pill in its head, not by a
   coloured edge. */
body.app-course .task-check {
  margin-left: 0;
  background: var(--landing-ground);
  border: 1px solid var(--landing-border);
}

body.app-course .task-check-analysis {
  font-size: var(--gals-text-reading);
  line-height: 1.6;
}

/* Everything under an opened card starts at the card's own text edge (no marker column) */
body.app-course .task-check,
body.app-course .task-check-form,
body.app-course .task-check-history,
body.app-course .task-check-reshoot-hint,
body.app-course .task-report-panel,
body.app-course .task-report-panel--recheck,
body.app-course .task-review-in-progress,
body.app-course .task-recognized-answer,
body.app-course .task-review-result > .task-recognized-answer,
body.app-course [data-check-result] + .task-recognized-answer {
  margin-left: 0;
}

/* The photo's recognised answer, the parent's «checked» box, hints and notes */
body.app-course .task-recognized-answer-summary {
  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-semibold);
  color: var(--gals-ink-secondary);
}

body.app-course .task-recognized-answer-summary::before {
  content: none;
}

body.app-course .task-recognized-answer-summary::after {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  margin: 0 2px 3px auto;
  border-right: 1.5px solid var(--gals-ink-tertiary);
  border-bottom: 1.5px solid var(--gals-ink-tertiary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

body.app-course .task-recognized-answer[open] > .task-recognized-answer-summary::after {
  margin-bottom: 0;
  margin-top: 3px;
  transform: rotate(225deg);
}

body.app-course .task-recognized-answer-body,
body.app-course .task-recognized-answer-body.markdown-body {
  font-size: var(--gals-text-body);
}

body.app-course .task-parent-verified-label {
  font-weight: var(--gals-weight-semibold);
}

body.app-course .photo-quota-note {
  font-size: var(--gals-text-caption);
}

body.app-course .photo-quota-note a {
  font-weight: var(--gals-weight-semibold);
}



/* The row at the top: «Children», «Log out», the language menu */
body.app-course .app-toolbar-link,
body.app-course .app-toolbar-form .btn-link {
  font-size: var(--gals-text-body);
}

@media (max-width: 480px) {
  body.app-course .app-toolbar-link,
  body.app-course .app-toolbar-form .btn-link {
    font-size: var(--gals-text-caption);
  }
}

body.app-course .lang-picker__option,
body.app-course .lang-picker__option-name {
  font-weight: var(--gals-weight-regular);
}

body.app-course .lang-picker__option,
body.app-course .lang-picker__link {
  border-radius: var(--gals-radius-control);
}

body.app-course .dash-seg-item {
  border-radius: var(--gals-radius-pill);
}

/* ── Plan: a document, not a box with its own scrollbar ── */

body.app-course .strategy-editor.is-view-mode .strategy-editor-panes,
body.app-course .strategy-editor.is-view-mode .strategy-pane-preview {
  height: auto;
}

/* Reading the plan: no greyed-out «Save» under it. strategy.js enables it once there are
   unsaved edits, and then it shows; «Accept» of a suggestion never needs edits, so it stays. */
body.app-course .strategy-editor.is-view-mode .strategy-editor-actions:has(> #strategy-save-btn[data-require-dirty="1"]:disabled:only-child) {
  display: none;
}

body.app-course .strategy-plan-preview {
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: var(--gals-text-reading);
  line-height: 1.6;
}

body.app-course .strategy-plan-preview > * {
  max-width: 680px;
}

body.app-course .strategy-plan-preview h2,
body.app-course .strategy-plan-preview h3,
body.app-course .strategy-plan-preview h4 {
  margin: 24px 0 8px;
  font-size: var(--gals-text-title);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

body.app-course .strategy-plan-preview > :first-child {
  margin-top: 0;
  padding-right: 40px; /* the pencil sits in this corner */
}

body.app-course .strategy-plan-preview table {
  font-size: var(--gals-text-body);
}

body.app-course .strategy-plan-mode-btn {
  top: 0;
  right: 0;
}

body.app-course .strategy-textarea {
  font-size: var(--gals-text-reading);
  line-height: 1.6;
}

body.app-course .strategy-plan-mode-label {
  font-size: var(--gals-text-caption);
}

/* ── Progress: the topic list ── */

body.app-course .mastery-read-title {
  font-size: var(--gals-text-body);
  color: var(--gals-ink-primary);
}

body.app-course .mastery-filter-chip {
  font-size: var(--gals-text-caption);
}

/* «Untouched» is the default state and appears on most rows: grey words, no fill. The
   other three keep their coloured pills. */
body.app-course .mastery-status-picker-trigger.mastery-status-badge--untouched,
body.app-course .mastery-read-item > .mastery-status-badge--untouched,
body.app-course .mastery-topic-row > .mastery-status-badge--untouched {
  padding-left: 0;
  padding-right: 0;
  background: none;
  color: var(--gals-ink-tertiary);
  font-weight: var(--gals-weight-regular);
}

/* The chosen option of the menu is ringed with an outline, not a third kind of shadow. */
body.app-course .mastery-status-picker-option.is-selected {
  box-shadow: none;
  outline: 1px solid currentColor;
  outline-offset: -1px;
}

body.app-course .mastery-status-picker-trigger.mastery-status-badge--untouched:hover {
  box-shadow: none;
  color: var(--gals-ink-secondary);
}

/* The picker's chevron is the same thin grey one as everywhere else. */
body.app-course .mastery-status-picker-chevron {
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
  opacity: 0.6;
}

/* The topic archive disclosure: a thin chevron before the title that turns down when the
   row is open. It stays on the left because the right edge of the row belongs to the status
   control, which has a chevron of its own. */
body.app-course .topic-archive-summary {
  flex-wrap: nowrap;
  align-items: center;
}

body.app-course .topic-archive-summary::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  margin: 0 4px 0 2px;
  border-right: 1.5px solid var(--gals-ink-tertiary);
  border-bottom: 1.5px solid var(--gals-ink-tertiary);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

body.app-course .topic-archive[open] > .topic-archive-summary::before {
  transform: rotate(45deg);
}

/* ── Profile: a settings screen (iPhone Settings) ──
   Each .briefing-field is its own white group. A one-line field is a row: the label on the
   left, the value on the right. A textarea gets its label above the group. The «why we ask»
   text that sat behind «?» is a grey line under the group, always shown. The label wrap is
   display: contents, so its label row and its tooltip land in the field's grid. */

body.app-course .profile-settings {
  max-width: 680px;
  margin-top: 32px;
}

body.app-course .profile-settings-form,
body.app-course .profile-settings [data-briefing-form] {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* «About your child» heads the child's fields: the section stacks it over them */
body.app-course .profile-settings .child-briefing-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

body.app-course .profile-settings .section-title {
  margin: 0;
  padding: 0 20px;
  font-size: var(--gals-text-caption);
  font-weight: var(--gals-weight-semibold);
  color: var(--gals-ink-secondary);
}

body.app-course .profile-settings .briefing-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  row-gap: 8px;
  margin: 0;
}

body.app-course .profile-settings .briefing-field-label-wrap {
  display: contents;
}

body.app-course .profile-settings .briefing-field-info-btn {
  display: none;
}

body.app-course .profile-settings .briefing-field-tooltip,
body.app-course .profile-settings .briefing-field-tooltip[hidden] {
  display: block;
  grid-column: 1 / -1;
  grid-row: 3;
  position: static;
  margin: 0;
  padding: 0 20px;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: var(--gals-text-caption);
  line-height: 1.45;
  color: var(--gals-ink-secondary);
}

body.app-course .profile-settings .briefing-field > .form-errors,
body.app-course .profile-settings .briefing-field > .help-text {
  grid-column: 1 / -1;
  grid-row: 4;
  margin: 0;
  padding: 0 20px;
  font-size: var(--gals-text-caption);
}

/* One-line field: a row, label left, value right */
body.app-course .profile-settings .briefing-field:has(> input.input) > .briefing-field-label-wrap > .briefing-field-label-row {
  grid-column: 1;
  grid-row: 1;
  max-width: 22rem;
  min-height: 56px;
  padding: 0 0 0 20px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-right: 0;
  border-radius: var(--gals-radius-card) 0 0 var(--gals-radius-card);
}

body.app-course .profile-settings .briefing-field:has(> input.input) .briefing-field-label-row label {
  font-size: var(--gals-text-reading);
  font-weight: var(--gals-weight-regular);
  color: var(--gals-ink-primary);
}

body.app-course .profile-settings .briefing-field > input.input,
body.app-course .profile-settings .briefing-field > select.language-select {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  height: auto;
  min-height: 56px;
  margin: 0;
  padding: 0 20px 0 16px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-left: 0;
  border-radius: 0 var(--gals-radius-card) var(--gals-radius-card) 0;
  box-shadow: none;
  font-size: var(--gals-text-reading);
  text-align: right;
  color: #3d4a44;
}

/* The language select in a settings row: the value sits right, before the chevron;
   «Other…» opens its text field as a row of its own under it. */
body.app-course .profile-settings .briefing-field > select.language-select {
  padding-right: 2.5rem;
  text-align-last: right;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%235c6b64' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  background-size: 12px 8px;
  cursor: pointer;
}

body.app-course .profile-settings .briefing-field > input.language-other {
  grid-column: 1 / -1;
  grid-row: 2;
  border-left: 1px solid var(--landing-border);
  border-radius: var(--gals-radius-card);
  padding-left: 20px;
  text-align: left;
}

/* Textarea: the label above the group, the text inside it */
body.app-course .profile-settings .briefing-field:has(> textarea) > .briefing-field-label-wrap > .briefing-field-label-row {
  grid-column: 1 / -1;
  grid-row: 1;
  padding: 0 20px;
}

body.app-course .profile-settings .briefing-field:has(> textarea) .briefing-field-label-row label {
  font-size: var(--gals-text-caption);
  font-weight: var(--gals-weight-semibold);
  color: var(--gals-ink-secondary);
}

body.app-course .profile-settings .briefing-field > textarea.input {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  padding: 16px 20px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--gals-radius-card);
  box-shadow: none;
  font-size: var(--gals-text-reading);
  line-height: 1.55;
  resize: none;
  field-sizing: content;
  min-height: 7.5em;
}

/* Focus: the group lightens instead of a ring around one half of the row */
body.app-course .profile-settings .briefing-field > .input:focus,
body.app-course .profile-settings .briefing-field:has(> input.input:focus) > .briefing-field-label-wrap > .briefing-field-label-row {
  outline: none;
  box-shadow: none;
  border-color: var(--landing-border-strong);
  background: #f7faf9;
}

body.app-course .profile-settings .briefing-field > .input:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 2px;
}

/* «Take interests into account»: a switch row, the field opens under it in the same group */
body.app-course .profile-settings .interests-field {
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.app-course .profile-settings .interests-toggle {
  order: 1;
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  margin: 0;
  padding: 0 20px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--gals-radius-card);
  font-size: var(--gals-text-reading);
  font-weight: var(--gals-weight-regular);
  color: var(--gals-ink-primary);
}

body.app-course .profile-settings .interests-field:has(> .interests-body:not([hidden])) .interests-toggle {
  border-bottom-color: #edf1ef;
  border-radius: var(--gals-radius-card) var(--gals-radius-card) 0 0;
}

body.app-course .profile-settings .interests-toggle input {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: var(--landing-border-strong);
  cursor: pointer;
  transition: background 0.2s ease;
}

body.app-course .profile-settings .interests-toggle input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

body.app-course .profile-settings .interests-toggle input:checked {
  background: var(--landing-accent);
}

body.app-course .profile-settings .interests-toggle input:checked::before {
  transform: translateX(20px);
}

body.app-course .profile-settings .interests-toggle input:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 2px;
}

body.app-course .profile-settings .interests-body {
  order: 2;
  margin: 0;
  padding: 14px 20px 16px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-top: 0;
  border-radius: 0 0 var(--gals-radius-card) var(--gals-radius-card);
}

body.app-course .profile-settings .interests-body textarea.input {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: var(--gals-text-reading);
  line-height: 1.55;
  resize: none;
  field-sizing: content;
  min-height: 3.1em;
}

body.app-course .profile-settings .interests-body textarea.input:focus {
  outline: none;
  box-shadow: none;
}

body.app-course .profile-settings .interests-field .interests-note {
  order: 3;
  margin: 8px 0 0;
  padding: 0 20px;
  font-size: var(--gals-text-caption);
  color: var(--gals-ink-secondary);
}

/* Rows outside the form: «Student access», «Delete course» */
body.app-course .profile-settings .settings-group {
  margin-top: 32px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--gals-radius-card);
  overflow: hidden;
}

body.app-course .profile-settings .settings-group--danger {
  margin-top: 48px;
}

body.app-course .profile-settings .settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 20px;
  font-size: var(--gals-text-reading);
  color: var(--gals-ink-primary);
  text-decoration: none;
}

body.app-course .profile-settings .settings-row:hover {
  background: #f7faf9;
}

body.app-course .profile-settings .settings-row__chevron {
  flex: none;
  color: var(--gals-ink-tertiary);
}

body.app-course .profile-settings .settings-row--danger {
  justify-content: center;
  color: #b42318;
}

/* «Cancel / Save»: a floating bar at the bottom of the column, only while there are edits */
body.app-course .profile-settings .settings-savebar {
  position: sticky;
  bottom: 24px;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--landing-border);
  border-radius: 999px;
  box-shadow: var(--gals-shadow-raised);
}

body.app-course .profile-settings-form[data-settings-ready]:not(.is-dirty) .settings-savebar {
  display: none;
}

body.app-course .profile-settings .settings-savebar .btn {
  min-height: 44px;
  margin: 0;
  padding: 0 24px;
  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-semibold);
}

body.app-course .profile-settings .settings-savebar__cancel {
  border: 0;
  background: none;
  color: #3d4a44;
}

body.app-course .profile-settings .settings-savebar__cancel:hover {
  background: #f0f3f2;
}

@media (max-width: 600px) {
  body.app-course .profile-settings .briefing-field-tooltip,
  body.app-course .profile-settings .briefing-field-tooltip[hidden],
  body.app-course .profile-settings .briefing-field > .form-errors,
  body.app-course .profile-settings .interests-field .interests-note,
  body.app-course .profile-settings .section-title,
  body.app-course .profile-settings .briefing-field:has(> textarea) > .briefing-field-label-wrap > .briefing-field-label-row {
    padding: 0 16px;
  }

  body.app-course .profile-settings .briefing-field:has(> input.input) > .briefing-field-label-wrap > .briefing-field-label-row {
    min-height: 52px;
    padding-left: 16px;
  }

  body.app-course .profile-settings .briefing-field > input.input {
    min-height: 52px;
    padding-right: 16px;
  }

  body.app-course .profile-settings .briefing-field > select.language-select {
    padding-right: 2.25rem;
    background-position: right 0.85rem center;
  }

  body.app-course .profile-settings .briefing-field > input.language-other {
    padding-left: 16px;
  }

  body.app-course .profile-settings .briefing-field > textarea.input,
  body.app-course .profile-settings .interests-toggle,
  body.app-course .profile-settings .interests-body,
  body.app-course .profile-settings .settings-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* On a phone the bar is the screen's bottom edge, «Save» takes the width */
  body.app-course .profile-settings .settings-savebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 0;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  }

  body.app-course .profile-settings .settings-savebar__cancel {
    background: #f0f3f2;
  }

  body.app-course .profile-settings .settings-savebar__save {
    flex: 1;
  }

  body.app-course .profile-settings-form.is-dirty,
  body.app-course .profile-settings-form:not([data-settings-ready]) {
    padding-bottom: 80px;
  }
}

.landing-site-footer {
  border-top: 1px solid var(--landing-border);
  padding: 26px 0;
}

.landing-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13.5px;
  color: var(--landing-faint);
}

.landing-foot-links {
  justify-content: center;
  column-gap: 28px;
  row-gap: 10px;
}

.landing-foot-inner a {
  color: var(--landing-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.landing-foot-inner a:hover {
  color: var(--landing-ink, inherit);
}

.legal-page .container {
  max-width: 44rem;
}

.legal-doc {
  padding: 1.5rem 0 3rem;
  line-height: 1.55;
}

.legal-doc h1 {
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

.legal-doc h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.6rem;
}

.legal-doc h3 {
  font-size: 1.05rem;
  margin: 1.1rem 0 0.4rem;
}

.legal-back {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.legal-lead {
  color: var(--muted, #555);
  margin: 0 0 1.25rem;
}

.legal-section {
  margin-bottom: 0.5rem;
}

.legal-note {
  font-size: 0.9rem;
  color: var(--muted, #555);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--border, #ddd);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.legal-table th {
  background: var(--surface-2, #f6f6f6);
}

/* Hero: страницу тетради пишут, фотографируют, проверяют и разбирают ошибку —
   та же сцена, что в промо-ролике. Рисует static/js/check-demo.js. */
.landing-check-demo {
  position: relative;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: 18px;
  box-shadow: var(--landing-shadow-lg);
  padding: 12px;
}

.landing-check-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Под страницей, а не поверх неё, так что поправку «→ 7/8» карточка не закрывает ни на
   телефоне, ни в длинных переводах. Рамка с заголовком видна всегда (бледно) — место
   читается как «здесь будет разбор»; текст проявляется после проверки: --ready от 0 до 1
   ставит check-demo.js. */
.landing-check-card {
  --ready: 0;
  margin: 10px 6px 4px;
  padding: 12px 16px;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border-strong);
  border-radius: 12px;
  box-shadow: var(--landing-shadow);
  opacity: calc(0.45 + 0.55 * var(--ready));
}

.landing-check-card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--landing-accent-ink);
}

.landing-check-card-text {
  opacity: var(--ready);
  transform: translateY(calc((1 - var(--ready)) * 8px));
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--landing-ink);
}

/* «Как в видео»: тёмная полоса с большим деревом, растёт при прокрутке. */
.landing-tree-band {
  background: radial-gradient(ellipse at 75% 65%, var(--gals-color-night-glow) 0%, var(--gals-color-night) 70%);
  color: var(--gals-color-on-night);
  padding: 80px 0;
  overflow: hidden;
}

.landing-tree-band-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}

body.landing-page .landing-tree-band h2 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
  color: var(--gals-color-on-night);
  text-wrap: balance;
}

.landing-tree-band p {
  color: color-mix(in srgb, var(--gals-color-on-night) 78%, transparent);
  font-size: 18px;
  line-height: 1.55;
  margin: 18px 0 0;
  max-width: 34em;
}

.landing-tree-band-video {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 10px 18px;
  border: 1px solid color-mix(in srgb, var(--gals-color-accent-warm) 50%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--gals-color-accent-warm);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.landing-tree-band-video:hover {
  background: color-mix(in srgb, var(--gals-color-accent-warm) 10%, transparent);
  text-decoration: none;
}

/* The film is drawn for a full screen: in the text column its captions shrank to 4-5px. */
.landing-promo-dialog {
  width: min(1280px, 94vw);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #000;
  overflow: visible;
}

.landing-promo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.landing-promo-player {
  display: block;
  width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  background: #000;
}

.landing-promo-close {
  position: absolute;
  top: -44px;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.landing-promo-close:hover {
  background: rgba(255, 255, 255, 0.26);
}

@media (max-width: 860px) {
  /* The vertical cut fills the screen; the close button sits over the picture. */
  .landing-promo-dialog {
    width: min(94vw, calc(88vh * 9 / 16));
  }

  .landing-promo-close {
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
  }
}

.landing-tree-band-art {
  --kt-branch: var(--gals-color-accent-bright);
  --kt-tip: var(--gals-color-accent-pale);
  --kt-fruit: var(--gals-color-accent-warm);
  width: 100%;
  max-width: 560px;
  justify-self: center;
}

@media (max-width: 860px) {
  /* 72px of top air is a desktop measure; on a phone it pushed the CTA below the first screen. */
  .landing-hero {
    padding-top: 28px;
  }

  .landing-hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .landing-tree-band {
    padding: 56px 0;
  }

  .landing-tree-band-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .landing-tree-band-art {
    max-width: 420px;
  }

  .landing-lead {
    max-width: 42ch;
  }

  .landing-steps-grid,
  .landing-steps-grid:has(> :nth-child(5):last-child) {
    grid-template-columns: 1fr;
  }

  .landing-steps-grid:has(> :nth-child(5):last-child) > :nth-child(n),
  .landing-steps-grid:has(> :nth-child(5):last-child) > :nth-child(4),
  .landing-steps-grid:has(> :nth-child(5):last-child) > :nth-child(5) {
    grid-column: auto;
  }
}

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

body.landing-page a:focus-visible,
body.landing-page button:focus-visible,
body.landing-page .landing-task:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 3px;
  border-radius: 8px;
}
/* Documentation */

.docs-main {
  padding: 24px 0 64px;
}

/* /docs/ на всю ширину окна: колонка лендинга (--landing-max, 1120px)
   оставляла пустые поля. /staff/ эту колонку сохраняет — у него нет .docs-wide. */
body.docs-wide .landing-wrap {
  max-width: none;
}

body.landing-page.docs-page .docs-sidebar {
  top: calc(64px + 1rem);
  max-height: calc(100vh - 64px - 2rem);
}

.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 720px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
}

.docs-sidebar {
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 0.75rem;
}

.docs-sidebar > .docs-nav-group + .docs-nav-group {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.docs-nav-group > summary,
.docs-nav-nested > summary {
  cursor: pointer;
}

.docs-nav-group:not([open]) > :not(summary),
.docs-nav-nested:not([open]) > :not(summary) {
  display: none;
}

.docs-nav-group > summary {
  list-style: none;
}

.docs-nav-group > summary::-webkit-details-marker,
.docs-nav-nested > summary::-webkit-details-marker {
  display: none;
}

.docs-nav-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin: 0;
}

.docs-nav-heading.is-current {
  color: #1d4ed8;
}

.docs-nav-group > summary::before,
.docs-nav-nested > summary::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translateY(-0.05rem);
  vertical-align: 0.05rem;
}

.docs-nav-group[open] > summary::before,
.docs-nav-nested[open] > summary::before {
  transform: rotate(45deg) translateY(-0.1rem);
}

.docs-nav-group[open] > summary {
  margin-bottom: 0.35rem;
}

.docs-nav-branch {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: start;
}

.docs-nav-branch > .docs-nav-nested {
  grid-column: 1 / -1;
  grid-row: 1;
}

.docs-nav-branch > .docs-nav-link {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
}

.docs-nav-nested > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  min-height: 2.1rem;
  list-style: none;
}

.docs-nav-nested > summary::before {
  margin-right: 0;
}

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

.docs-nav-link {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #475569;
  text-decoration: none;
}

.docs-nav-link:hover {
  background: #f1f5f9;
  text-decoration: none;
}

.docs-nav-link.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.docs-nav-children {
  margin: 0.15rem 0 0.4rem 0.65rem;
  padding-left: 0.35rem;
  border-left: 1px solid #e2e8f0;
}

.docs-nav-children .docs-nav-link {
  font-size: 0.82rem;
  padding: 0.25rem 0.45rem;
}

.docs-crumbs {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.docs-crumbs a {
  color: #475569;
}

.docs-crumbs span {
  margin: 0 0.35rem;
  color: #94a3b8;
}

.docs-article {
  padding: 1.5rem 1.75rem;
  min-width: 0;
}

.docs-index-section {
  margin-top: 1.5rem;
  scroll-margin-top: 5.5rem;
}

.docs-article .prose h2,
.docs-article .prose h3,
.docs-article .prose h4 {
  scroll-margin-top: 5.5rem;
}

.docs-index-section h2,
.docs-index-section h3,
.docs-index-section h4 {
  margin: 0 0 0.25rem;
}

.docs-index-section h2 {
  font-size: 1.1rem;
}

.docs-index-section h3 {
  font-size: 1rem;
}

.docs-index-section h4 {
  font-size: 0.95rem;
}

.docs-index-section .docs-index-section {
  margin-top: 0.85rem;
  margin-left: 0.15rem;
}

.docs-index-audience {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.docs-index-list {
  margin: 0;
  padding-left: 1.25rem;
}

.docs-index-list li {
  margin-bottom: 0.35rem;
}

.docs-index-children {
  margin: 0.25rem 0 0.6rem 1.1rem;
}

.docs-index-desc {
  color: #64748b;
  font-size: 0.9rem;
}

.docs-index-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

/* Главная «Служебного»: карточки по группам. Число на карточке — сколько ждёт решения. */
.staff-home-title {
  margin-bottom: 0.25rem;
}

.staff-home-group {
  margin-top: 1.75rem;
}

.staff-home-group-title {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--landing-faint);
}

.staff-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.staff-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 1rem 1.1rem;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: var(--gals-radius-md);
  color: var(--landing-ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.staff-card:hover {
  border-color: var(--landing-accent);
  box-shadow: 0 2px 10px rgba(20, 32, 27, 0.07);
  text-decoration: none;
}

.staff-card:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 2px;
}

.staff-card-title {
  font-family: var(--gals-font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.staff-card-desc {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--landing-muted);
}

.staff-card-count {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--landing-muted);
}

.staff-card-count strong {
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--landing-ink);
}

.staff-card-count.is-zero strong {
  color: var(--landing-faint);
  font-weight: 500;
}

.staff-card.is-attention {
  border-color: var(--gals-color-status-gap);
  background: var(--gals-color-status-gap-bg);
}

.staff-card.is-attention .staff-card-count strong {
  color: var(--gals-color-status-gap);
}

/* Staff-таблицы показателей (воронка, метрики ИИ, мониторинг и др.). Базовая — слева, с
   линиями между строками; --num выравнивает числа вправо цифрами одной ширины. */
.staff-glance-all,
.staff-glance-one {
  margin: 0.15rem 0 0.35rem;
}

.staff-glance-all .btn-link,
.staff-glance-one .btn-link,
.staff-row-actions .btn-link {
  font-weight: 600;
  color: var(--gals-color-secondary-text, #334155);
}

.staff-glance-all .btn-link:hover,
.staff-glance-one .btn-link:hover,
.staff-row-actions .btn-link:hover {
  color: var(--landing-ink, var(--gals-color-text));
  text-decoration: underline;
}

.staff-glance-all .btn-link,
.staff-glance-one .btn-link {
  padding-left: 0;
  padding-right: 0;
}

.staff-ops .staff-metrics-table th:first-child,
.staff-ops .staff-metrics-table td:first-child {
  white-space: nowrap;
}

.staff-ops .staff-metrics-table td {
  vertical-align: middle;
}

.staff-metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.staff-metrics-table th,
.staff-metrics-table td {
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--gals-color-border-subtle, #e2e8f0);
}

.staff-metrics-table td:has(> .staff-row-actions) {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}

.staff-row-actions {
  display: grid;
  grid-template-columns: auto max-content;
  align-items: center;
  justify-content: start;
  column-gap: 0.75rem;
  width: 100%;
}

.staff-row-actions form {
  display: flex;
  align-items: center;
  margin: 0;
}

.staff-row-actions .btn-sm,
.staff-row-actions .btn-link {
  height: 2rem;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
  white-space: nowrap;
}

.staff-row-actions .btn-sm {
  min-height: 36px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.staff-row-actions .btn-link {
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 0;
  font-size: 0.85rem;
}

.staff-metrics-table thead th {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gals-color-text-muted, #64748b);
  border-bottom-color: var(--gals-color-border, #cbd5e1);
  white-space: nowrap;
}

.staff-metrics-table tbody th {
  font-weight: 500;
}

.staff-metrics-table--num th:not(:first-child),
.staff-metrics-table--num td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.staff-metrics-table tr.is-zero td,
.staff-metrics-table tr.is-zero th[scope="row"] {
  color: var(--gals-color-text-subtle, #94a3b8);
  font-weight: 400;
}

.staff-metrics-table .funnel-group-row th {
  text-align: center;
}

.staff-metrics-table .funnel-group-row th:first-child {
  text-align: left;
}

.staff-metrics-table .funnel-group-start {
  border-left: 1px solid var(--gals-color-border, #cbd5e1);
}

.staff-metrics-table td.is-muted {
  color: var(--gals-color-text-subtle, #94a3b8);
}

.funnel-fork {
  margin: 0.5rem 0;
  font-size: 0.92rem;
}

.funnel-fork-list {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

/* «С чего начнём?» (templates/parent/new_choice.html): the three offers of the main page inside
   the cabinet. The whole card is the button's hit area; the first card carries the filled one. */
.start {
  gap: 1.75rem;
}

.start-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.start-head .dash-title {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 2.5rem);
  line-height: 1.1;
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.start-card {
  position: relative;
  padding: 28px 26px 26px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.start-card:hover,
.start-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--landing-accent);
  box-shadow: var(--landing-shadow-lg);
}

.start-card--first {
  border-color: color-mix(in srgb, var(--landing-accent) 45%, var(--landing-border));
}

body.landing-page .start-card h2 {
  font-size: 21px;
}

.start-card p {
  font-size: 15px;
  line-height: 1.55;
}

.start-card .landing-btn {
  margin-top: 22px;
}

/* stretched link: a click anywhere on the card follows its button */
.start-card .landing-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
}

.start-card .landing-btn svg {
  transition: transform 0.15s ease;
}

.start-card:hover .landing-btn svg {
  transform: translateX(3px);
}

@media (max-width: 900px) {
  .start-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .start-card {
    padding: 22px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-card,
  .start-card .landing-btn svg {
    transition: none;
  }

  .start-card:hover,
  .start-card:focus-within {
    transform: none;
  }
}

/* The login and password of a new child wait folded
   under the name (includes/person_new_child_fields.html, profile_new_child_fields.html). */
.child-access {
  margin: 0.25rem 0 1.25rem;
}

.child-access > summary {
  display: inline-block;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--landing-accent-ink, var(--gals-color-link));
  list-style: none;
}

.child-access > summary::-webkit-details-marker {
  display: none;
}

.child-access > summary::before {
  content: "+ ";
}

.child-access[open] > summary::before {
  content: "− ";
}

.child-access[open] > summary {
  margin-bottom: 0.75rem;
}

/* «Take interests into account» (templates/includes/interests_field.html): a tick, a line that
   says what it changes, and the field that opens under it. */
.interests-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}

.interests-toggle input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--landing-accent, var(--gals-color-accent));
}

.interests-field .interests-note {
  margin: 0.25rem 0 0;
}

.interests-body {
  margin-top: 0.6rem;
}

.interests-body[hidden] {
  display: none;
}

.interests-body textarea {
  display: block;
  width: 100%;
}

/* Course create: «For a child» stays closed until the box is ticked. No script —
   the checkbox and each radio reveal the fields that follow them. */
.profile-child {
  margin: 0.25rem 0 1.25rem;
}

.profile-child-check {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0 0.55rem 0 0;
  accent-color: var(--landing-accent, var(--gals-color-accent));
  vertical-align: -0.15em;
}

.profile-child-toggle {
  font-weight: 600;
  cursor: pointer;
}

.profile-child-block {
  display: none;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--landing-border, rgba(20, 32, 27, 0.1));
}

#for-child:checked ~ .profile-child-block {
  display: block;
}

.profile-child-choice {
  font-weight: 600;
  cursor: pointer;
}

.profile-child-person {
  margin-bottom: 0.55rem;
}

.profile-child-person > .profile-child-fill,
.profile-child-person > .profile-child-new {
  display: none;
  margin: 0.75rem 0 0.35rem 1.65rem;
}

.profile-child-person > input:checked ~ .profile-child-fill,
.profile-child-person > input:checked ~ .profile-child-new {
  display: block;
}

.profile-child-block > .profile-child-new.is-open {
  display: block;
  margin-bottom: 0.35rem;
}

.school-confirm .interests-field {
  max-width: 32rem;
  margin: 0 0 1.25rem;
}

/* The homework composer (templates/parent/homework_start.html): a block for the task, a block for
   the solution, and the button with its promise — one screen on a phone. */
.hw {
  gap: 1.1rem;
}

.hw-compose {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.hw-compose-lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--gals-color-text-muted);
}

/* One block per thing: its photo zone and, under it, the same thing as typed text. */
.hw-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.hw-block-title {
  margin: 0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gals-color-text-muted);
}

.hw-block .school-drop {
  max-width: none;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  background: #fff;
}

/* A low zone: the mark, the action and its limit on one line. Two of them stacked are
   shorter than one tall tile was. */
.hw-block .school-drop__empty {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.2rem 0.75rem;
  padding: 0.3rem 0;
  text-align: left;
}

.hw-block .school-drop__plus {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.35rem;
}

.hw-block .school-drop__label {
  font-size: 0.98rem;
}

.hw-block .school-drop__hint {
  font-size: 0.82rem;
}

/* The solution is the one thing a check cannot do without: its block is the loud one. */
.hw-block--main .hw-block-title {
  color: var(--landing-accent, var(--gals-color-accent));
}

.hw-block--main .school-drop {
  border-color: color-mix(in srgb, var(--landing-accent, #0d9488) 55%, transparent);
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 45%, #fff);
}

.hw-block--main .school-drop__plus {
  border-color: var(--landing-accent, var(--gals-color-accent));
  background: var(--landing-accent, var(--gals-color-accent));
  color: #fff;
}

.hw-textarea {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  font-family: inherit;
}

.hw-text > summary {
  width: fit-content;
  font-size: 0.9rem;
  color: var(--gals-color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}

.hw-text > summary::-webkit-details-marker {
  display: none;
}

.hw-text > summary:hover {
  color: var(--landing-accent, var(--gals-color-accent));
}

.hw-text[open] > summary {
  margin-bottom: 0.5rem;
}

.hw-compose-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.hw-submit {
  flex: none;
  min-width: 9.5rem;
  padding: 0.8rem 1.4rem;
  font-size: 1.02rem;
}

.hw-compose-note {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--gals-color-text-muted);
}

.hw-compose [hidden] {
  display: none;
}

/* No solution, but a typed task: practice on the topic instead of a check. */
.hw-train {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 60%, #fff);
}

.hw-train p {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.hw-train-btn {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 0.6rem 1rem;
  white-space: normal;
  text-align: left;
  border: 1px solid var(--landing-accent, var(--gals-color-accent));
  background: #fff;
  color: var(--landing-accent, var(--gals-color-accent));
  font-weight: 600;
}

.hw-train-btn:hover,
.hw-train-btn:focus-visible {
  background: var(--landing-accent, var(--gals-color-accent));
  color: #fff;
}

/* Предмет задания: одна строка на всю форму — подпись, поле и недавние предметы чипами. */
.hw-subject {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 1rem 0 1.1rem;
}

.hw-subject:first-child {
  margin-top: 0;
}

.hw-subject__label {
  flex: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gals-color-text-muted);
}

.hw-subject__field {
  position: relative;
  flex: 1;
  min-width: 10rem;
}

.hw-subject__input {
  width: 100%;
  margin: 0;
}

/* Подсказки по мере набора: предметы, уже встречавшиеся у человека. */
.hw-subject__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--gals-color-surface, #fff);
  border: 1px solid var(--gals-color-border, #d5dcd9);
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.hw-subject__option {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.hw-subject__option:hover,
.hw-subject__option.is-active {
  background: var(--gals-color-surface-muted, #f2f4f3);
}

.hw-subject__option mark {
  background: none;
  color: inherit;
  font-weight: 700;
}

/* Условие и предмет: свёрнуты под фото работы, раскрытые — столбиком. */
.hw-clarify {
  margin: 0.9rem 0;
}

.hw-clarify__body {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.hw-clarify__body .hw-subject,
body.app-page.app-onboarding .hw-clarify__body .hw-step {
  margin: 0;
}

/* Заголовок дня над строками плоского списка. */
.hw-day {
  list-style: none;
  margin: 0.9rem 0 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gals-color-text-muted);
}

.hw-day:first-child {
  margin-top: 0;
}

/* «Показать ещё» под списком. */
.hw-more {
  margin: 0.75rem 0 0;
  text-align: center;
}

.hw-compose .photo-quota-note {
  margin: 0;
}

@media (max-width: 480px) {
  .hw-compose {
    padding: 1rem;
  }

  .hw-submit,
  .hw-train-btn {
    width: 100%;
  }
}

/* The month's checks are used up (includes/quota_card.html, docs/dev/quota-limit-screens.md).
   Night, like the landing's night blocks and the knowledge map. Cabinet sans — the mock is
   drawn in Inter, and that face is not loaded for this card. Dots while the month is short,
   a thin bar of the same warm light above that. Plan rows stay one line while the card is
   wide enough; under ~400px they stack, the tag above the count and the price on the right. */
.quota-card {
  container-type: inline-size;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 1rem;
  padding: 18px 20px;
  border-radius: 20px;
  background-color: var(--gals-color-night);
  background-image: radial-gradient(70% 140% at 100% 0%, var(--gals-color-night-glow) 0%, transparent 62%);
  color: var(--gals-color-on-night);
  font-family: var(--gals-font-sans);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quota-card__meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quota-card__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quota-card__dot {
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 6px rgba(253, 230, 138, 0.75);
}

.quota-card__dot.is-empty {
  background: transparent;
  box-shadow: none;
  border: 1.5px solid rgba(238, 251, 247, 0.35);
}

.quota-card__bar {
  width: 96px;
  height: 6px;
  border-radius: 999px;
  background: rgba(238, 251, 247, 0.16);
  overflow: hidden;
}

.quota-card__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #fde68a;
  box-shadow: 0 0 6px rgba(253, 230, 138, 0.75);
}

.quota-card__count {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  color: #9fb5ae;
}

.quota-card__title {
  margin: 0;
  font-family: var(--gals-font-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--gals-color-on-night);
}

.quota-card__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #b9cbc5;
}

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

.quota-card__plans:has(> :only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.quota-card__plan {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  min-width: 0;
  padding: 8px 14px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(238, 251, 247, 0.16);
  background: rgba(238, 251, 247, 0.04);
  color: var(--gals-color-on-night);
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
}

.quota-card__plan:hover,
.quota-card__plan:focus-visible {
  text-decoration: none;
  border-color: rgba(238, 251, 247, 0.4);
  color: var(--gals-color-on-night);
}

.quota-card__plan:focus-visible {
  outline: 2px solid var(--gals-color-accent-bright);
  outline-offset: 2px;
}

.quota-card__plan-text {
  display: contents;
}

.quota-card__tag {
  font-weight: 600;
  color: var(--gals-color-accent-bright);
}

.quota-card__quota {
  min-width: 0;
  color: #b9cbc5;
}

.quota-card__price {
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
}

.quota-card__note {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #8aa39b;
}

.quota-card--hero {
  align-items: center;
  margin: 0;
  padding: 36px 36px 30px;
  border-radius: 28px;
  gap: 16px;
  text-align: center;
  background-image: radial-gradient(80% 90% at 50% -20%, var(--gals-color-night-glow) 0%, transparent 70%);
}

.quota-card--hero .quota-card__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(238, 251, 247, 0.16);
  background: rgba(238, 251, 247, 0.04);
  color: var(--gals-color-accent-bright);
}

.quota-card--hero .quota-card__dot {
  width: 9px;
  height: 9px;
}

.quota-card--hero .quota-card__title {
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.quota-card--hero .quota-card__text {
  max-width: 36rem;
  font-size: 16px;
}

.quota-card--hero .quota-card__plans {
  width: 100%;
  margin-top: 8px;
  text-align: left;
}

.quota-card--hero .quota-card__plan {
  justify-content: space-between;
  min-height: 52px;
  border-radius: 16px;
}

.quota-card--hero .quota-card__plan-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.quota-card--hero .quota-card__tag {
  font-size: 13px;
}

.quota-card--hero .quota-card__quota {
  font-size: 15px;
  color: var(--gals-color-on-night);
}

.quota-hero {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

.quota-checked-link {
  margin: 0;
  text-align: center;
}

.quota-checked-link a {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.quota-lock {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 100%;
  margin: 2px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: #14201b;
  font-size: 13px;
  line-height: 1.35;
}

.quota-lock svg {
  flex: none;
  margin-top: 2px;
}

.start-card .quota-lock + .landing-btn {
  margin-top: 14px;
}

/* Inside a task the month is used up (includes/check_quota_info.html). A quiet line,
   not a dead button. docs/dev/quota-limit-screens.md place 5. */
.quota-again {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #5c6b64;
}

.quota-again svg {
  flex: none;
}

.quota-again__sep {
  color: #b6c2bd;
}

.quota-again a {
  font-weight: 600;
  text-decoration: none;
}

/* Five or fewer checks left (includes/check_quota_warning.html). Light row.
   Dots are teal here: they sit on #f3f5f4. The night card keeps the warm dots.
   docs/dev/quota-limit-screens.md place 6. */
.quota-remain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0.65rem 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f3f5f4;
}

.quota-remain[hidden] {
  display: none !important;
}

.quota-remain__meter {
  flex: none;
}

.quota-remain__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quota-remain__dot {
  box-sizing: border-box;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0d9488;
}

.quota-remain__dot.is-empty {
  background: transparent;
  border: 1.5px solid #8fa79f;
}

.quota-remain__bar {
  display: block;
  width: 96px;
  height: 6px;
  border-radius: 999px;
  background: #e1e7e4;
  overflow: hidden;
}

.quota-remain__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0d9488;
}

.quota-remain__text {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #14201b;
}

.quota-remain__plans {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* A check refused after the button was pressed (app/layout.html, extra_tags=quota).
   docs/dev/quota-limit-screens.md place 9. */
.messages li.quota {
  padding: 0;
  background: transparent;
  color: inherit;
}

.quota-flash {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--gals-color-night);
  color: var(--gals-color-on-night);
  box-shadow: 0 12px 32px rgba(3, 17, 14, 0.18);
  font-family: var(--gals-font-sans);
}

.quota-flash__flame {
  flex: none;
  margin-top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fde68a;
  box-shadow: 0 0 8px rgba(253, 230, 138, 0.75);
}

.quota-flash__body {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quota-flash__title {
  margin: 0;
  font-family: var(--gals-font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--gals-color-on-night);
}

.quota-flash__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #b9cbc5;
}

.quota-flash__plans {
  flex: none;
  align-self: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gals-color-accent-bright);
  text-decoration: none;
  white-space: nowrap;
}

.quota-flash__plans:hover,
.quota-flash__plans:focus-visible {
  color: var(--gals-color-accent-bright);
  text-decoration: none;
}

/* Technical ceiling on new sets (includes/assignment_ceiling.html). No tariff.
   docs/dev/quota-limit-screens.md place 10. */
.set-ceiling {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 100%;
  margin: 0;
}

.set-ceiling__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 20px;
  border-radius: 999px;
  background: #eef1f0;
  color: #7b8a84;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.set-ceiling__pill svg {
  flex: none;
}

.set-ceiling__note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #5c6b64;
}

@container (max-width: 400px) {
  .quota-card {
    padding: 16px;
    border-radius: 18px;
  }

  .quota-card__plans,
  .quota-card--hero .quota-card__plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .quota-card__plan,
  .quota-card--hero .quota-card__plan {
    justify-content: space-between;
    min-height: 52px;
  }

  .quota-card__plan-text,
  .quota-card--hero .quota-card__plan-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .quota-card__tag {
    font-size: 12px;
  }

  .quota-card--hero {
    padding: 28px 16px 22px;
  }

  .quota-card--hero .quota-card__title {
    font-size: 22px;
  }
}

/* The wall of unclosed sets (includes/unclosed_sets_wall.html). Today and homework keep
   the include inside a white .card; the card chrome would box the night strip and, on
   .ai-actions, shrink the wall to a flex row. The wall draws its own cards. */
body.app-page .card:has(.set-wall) {
  display: block;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.set-wall {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* The wall under the tree of a night frame (a first set that failed, or is not on its way, with five sets
   open): the night frame has no side padding of its own and its text was made for a light page. The wall
   stands in the column of the frame and is read on the night; the plan card at its end gets an edge. */
body.app-page.app-onboarding.app-onboarding--night .card:has(.set-wall) {
  max-width: 62rem;
  margin: 24px auto 0;
  padding: 0 24px;
}

body.app-page.app-onboarding.app-onboarding--night .set-wall__title {
  color: var(--gals-color-on-night);
}

body.app-page.app-onboarding.app-onboarding--night .set-wall__count,
body.app-page.app-onboarding.app-onboarding--night .set-wall__intro,
body.app-page.app-onboarding.app-onboarding--night .set-wall__prep {
  color: #b9cbc5;
}

body.app-page.app-onboarding.app-onboarding--night .set-wall__slot {
  background: #2dd4bf;
}

body.app-page.app-onboarding.app-onboarding--night .set-wall__slot.is-empty {
  background: rgba(255, 255, 255, 0.18);
}

body.app-page.app-onboarding.app-onboarding--night .set-wall__more {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.set-wall__lead {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.set-wall__meter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.set-wall__slots {
  display: flex;
  gap: 4px;
}

.set-wall__slot {
  width: 26px;
  height: 6px;
  border-radius: 999px;
  background: #0f766e;
}

.set-wall__slot.is-empty {
  background: #e1e7e4;
}

.set-wall__count {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: #5c6b64;
}

body.app-page .set-wall__title {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--landing-ink, #14201b);
}

.set-wall__intro {
  margin: 0;
  max-width: 36rem;
  font-size: 17px;
  line-height: 1.55;
  color: #5c6b64;
}

.set-wall__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-wall__link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 32, 27, 0.06);
  color: var(--landing-ink, #14201b);
  text-decoration: none;
}

.set-wall__link:hover,
.set-wall__link:focus-visible {
  color: var(--landing-ink, #14201b);
  text-decoration: none;
}

.set-wall__link:hover {
  box-shadow: 0 1px 2px rgba(20, 32, 27, 0.06), 0 8px 20px -12px rgba(20, 32, 27, 0.18);
}

.set-wall__link:focus-visible {
  outline: 2px solid var(--gals-color-accent-bright);
  outline-offset: 2px;
}

.set-wall__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e3f4f1;
  color: #0f766e;
}

.set-wall__name {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.set-wall__meta {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  color: #5c6b64;
}

.set-wall__progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.set-wall__checked,
.set-wall__wait {
  font-size: 13px;
  line-height: 1.3;
  color: var(--landing-ink, #14201b);
}

.set-wall__bar {
  display: block;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: #e1e7e4;
  overflow: hidden;
}

.set-wall__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #0d9488;
}

.set-wall__go {
  color: #0f766e;
  font-size: 18px;
  line-height: 1;
}

.set-wall__prep {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #5c6b64;
}

.set-wall__more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border-radius: 24px;
  background-color: var(--gals-color-night);
  background-image: radial-gradient(70% 140% at 100% 0%, var(--gals-color-night-glow) 0%, transparent 62%);
  color: var(--gals-color-on-night);
}

.set-wall__more-text {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.app-page .set-wall__more h2 {
  margin: 0;
  font-family: var(--gals-font-sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--gals-color-on-night);
}

.set-wall__more p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #b9cbc5;
}

.set-wall__plan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--gals-color-accent-bright);
  color: var(--gals-color-night);
  font-family: var(--gals-font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.set-wall__plan:hover,
.set-wall__plan:focus-visible {
  color: var(--gals-color-night);
  text-decoration: none;
}

.set-wall__plan:focus-visible {
  outline: 2px solid var(--gals-color-on-night);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .set-wall__link {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px;
  }

  .set-wall__progress,
  .set-wall__wait {
    grid-column: 2;
    justify-self: start;
  }

  .set-wall__go {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .set-wall__more {
    padding: 20px 16px;
  }
}

.funnel-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

/* Лента посетителя (/staff/funnel/visitor/…): показ страницы — заголовок, под ним его события. */
.funnel-timeline tr.funnel-timeline-page th,
.funnel-timeline tr.funnel-timeline-page td {
  padding-top: 0.9rem;
}

.funnel-timeline tr.funnel-timeline-server td,
.funnel-timeline tr.funnel-timeline-server th {
  color: var(--gals-color-text-muted, #6b7280);
}

.funnel-timeline tr.funnel-timeline-step td,
.funnel-timeline tr.funnel-timeline-funnel td {
  font-weight: 650;
}

.funnel-timeline tr.is-problem td {
  color: var(--gals-color-danger-text, #b91c1c);
}

.funnel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.funnel-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.5rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--gals-color-bg, #f4f6f8);
  border-radius: var(--gals-radius-md, 12px);
}

.funnel-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.funnel-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gals-color-text-muted, #64748b);
}

.funnel-select {
  min-width: 11rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gals-color-border, #cbd5e1);
  border-radius: var(--gals-radius-sm, 8px);
  background: var(--gals-color-surface, #fff);
  font: inherit;
  font-size: 0.9rem;
}

.funnel-since {
  display: flex;
  gap: 0.4rem;
}

.funnel-since .funnel-select {
  min-width: 0;
}

.funnel-date-wrap {
  position: relative;
  display: inline-flex;
}

.funnel-date {
  width: 9.5rem;
  padding-right: 2rem;
  font-variant-numeric: tabular-nums;
}

.funnel-date-native {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.funnel-date-button {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  padding: 0.1rem 0.25rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.funnel-date-button[hidden] {
  display: none;
}

.funnel-time {
  width: 4.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.funnel-select:focus-visible {
  outline: 2px solid var(--gals-color-accent-dark, #0d9488);
  outline-offset: 1px;
}

.funnel-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.funnel-preset {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--gals-color-border, #cbd5e1);
  border-radius: 999px;
  background: var(--gals-color-surface, #fff);
  color: var(--gals-color-text-strong, #1e293b);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.funnel-preset:hover {
  border-color: var(--gals-color-accent-dark, #0d9488);
}

.funnel-apply {
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: var(--gals-radius-sm, 8px);
  background: var(--gals-color-accent-dark, #0d9488);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.funnel-apply:hover {
  background: var(--gals-color-accent-hover, #0f766e);
}

.funnel-reset {
  align-self: center;
  font-size: 0.85rem;
}

.funnel-callout {
  margin: 0.75rem 0;
  padding: 0.65rem 0.9rem;
  border-left: 3px solid var(--gals-color-border, #cbd5e1);
  border-radius: 0 var(--gals-radius-sm, 8px) var(--gals-radius-sm, 8px) 0;
  background: var(--gals-color-bg, #f4f6f8);
  font-size: 0.88rem;
}

.funnel-callout--warn {
  border-left-color: var(--gals-color-accent-warm, #fbbf24);
  background: var(--gals-color-status-in-progress-bg, #fef3c7);
}

.funnel-of {
  font-size: 0.8rem;
  color: var(--gals-color-text-muted, #64748b);
}

/* Воронка (/staff/funnel/): три блока — воронка, откуда пришли, где остановились. Цвета строк
   «Где остановились» — от светлого (ушли с главной) к тёмному (зарегистрировались); оранжевый — окно входа. */
.fd {
  --fd-s1: #d5e4e1;
  --fd-s2: #b3d3cd;
  --fd-s3: #8cbfb6;
  --fd-s4: #5fa69b;
  --fd-s5: #e8a65d;
  --fd-s6: #0f766e;
  --fd-soft: #e6f2f0;
  --fd-warn: #b45309;
  --fd-warn-bg: #fdf3e3;
  --fd-line: var(--gals-color-border-subtle, #e2e8f0);
  --fd-muted: var(--gals-color-text-muted, #64748b);
  --fd-accent: var(--gals-color-accent-dark, #0d9488);
}

.fd-q {
  display: grid;
  gap: 1.1rem;
  min-width: 0;
  margin-top: 2.2rem;
}

.fd-q h2,
.fd-q h3 {
  margin: 0;
}

.fd-q-head {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.fd-q-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.65rem;
  height: 1.65rem;
  border: 1.5px solid var(--fd-accent);
  border-radius: 999px;
  color: var(--fd-accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.fd-q-sub,
.fd-muted {
  margin: 0.15rem 0 0;
  color: var(--fd-muted);
  font-size: 0.88rem;
}

.fd-small {
  font-size: 0.8rem;
  margin: 0;
}

.fd-prose {
  max-width: 70ch;
  margin-top: 0.5rem;
}

.fd-note {
  margin: 0.75rem 0;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  background: var(--fd-warn-bg);
  color: var(--fd-warn);
  font-size: 0.85rem;
}

.fd-more-marks {
  align-self: flex-end;
  font-size: 0.85rem;
}

.fd-more-marks summary {
  cursor: pointer;
  padding: 0.45rem 0;
  color: var(--fd-accent);
}

.fd-more-marks-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 0.5rem;
}

.fd-more summary {
  cursor: pointer;
  color: var(--fd-accent);
  font-size: 0.9rem;
}

.fd-more {
  min-width: 0;
}

.fd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
}

.fd-card {
  display: grid;
  gap: 0.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--fd-line);
  border-radius: 14px;
  color: var(--fd-accent);
}

.fd-card b {
  font-family: var(--gals-font-display, Georgia, serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--gals-color-text-strong, #1e293b);
  font-variant-numeric: tabular-nums;
}

.fd-card small {
  color: var(--fd-muted);
  font-size: 0.8rem;
}

.fd-card svg {
  width: 100%;
  height: 28px;
  margin-top: 0.3rem;
}

.fd-ladder {
  display: grid;
  gap: 0.5rem;
}

.fd-step {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 64px;
  gap: 0.75rem;
  align-items: center;
}

.fd-lbl {
  font-size: 0.9rem;
}

.fd-track {
  position: relative;
  height: 30px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--fd-soft);
}

.fd-fill {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 2px;
  padding-left: 10px;
  border-radius: 8px;
  background: var(--fd-s6);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.fd-val-out {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.fd-conv {
  text-align: right;
  color: var(--fd-muted);
  font-size: 0.78rem;
}

.fd-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.fd-path {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 0.85rem;
  border: 1px solid var(--fd-line);
  border-radius: 14px;
}

.fd-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 2px 0.5rem;
  align-items: center;
  font-size: 0.82rem;
}

.fd-mini .fd-t {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--fd-muted);
  font-size: 0.78rem;
}

.fd-mini .fd-t.is-loss {
  color: var(--fd-warn);
  font-weight: 600;
}

.fd-b {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--fd-soft);
}

.fd-b i {
  display: block;
  height: 100%;
  background: var(--fd-s6);
}

.fd-n {
  text-align: right;
  font-weight: 600;
}

.fd-table th,
.fd-table td {
  white-space: nowrap;
}

.fd-table th:first-child {
  white-space: normal;
}

.fd-table .fd-kind,
.fd-who .fd-kind {
  display: block;
  color: var(--fd-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.fd-share {
  display: inline-block;
  height: 8px;
  margin-left: 8px;
  border-radius: 4px;
  background: var(--fd-accent);
  vertical-align: middle;
}

.fd-flag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--fd-warn-bg);
  color: var(--fd-warn);
  font-size: 0.75rem;
  font-weight: 500;
}

.fd-stack {
  display: flex;
  height: 40px;
  overflow: hidden;
  border-radius: 10px;
}

.fd-stack span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 600;
}

.fd-stack .fd-k6 {
  color: #fff;
}

.fd-k1 { background: var(--fd-s1); }
.fd-k2 { background: var(--fd-s2); }
.fd-k3 { background: var(--fd-s3); }
.fd-k4 { background: var(--fd-s4); }
.fd-k5 { background: var(--fd-s5); }
.fd-k6 { background: var(--fd-s6); }

.fd-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.fd-chip {
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--gals-color-border, #cbd5e1);
  border-radius: 999px;
  color: inherit;
  font-size: 0.82rem;
  text-decoration: none;
}

.fd-chip.on {
  border-color: var(--fd-accent);
  background: var(--fd-accent);
  color: #fff;
}

.fd-alert {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  background: var(--fd-warn-bg);
  color: var(--fd-warn);
  font-size: 0.85rem;
}

.fd-alert p {
  margin: 0 0 0.3rem;
}

.fd-alert summary {
  color: inherit;
  font-weight: 600;
}

.fd-alert .fd-more > :not(summary) {
  color: var(--gals-color-text, #1a1a1a);
}

.fd-stops {
  display: grid;
}

.fd-stop {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--fd-line);
}

.fd-dot {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 4px;
}

.fd-stop h3 {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

.fd-why {
  margin: 0.15rem 0 0;
  color: var(--fd-muted);
  font-size: 0.88rem;
}

.fd-detail {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.fd-num {
  font-family: var(--gals-font-display, Georgia, serif);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: right;
}

.fd-num small {
  display: block;
  color: var(--fd-muted);
  font: 400 0.75rem var(--gals-font-sans, system-ui, sans-serif);
}

.fd-camp tr.is-sub th,
.fd-camp tr.is-sub td {
  color: var(--fd-muted);
  font-size: 0.82rem;
}

.fd-camp tr.is-sub th {
  padding-left: 1.5rem;
}

.fd-camp tr.is-none th,
.fd-camp tr.is-none td {
  color: var(--fd-muted);
}

.fd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.fd-detail .fd-tags {
  margin-top: 0;
}

.fd-tag {
  padding: 3px 10px;
  border: 1px solid var(--fd-line);
  border-radius: 8px;
  font-size: 0.82rem;
}

.fd-reach {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) 44px;
  gap: 4px 0.6rem;
  align-items: center;
  max-width: 560px;
  font-size: 0.82rem;
}

.fd-reach .fd-b {
  height: 12px;
  border-radius: 6px;
}

.fd-reach .fd-b i {
  background: var(--fd-s4);
}

.fd-gap {
  grid-column: 1 / -1;
  padding-left: 2px;
  color: var(--fd-warn);
  font-size: 0.75rem;
}

.fd-whosum {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--fd-soft);
  font-size: 0.82rem;
}

.fd-whohead {
  grid-column: 1 / -1;
}

.fd-k-label {
  color: var(--fd-muted);
}

.fd-who th,
.fd-who td {
  text-align: left;
  font-size: 0.82rem;
}

.funnel-view-as {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .fd-step {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .fd-step .fd-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .fd-stack span {
    font-size: 0;
  }

  .fd-stop {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .fd-num {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .funnel-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .funnel-select,
  .funnel-apply {
    width: 100%;
  }

  .funnel-since .funnel-date-wrap {
    flex: 1;
  }

  .funnel-since .funnel-date {
    width: 100%;
  }

  .funnel-since .funnel-time {
    width: 5.5rem;
  }
}

.alert-table {
  width: 100%;
  border-collapse: collapse;
}

.alert-table th,
.alert-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--gals-color-border-subtle, #e2e8f0);
  vertical-align: top;
}

.alert-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.alert-badge-critical,
.alert-badge-firing {
  color: var(--gals-color-status-gap, #991b1b);
  background: var(--gals-color-status-gap-bg, #fee2e2);
}

.alert-badge-warning {
  color: var(--gals-color-status-in-progress, #92400e);
  background: var(--gals-color-status-in-progress-bg, #fef3c7);
}

.alert-badge-ok {
  color: var(--gals-color-status-solid, #166534);
  background: var(--gals-color-status-solid-bg, #dcfce7);
}

.alert-badge-suppressed,
.alert-badge-unknown {
  color: var(--gals-color-secondary-text, #334155);
  background: var(--gals-color-secondary-bg, #e2e8f0);
}

.alert-fetch-error {
  color: var(--gals-color-error-text, #991b1b);
}

.prose h1 {
  font-size: 1.6rem;
  margin-top: 0;
}

.prose h2 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
}

.prose h3 {
  font-size: 1rem;
  margin-top: 1.25rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0.75rem 0;
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li {
  margin: 0.25rem 0;
}

.prose code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.prose pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}

.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.prose th,
.prose td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background: #f8fafc;
}

.prose a {
  word-break: break-word;
}

.prose .mermaid {
  margin: 1rem 0;
  overflow-x: auto;
  text-align: center;
}

.prose .mermaid svg {
  max-width: 100%;
  height: auto;
}

/* ER-схема: натуральный размер, прокрутка вбок, клик — на весь экран. */
.prose .mermaid-zoomable {
  text-align: left;
  cursor: zoom-in;
}

.prose .mermaid-zoomable svg {
  max-width: none;
}

.mermaid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: auto;
  padding: 1rem;
  background: #fff;
  cursor: zoom-out;
}

.mermaid-overlay svg {
  max-width: none;
  height: auto;
}

.prose .docs-plantuml {
  margin: 1rem 0;
  /* The reading column is narrow; let a wide diagram keep its native size and
     scroll sideways here instead of shrinking to unreadable. Left-aligned, not
     centered: a centered child wider than a scroll container clips its own left
     edge and can't be scrolled back into view. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
}

.prose .docs-plantuml svg,
.prose .docs-plantuml img {
  max-width: none;
  height: auto;
  /* PlantUML draws dark strokes/text assuming a white canvas; its own inline
     background is stripped in core/plantuml.py so height:auto can win. */
  background: #fff;
  border-radius: 6px;
}

.prose .docs-plantuml-full {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  text-align: right;
}

.prose .docs-plantuml-full a {
  color: #64748b;
}

/* Assignment navigation (parent past sets) */

.assignment-nav {
  margin-bottom: 1rem;
  padding: 0;
}

.assignment-nav-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gals-color-text-muted);
  user-select: none;
}

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

.assignment-nav-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
}

.assignment-nav[open] > .assignment-nav-summary::before {
  transform: rotate(90deg);
}

.assignment-nav-summary:hover {
  color: var(--gals-color-text-strong);
}

.assignment-nav-list {
  list-style: none;
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
  border-top: 1px solid var(--gals-color-border-subtle);
}

.assignment-nav-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2rem 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}

.assignment-nav-link:hover {
  background: var(--gals-color-status-untouched-bg);
  text-decoration: none;
}

.assignment-nav-link.is-active {
  background: #dbeafe;
}

.assignment-nav-link--current {
  font-weight: 600;
}

.assignment-nav-date {
  font-weight: 600;
  color: var(--gals-color-text-strong);
  min-width: 0;
  flex: 1 1 12rem;
  line-height: 1.3;
}

.assignment-nav-when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

/* A control work among the past sets: named, so it reads apart from the daily ones. */
.assignment-nav-kind {
  font-weight: 600;
  color: var(--landing-accent, var(--gals-color-accent));
}

@media (max-width: 560px) {
  /* «When» and the result line do not fit one row on a phone: the result goes under. */
  .assignment-nav--secondary .assignment-nav-link {
    grid-template-columns: minmax(0, 1fr);
  }

  .assignment-nav--secondary .assignment-nav-meta {
    text-align: left;
  }
}

.assignment-nav-duration {
  font-weight: 600;
  color: var(--gals-color-text-strong);
  font-variant-numeric: lining-nums tabular-nums;
}

.assignment-nav-range {
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
  line-height: 1.3;
  font-variant-numeric: lining-nums tabular-nums;
}

.assignment-nav-meta {
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
  text-align: right;
  line-height: 1.25;
  align-self: center;
}

.assignment-nav--secondary {
  margin: 1.5rem 0 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.assignment-nav--secondary .assignment-nav-summary {
  padding: 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gals-color-text-subtle);
}

.assignment-nav--secondary .assignment-nav-list {
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--gals-color-border-subtle);
  max-height: 14rem;
}

.task-comment {
  margin: 0.75rem 0 0 2rem;
}

.task-comment-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.task-comment-input {
  margin-bottom: 0.5rem;
  min-height: 3.5rem;
  font-size: 0.9rem;
  resize: vertical;
}

.task-comment-save {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.task-report {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.task-report-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.task-answer-compose {
  position: relative;
}

.task-answer-frame {
  position: relative;
  border: 1px solid rgba(20, 32, 27, 0.16);
  border-radius: 10px;
  background: #fff;
}

.task-answer-resize {
  position: absolute;
  top: 0;
  right: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  appearance: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gals-color-text-subtle);
  cursor: pointer;
}

.task-answer-resize:hover,
.task-answer-resize:focus-visible {
  color: var(--gals-btn-muted);
}

.task-answer-resize:focus-visible {
  outline: 2px solid var(--gals-color-primary);
  outline-offset: -2px;
}

.task-answer-resize__restore,
.task-answer-resize.is-expanded .task-answer-resize__expand {
  display: none;
}

.task-answer-resize.is-expanded .task-answer-resize__restore {
  display: block;
}

.task-answer-frame:has(.task-report-input:focus) {
  outline: 2px solid var(--gals-color-primary);
  outline-offset: 2px;
}

.task-answer-frame .input.task-report-input {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 104px;
  max-height: calc(100dvh - 8.5rem);
  padding: 12px 62px 12px 14px;
}

.task-answer-frame .input.task-report-input:focus {
  outline: none;
  border-color: transparent;
}

.task-report-attach-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.task-report-attach-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 14px 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--landing-accent-ink, #0f766e);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.task-report-attach-link:hover {
  text-decoration: underline;
}

.task-report-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 14px 0;
  padding: 8px 8px 0 0;
  list-style: none;
}

.task-report-attach-list[hidden] {
  display: none;
}

.task-report-attach-list li {
  position: relative;
}

.task-report-attach-list img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}

.task-report-attach-list--dialog {
  margin: 0;
  padding: 8px 8px 0 0;
}

.task-report-attach-list--dialog img {
  width: 72px;
  height: 72px;
}

.task-report-attach-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #5c6b64;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 27, 0.16), 0 1px 2px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.task-report-attach-remove::after {
  content: "";
  position: absolute;
  inset: -11px;
}

.task-report-answer-label {
  font-size: 0.95rem;
}

.task-report-input {
  margin-bottom: 0.65rem;
  min-height: 5.5rem;
  max-height: calc(100dvh - 8.5rem);
  overflow: auto;
  font-size: 0.9rem;
  resize: vertical;
}

.task-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.task-answer-compose + .task-report-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 0.75rem;
  padding: 0.65rem 0 0.35rem;
  background: #fff;
  box-shadow: 0 -10px 10px #fff;
}

.task-flag {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.task-flag-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  gap: 0.4rem;
}

button.task-flag-vote {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.25rem;
  min-width: 2rem;
  min-height: 2rem;
  border: 0;
  background: transparent;
  color: var(--gals-color-text-muted);
  cursor: pointer;
}

button.task-flag-vote:hover,
.task-flag-vote.is-on,
.task-flag-vote[aria-pressed="true"] {
  color: var(--gals-color-link, var(--gals-color-accent));
  background: transparent;
}

.task-flag--feedback {
  margin: 0;
}

.task-revision-toggle {
  cursor: pointer;
  list-style: none;
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
}

.task-revision-toggle::-webkit-details-marker {
  display: none;
}

.task-revision-toggle::before {
  content: "↻ ";
}

.task-revision-body {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: var(--gals-color-bg);
  border-radius: var(--gals-radius-sm);
}

.task-revision-body .draft-revision {
  min-height: 3.5rem;
  font-size: 0.9rem;
  resize: vertical;
}

.task-revision-saved,
.task-revision-warning {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}

.task-revision-saved::before {
  content: "✓ ";
}

.regen-panel {
  margin-top: 1rem;
}

.regen-panel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.regen-panel-count {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}

.regen-clear {
  font-size: 0.85rem;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.ai-actions > .strategy-hint,
.ai-actions > p {
  flex: 1 1 100%;
  width: 100%;
  margin: 0;
}

.ai-actions form {
  display: inline-flex;
  margin: 0;
}

.strategy-textarea {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 0.85rem;
  min-height: 0;
  resize: none;
}

/* ── Subscription page ──
   The standing of the account is a night card (docs/dev/mockups/quota-limit.html §6,
   docs/dev/quota-limit-screens.md). The plan chooser is the landing ladder: a gray
   tray, tag, large price, tasks a month, quiet name. Cabinet sans and Literata —
   the mock is drawn in Inter, and that face is not loaded here. */

body.subscription-page {
  --sub-fs-xs: 0.8125rem;
  --sub-fs-sm: 0.9375rem;
  --sub-fs-md: 1rem;
  --sub-fs-lg: 1.375rem;
  --sub-fs-price: 2.75rem;
  --sub-fs-xl: 1.875rem;
}

body.subscription-page .app-main-inner {
  max-width: 780px;
}

/* The page title has to out-rank the panel headline below it; the shared app h1
   lands within 2px of it, which reads as no hierarchy at all. */
body.subscription-page h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(1.85rem, 5vw, 2.25rem);
}

.sub-plan {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  margin: 0 0 1.6rem;
  padding: 30px 32px 28px;
  border-radius: 28px;
  background-color: var(--gals-color-night);
  background-image: radial-gradient(70% 120% at 100% 0%, #0e3530 0%, transparent 62%);
  color: var(--gals-color-on-night);
  font-family: var(--gals-font-sans);
}

.sub-plan__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  min-width: 0;
}

.sub-plan__identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-plan__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb5ae;
}

.sub-plan__name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
}

.sub-plan__title {
  font-family: var(--gals-font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sub-plan__badge {
  align-self: flex-start;
  margin: 4px 0 0;
  padding: 0.2rem 0.7rem;
  border: 1px solid rgba(238, 251, 247, 0.22);
  border-radius: 999px;
  color: #9fb5ae;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sub-plan__line {
  margin: 4px 0 0;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.45;
  color: #9fb5ae;
}

.sub-plan__count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin: 0;
  min-width: 0;
  text-align: right;
}

.sub-plan__figure {
  font-family: var(--gals-font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.sub-plan__limit {
  font-size: 20px;
  font-weight: 500;
  color: #9fb5ae;
}

.sub-plan__caption {
  font-size: 13px;
  line-height: 1.35;
  color: #9fb5ae;
}

.sub-plan__dots {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.sub-plan__dot {
  flex: 1 1 0;
  min-width: 0;
  height: 6px;
  border-radius: 999px;
  background: #fde68a;
  box-shadow: 0 0 10px rgba(253, 230, 138, 0.55);
}

.sub-plan__dot.is-empty {
  background: rgba(238, 251, 247, 0.16);
  box-shadow: none;
}

.sub-plan__bar {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(238, 251, 247, 0.16);
}

.sub-plan__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #fde68a;
  box-shadow: 0 0 10px rgba(253, 230, 138, 0.45);
}

.sub-plan__notes {
  display: flex;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.sub-plan__note {
  margin: 0;
  max-width: 38ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gals-color-on-night);
}

.sub-plan__note--quiet {
  color: #9fb5ae;
}

body.subscription-page .sub-plans.card {
  padding: 0;
  background: none;
  box-shadow: none;
  border: none;
}

.sub-plans {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.sub-plans-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.sub-plans-head-text {
  min-width: 0;
  flex: 1 1 12rem;
}

.sub-plans-head h2 {
  margin: 0 0 0.3rem;
  font-family: var(--gals-font-display);
  font-size: var(--sub-fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sub-plans-head .plan-picker-currency {
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.sub-plans-lead {
  margin: 0;
  max-width: 58ch;
  font-size: var(--sub-fs-sm);
  line-height: 1.45;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.plan-picker {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.plan-picker-currency {
  display: inline-flex;
  align-self: flex-start;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: #f3f5f4;
}

.plan-picker-currency-option {
  position: relative;
  margin: 0;
}

.plan-picker-currency-option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.plan-picker-currency-option span {
  display: block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--landing-muted, var(--gals-color-text-muted));
  transition: background 0.15s ease, color 0.15s ease;
}

.plan-picker-currency-option:has(input:checked) span {
  background: #14201b;
  color: #fff;
}

.plan-picker-currency-option:has(input:focus-visible) span {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: 2px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0;
  border: none;
  padding: 8px;
  min-width: 0;
  border-radius: 28px;
  background: #f3f5f4;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  margin: 0;
  padding: 26px 18px 22px;
  border: none;
  border-radius: 22px;
  background: transparent;
  text-align: center;
  min-width: 0;
}

/* Selectable plans only — the Free card is a destination, not a radio. */
label.plan-card {
  cursor: pointer;
}

label.plan-card:hover {
  background: rgba(255, 255, 255, 0.55);
}

.plan-card:has(input:checked) {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 32, 27, 0.06), 0 12px 28px rgba(20, 32, 27, 0.06);
}

.plan-card:has(input:focus-visible) {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: 2px;
}

/* A choice mark in the corner says the card is picked by a tap; filled once it is. */
label.plan-card::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(20, 32, 27, 0.32);
  background: #ffffff;
}

label.plan-card:has(input:checked)::before {
  border: 6px solid var(--landing-accent-ink, #0f766e);
}

label.plan-card:has(input:disabled)::before {
  display: none;
}

.plan-card:has(input:disabled) {
  cursor: default;
}

label.plan-card:has(input:disabled):hover {
  background: transparent;
}

.plan-card-body {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* The plan's tag (Неспешно / Спокойно / Усердно): the loud line of the card. */
.plan-card-tag {
  font-size: 15px;
  font-weight: 600;
  color: var(--gals-color-accent-ink, #0f766e);
}

/* The plan's permanent name (Бесплатно / Тариф S / Тариф M): the quiet last line. */
.plan-card-name {
  font-size: 12px;
  font-weight: 500;
  color: #5c6b64;
}

.plan-card-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 10px;
  padding: 0 16px;
  border: 1px solid rgba(20, 32, 27, 0.14);
  border-radius: 999px;
  background: transparent;
  color: #5c6b64;
  font-size: 14px;
  font-weight: 600;
}

.plan-card-price {
  max-width: 100%;
  font-family: var(--gals-font-display);
  font-size: clamp(1.85rem, 14cqi, var(--sub-fs-price));
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--landing-ink, var(--gals-color-text-strong));
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.plan-card-currency,
.plan-card-period {
  font-size: 0.5em;
  font-weight: 600;
}

.plan-card-price-rub {
  display: none;
}

.plan-picker:has(#billing-region-rub:checked) .plan-card-price-usd,
.plan-picker--rub .plan-card-price-usd {
  display: none;
}

.plan-picker:has(#billing-region-rub:checked) .plan-card-price-rub,
.plan-picker--rub .plan-card-price-rub {
  display: inline;
}

/* The legal document by the pay button: with the currency toggle, the chosen currency's own. */
.plan-picker-legal {
  margin: 0.9rem 0 0;
  font-size: var(--sub-fs-sm, 0.85rem);
}

.plan-picker-legal a {
  color: var(--landing-muted, var(--gals-color-text-muted));
  text-decoration: underline;
  text-underline-offset: 3px;
}

.plan-picker-legal a:hover {
  color: var(--landing-accent, var(--gals-color-accent));
}

.plan-picker-legal--toggle .plan-picker-legal-rub,
.plan-picker:has(#billing-region-rub:checked) .plan-picker-legal--toggle .plan-picker-legal-usd {
  display: none;
}

.plan-picker:has(#billing-region-rub:checked) .plan-picker-legal--toggle .plan-picker-legal-rub {
  display: inline;
}

.plan-card-fact {
  font-size: 15px;
  line-height: 1.35;
  color: var(--landing-ink, var(--gals-color-text-strong));
  overflow-wrap: anywhere;
}

.plan-card-note {
  margin: 0;
  max-width: 28ch;
  font-size: var(--sub-fs-xs);
  line-height: 1.35;
  color: #5c6b64;
}

.plan-card-note--quiet {
  margin-top: -0.35rem;
  color: var(--landing-faint, var(--gals-color-text-subtle));
}

/* Leaving a paid plan: available, never loud. */
.plan-card-action {
  align-self: center;
  padding: 0.3rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--gals-color-danger) 35%, transparent);
  border-radius: var(--gals-radius-sm);
  background: none;
  color: var(--gals-color-danger);
  font-family: inherit;
  font-size: var(--sub-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.plan-card-action:hover {
  border-color: var(--gals-color-danger);
  background: color-mix(in srgb, var(--gals-color-danger) 7%, transparent);
}

.plan-card-action:focus-visible {
  outline: 2px solid var(--gals-color-danger);
  outline-offset: 2px;
}

.plan-picker-confirm {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  max-width: 58ch;
  font-weight: 400;
  font-size: var(--sub-fs-sm);
  line-height: 1.45;
  color: var(--landing-muted, var(--gals-color-text-muted));
  margin: 0;
}

.plan-picker-confirm input {
  margin-top: 0.2rem;
  accent-color: var(--landing-accent, var(--gals-color-accent));
}

/* .btn-wide is full-bleed by default — sized for a narrow column, not this one. */
.sub-plans .form-actions {
  margin-top: 0;
}

.sub-plans .btn-wide {
  width: auto;
  min-width: 15rem;
}

@media (max-width: 720px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .sub-plan {
    padding: 22px 16px 20px;
    border-radius: 22px;
    gap: 16px;
  }

  .sub-plan__head,
  .sub-plan__count {
    align-items: flex-start;
    text-align: left;
  }

  .sub-plan__title {
    font-size: 26px;
  }

  .sub-plan__figure {
    font-size: 34px;
  }

  .sub-plans .btn-wide {
    width: 100%;
    min-width: 0;
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.print-pack-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  margin: 0;
}

.print-pack-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  color: var(--gals-color-text-muted);
  text-decoration: none;
}

.print-pack-link:hover {
  color: var(--gals-color-link, var(--gals-color-accent));
  background: var(--gals-color-border-subtle, #e2e8f0);
  text-decoration: none;
}

.print-pack-icon {
  display: block;
}

.section-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.markdown-body {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.markdown-body h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.markdown-body p {
  margin: 0 0 0.65rem;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.35rem;
}

/* Same clip as on a task: a two-digit marker does not fit in 1.35rem. */
.markdown-body ol {
  padding-left: 2.5em;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.65rem 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.markdown-body th {
  background: #f1f5f9;
  font-weight: 600;
}

.job-status-card {
  text-align: center;
}

.job-status-label {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.job-status-hint {
  color: #64748b;
  font-size: 0.875rem;
  margin: 0.75rem 0 0;
}

.job-status-hint--secondary {
  margin-top: 0.35rem;
  opacity: 0.85;
}

.job-status-error {
  color: #b91c1c;
  font-size: 0.9rem;
}

.job-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: #eff6ff;
}

.job-banner--busy {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.job-banner--busy > p {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.job-banner__spinner {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  border: 2px solid rgba(13, 148, 136, 0.2);
  border-top-color: var(--gals-color-accent, #0d9488);
  border-radius: 50%;
  animation: task-photo-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.strategy-intro {
  margin-bottom: 1rem;
}

.strategy-intro.strategy-plan-context {
  box-sizing: border-box;
}

.strategy-plan-context.is-editing p,
.strategy-plan-context.is-editing.strategy-hint {
  white-space: pre-line;
}

.strategy-plan-context.strategy-hint {
  box-sizing: border-box;
}

.strategy-intro p {
  margin: 0;
  color: var(--gals-color-text-muted);
  font-size: 0.95rem;
}

.strategy-next-step {
  margin-bottom: 1rem;
  background: var(--gals-color-success-bg);
  border: 1px solid #86efac;
}

.strategy-next-step-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--gals-color-success-text);
}

.strategy-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--gals-color-text-muted);
}

.strategy-suggestion {
  margin-bottom: 1rem;
}

.strategy-briefing-form {
  margin-bottom: 1rem;
}

.briefing-field {
  margin-bottom: 1rem;
}

.learner-type-picker {
  margin-bottom: 1.25rem;
  border: 0;
  padding: 0;
  min-inline-size: 0;
}

.profile-onboarding-card > h1 {
  margin-bottom: 1rem;
}

.profile-onboarding-card .learner-type-picker {
  margin-bottom: 1.85rem;
}

.learner-type-picker legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 0;
}

/* Переключатель «Для себя / Для ребёнка» — сегментированный: два сегмента, активный подсвечен. */
.learner-type-options {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--gals-color-secondary-bg);
}

.learner-type-option {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.learner-type-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.learner-type-option span {
  display: block;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gals-color-text-muted);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.learner-type-option input:checked + span {
  background: var(--gals-color-surface, #fff);
  color: var(--landing-ink, var(--gals-color-text-strong));
  box-shadow: 0 1px 3px rgba(20, 32, 27, 0.14);
}

.learner-type-option input:focus-visible + span {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: 2px;
}

.briefing-field-label-wrap {
  position: relative;
  margin-bottom: 0.35rem;
}

.briefing-field-label-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.briefing-field-label-row label {
  margin-bottom: 0;
}

.briefing-field-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid var(--landing-border, #d1d5db);
  border-radius: 50%;
  background: var(--gals-color-surface, #fff);
  color: var(--gals-color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.briefing-field-info-btn:hover,
.briefing-field-info-btn[aria-expanded="true"] {
  border-color: var(--gals-color-primary);
  color: var(--gals-color-primary);
}

.briefing-field-info-btn:focus-visible {
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 2px;
}

.briefing-field-tooltip {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--gals-color-text-muted);
  background: var(--gals-color-surface, #fff);
  border: 1px solid var(--landing-border, #e5e7eb);
  border-radius: var(--gals-radius-sm, 6px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.briefing-field-tooltip[hidden] {
  display: none;
}

.strategy-form {
  margin-bottom: 1rem;
}

.strategy-job-banner .job-status-error:not([hidden]) {
  margin-top: 0.75rem;
}

.strategy-job-actions {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.strategy-job-failed .job-status-error {
  margin: 0.5rem 0 0.75rem;
}

.strategy-editor-panes {
  display: grid;
  gap: 0.75rem;
  height: 28rem;
}

.strategy-pane-edit,
.strategy-pane-preview {
  height: 100%;
  min-height: 0;
  position: relative;
}

.strategy-plan-mode-btn {
  position: absolute;
  top: 0.5rem;
  right: 1.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--gals-color-text-muted, #64748b);
  cursor: pointer;
}

.strategy-plan-mode-btn:hover:not(:disabled) {
  color: var(--gals-color-text, #0f172a);
  background: var(--gals-color-surface, #fff);
}

.strategy-plan-mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.strategy-editor.is-edit-mode .strategy-plan-mode-btn--edit {
  display: none;
}

.strategy-editor.is-view-mode .strategy-plan-mode-btn--preview {
  display: none;
}

.strategy-pane-edit {
  display: flex;
  flex-direction: column;
}

.strategy-plan-preview {
  border: 1px solid var(--gals-color-border);
  border-radius: var(--gals-radius-sm);
  padding: 0.75rem 2.25rem 0.75rem 1rem;
  height: 100%;
  max-height: none;
  overflow: auto;
  background: #fafafa;
  box-sizing: border-box;
}

.strategy-edit-hint {
  color: var(--gals-color-text-muted);
  font-size: 0.875rem;
  margin: 0 0 0.65rem;
  flex-shrink: 0;
}

.strategy-editor.is-view-mode .strategy-pane-edit {
  display: none;
}

.strategy-editor.is-edit-mode .strategy-pane-preview {
  display: none;
}

.strategy-editor.is-edit-mode .strategy-textarea {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  resize: none;
  padding-top: 2.25rem;
  padding-right: 2.25rem;
}

.strategy-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.strategy-editor--full-height #strategy-plan-form {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 15rem);
}

.strategy-editor--full-height .strategy-editor-panes {
  flex: 1;
  min-height: 0;
  height: auto;
}

.strategy-editor--full-height .strategy-plan-preview {
  height: 100%;
}

.strategy-editor-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-top: 0.65rem;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .strategy-editor-panes {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .strategy-pane-edit,
  .strategy-pane-preview {
    height: auto;
  }

  .strategy-plan-preview {
    height: auto;
    overflow: visible;
  }

  .strategy-editor-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-top: 0.5rem;
  }

  .strategy-editor-actions .btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .strategy-editor--full-height #strategy-plan-form {
    min-height: calc(100dvh - 17rem);
  }

  .strategy-editor--full-height .strategy-editor-panes {
    height: calc(100dvh - 20rem);
    min-height: 14rem;
  }

  .strategy-editor--full-height .strategy-plan-preview {
    height: 100%;
    overflow: auto;
  }

  .strategy-editor-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-top: 0.5rem;
  }

  .strategy-editor-links .btn-link {
    text-align: center;
    padding: 0.5rem 0;
  }
}

.strategy-editor-links .btn-link {
  padding: 0;
  border: none;
  font: inherit;
  color: var(--gals-color-link);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.strategy-editor-links .btn-link:hover:not(:disabled):not(.is-disabled) {
  color: var(--gals-color-link-hover);
  text-decoration: underline;
}

.strategy-editor-links .btn-link:disabled,
.strategy-editor-links .btn-link.is-disabled,
.strategy-editor-links a.btn-link[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
}

.strategy-inline-link-form {
  display: inline;
  margin: 0;
}

.strategy-editor-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gals-color-border);
}

.strategy-editor-footer form {
  margin: 0;
}

.strategy-secondary-actions {
  margin: -0.5rem 0 1rem;
}

.onboarding-subnav-inner {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding-top: 0.65rem;
  padding-bottom: 0.85rem;
}

.onboarding-stepper {
  width: 100%;
}

.onboarding-stepper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.onboarding-stepper-list-desktop {
  display: flex;
}

.onboarding-stepper-item {
  display: flex;
  align-items: center;
}

.onboarding-stepper-item.is-current .onboarding-stepper-label {
  font-weight: 600;
}

.onboarding-stepper-item.is-done {
  color: var(--gals-color-text-muted);
}

.onboarding-stepper-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}

.onboarding-stepper-link.is-disabled {
  opacity: 0.55;
}

.onboarding-stepper-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--gals-color-border);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.onboarding-stepper-item.is-current .onboarding-stepper-marker {
  border-color: var(--gals-color-accent);
  background: var(--gals-color-accent-soft, rgba(13, 148, 136, 0.12));
}

.onboarding-stepper-item.is-done .onboarding-stepper-marker {
  border-color: var(--gals-color-status-success, #16a34a);
}

.onboarding-stepper-sep {
  width: 1.25rem;
  height: 1px;
  background: var(--gals-color-border);
  list-style: none;
}

.onboarding-step-panel {
  margin-bottom: 1rem;
}

@media (max-width: 720px) {
  .onboarding-stepper-list-desktop {
    display: none;
  }
}

.onboarding-checklist {
  margin-top: 0.65rem;
}

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

.onboarding-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--gals-color-border);
  font-size: 0.95rem;
}

.onboarding-step:last-child {
  border-bottom: none;
}

.onboarding-step.is-done {
  color: var(--gals-color-text-muted);
}

.onboarding-step.is-current .onboarding-step-label {
  font-weight: 600;
}

.onboarding-step-marker {
  width: 1.25rem;
  flex-shrink: 0;
}

.onboarding-step-label {
  flex: 1 1 12rem;
}

.onboarding-step-action {
  margin-left: auto;
}

/* Smaller than the set, for /staff/ rows; a few cabinet places still use it and keep their size. */
.btn-sm {
  min-height: 0;
  padding: 0.3rem 0.65rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.link-warning-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}

.link-warning-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.link-warning-list {
  margin: 0;
  padding-left: 1.25rem;
}

.link-warning-list li + li {
  margin-top: 0.35rem;
}

.link-warning-reason {
  color: #92400e;
  font-size: 0.9rem;
}

.link-warning-hint {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #78350f;
}

.mastery-map-form .section-title {
  margin-top: 0;
}

.mastery-topic-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.mastery-topic-row {
  display: grid;
  gap: 0.35rem 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gals-color-border-subtle);
  border-radius: var(--gals-radius-sm);
  background: var(--gals-color-bg);
}

.mastery-topic-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gals-color-text-muted);
}

.mastery-topic-static {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--gals-color-text);
}

.mastery-topic-static-title {
  font-weight: 600;
}

.mastery-map-form-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.mastery-map-form-header .section-title {
  margin: 0;
}

.mastery-map-read .section-title {
  margin-top: 0;
}

.mastery-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gals-color-border-subtle);
}

.mastery-filter-chip {
  appearance: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0;
  border: none;
  background: none;
  color: var(--gals-color-text-muted);
  cursor: pointer;
  line-height: 1.5;
  text-decoration: none;
}

.mastery-filter-chip.is-active {
  color: var(--gals-color-text-muted);
  opacity: 1;
}

.mastery-filter-chip:not(.is-active) {
  color: var(--gals-color-text-subtle);
  font-weight: 400;
  opacity: 0.28;
}

.mastery-filter-chip:not(.is-active):hover {
  opacity: 0.5;
}

.mastery-filter-chip:focus-visible {
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.mastery-filter-empty {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}

.mastery-filter-empty .btn {
  margin-left: 0.5rem;
  vertical-align: baseline;
}

.mastery-subject-group {
  margin-top: 1.25rem;
}

.mastery-subject-group:first-of-type {
  margin-top: 0;
}

.mastery-subject-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gals-color-text-strong);
}

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

.mastery-read-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--gals-color-border-subtle);
  scroll-margin-top: 6rem;
}

.mastery-read-item[hidden],
.mastery-read-item--filtered-out {
  display: none !important;
}

.mastery-subject-group[hidden],
.mastery-subject-group--filtered-out {
  display: none !important;
}

.mastery-read-item:last-child {
  border-bottom: none;
}

.mastery-read-title {
  flex: 1 1 12rem;
}

.topic-archive {
  flex: 1 1 12rem;
  min-width: 0;
}

.topic-archive-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  cursor: pointer;
  list-style: none;
}

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

.topic-archive-summary::before {
  content: "▸";
  flex-shrink: 0;
  color: var(--gals-color-text-muted);
  transition: transform 0.15s ease;
}

.topic-archive[open] > .topic-archive-summary::before {
  transform: rotate(90deg);
}

.topic-archive .mastery-read-title {
  flex: 1 1 auto;
}

.topic-archive-panel {
  padding: 0.35rem 0 0.15rem;
}

.topic-archive-list {
  margin: 0;
}

.topic-archive-reason {
  margin: 0 0 0.5rem;
}

.topic-archive-earlier-wrap {
  list-style: none;
  margin: 0.75rem 0 0.25rem;
  padding: 0;
}

.topic-archive-earlier {
  margin: 0;
}

.task-check-topic-note {
  margin: 0.15rem 0 0.5rem;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}

.mastery-status-picker {
  position: relative;
  flex: 0 0 auto;
}

.mastery-status-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: none;
  cursor: pointer;
  font: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.mastery-status-picker-trigger:hover {
  box-shadow: 0 0 0 1px var(--gals-color-border-subtle);
}

.mastery-status-picker-trigger:focus-visible {
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 2px;
}

.mastery-status-picker-chevron {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.1rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}

.mastery-status-picker-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 9rem;
  padding: 0.5rem;
  border: 1px solid var(--gals-color-border-subtle);
  border-radius: var(--gals-radius-sm);
  background: var(--gals-color-bg);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.mastery-status-picker-menu[hidden] {
  display: none !important;
}

.mastery-status-picker-option {
  width: 100%;
  justify-content: flex-start;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.mastery-status-picker-option:hover,
.mastery-status-picker-option:focus-visible {
  filter: brightness(0.97);
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 1px;
}

.mastery-status-picker-option.is-selected {
  box-shadow: inset 0 0 0 1px currentColor;
}

.mastery-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.mastery-status-badge--gap {
  background: var(--gals-color-status-gap-bg);
  color: var(--gals-color-status-gap);
}

.mastery-status-badge--in_progress {
  background: var(--gals-color-status-in-progress-bg);
  color: var(--gals-color-status-in-progress);
}

.mastery-status-badge--solid {
  background: var(--gals-color-status-solid-bg);
  color: var(--gals-color-status-solid);
}

.mastery-status-badge--untouched {
  background: var(--gals-color-status-untouched-bg);
  color: var(--gals-color-status-untouched);
}

/* «Assumed known»: pale teal with a dashed edge, between grey «untouched» and solid. */
.mastery-status-badge--assumed {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px dashed #5eead4;
}

.onboarding-step-pending {
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
  margin-right: 0.5rem;
}

/* --- AI task check --- */
.task-check {
  width: auto;
  height: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0.75rem 0 0 2rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gals-color-border-subtle);
  border-left: 4px solid var(--gals-color-border);
  border-radius: 10px;
  background: var(--gals-color-bg);
}
/* Полоска разбора — цвет заливки бейджа, не чернил. */
.task-check--correct { border-left-color: var(--gals-color-status-correct-bg); }
.task-check--minor_errors { border-left-color: var(--gals-color-status-notes-bg); }
.task-check--major_gaps,
.task-check--not_done { border-left-color: var(--gals-color-status-gap-bg); }
.task-check--needs_parent { border-left-color: var(--gals-color-status-untouched-bg); }
.task-check-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  min-width: 0;
}
.task-check-by {
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
  min-width: 0;
}
.task-check-when {
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
  font-variant-numeric: lining-nums tabular-nums;
}
.task-check-analysis {
  font-size: 0.925rem;
  min-width: 0;
  overflow-wrap: break-word;
}
/* Заглушка для гостя: текст гаснет, под ним — тихая строка и обычная кнопка, по левому краю, как сам разбор. */
.task-check-fade {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5rem), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 4.5rem), transparent);
}
.task-check-gate {
  margin-top: 0.4rem;
  padding: 0.5rem 0 0.25rem;
}
.task-check-gate-ghost {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  filter: blur(2.5px);
  opacity: 0.55;
}
.task-check-gate-ghost span {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--gals-color-border-subtle);
}
.task-check-gate-ghost span:nth-child(1) { width: 94%; }
.task-check-gate-ghost span:nth-child(2) { width: 78%; }
.task-check-gate-ghost span:nth-child(3) { width: 56%; }
.task-check-gate .task-check-gate-title {
  margin: 0 0 0.2rem;
  font-weight: 600;
}
.task-check-gate .task-check-gate-note {
  margin: 0 0 0.75rem;
  color: var(--gals-color-text-muted);
}
.task-check-gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.task-check-gate-login {
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
}
@media (prefers-reduced-motion: no-preference) {
  .task-check-gate {
    animation: task-check-gate-in 0.35s ease-out both;
  }
}
@keyframes task-check-gate-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.task-check-photos {
  max-width: 100%;
  box-sizing: border-box;
}
.task-check-photos-label {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--gals-color-text-subtle, #64748b);
}
.task-check-photos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
}
.task-check-photos-item {
  flex: 0 0 4.5rem;
  width: 4.5rem;
  height: 4.5rem;
  max-width: 4.5rem;
  overflow: hidden;
}
.task-check-photos-link {
  display: block;
  flex: 0 0 4.5rem;
  width: 4.5rem;
  height: 4.5rem;
  max-width: 4.5rem;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid var(--gals-color-border, rgba(0, 0, 0, 0.12));
  box-sizing: border-box;
}
.task-check-photos-thumb {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  max-width: 100%;
  object-fit: cover;
}
.task-check-photos--history {
  margin-top: 0.5rem;
}
.task-check-photos--compare {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gals-color-border-subtle, #e2e8f0);
  max-width: 100%;
}
.task-check-photos-compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
}
.task-check-photos-compare-item {
  margin: 0;
  max-width: 100%;
}
.task-check-photos-compare-link {
  display: block;
  max-width: 100%;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid var(--gals-color-border, rgba(0, 0, 0, 0.12));
  background: var(--gals-color-surface, #fff);
}
.task-check-photos-full {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  vertical-align: top;
  background: var(--gals-color-surface-muted, #f1f5f9);
  min-height: 2rem;
}
.task-check-history {
  margin: 0.5rem 0 0 2rem;
  font-size: 0.875rem;
  border: 1px solid var(--gals-color-border-subtle, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--gals-color-surface, #fff);
}
.task-check-history-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.75rem;
  color: var(--gals-color-text-muted);
  user-select: none;
}
.task-check-history-summary::-webkit-details-marker {
  display: none;
}
.task-check-history-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.15s ease;
}
.task-check-history[open] > .task-check-history-summary::before {
  transform: rotate(90deg);
}
.task-check-history-summary:hover {
  color: var(--gals-color-text-strong);
}
.task-check-history-body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--gals-color-border-subtle, #e2e8f0);
}
.task-check-history-item {
  margin-top: 0.75rem;
}
.task-check-history-item .task-check {
  margin-left: 0;
  margin-top: 0.35rem;
}
.task-check-history-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}
.task-check-reshoot-hint {
  margin: 0.75rem 0 0 2rem;
  font-size: 0.925rem;
  color: var(--gals-color-text-strong);
}
.task-check-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.task-check-form { margin-top: 0.5rem; margin-left: 2rem; }
.task-report-panel { margin-top: 0.5rem; margin-left: 2rem; }
.task-report-panel .task-report {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.task-recognized-answer {
  position: relative;
  margin-top: 0.75rem;
  margin-bottom: 0;
  margin-left: 0;
  font-size: 0.875rem;
  border: 1px solid var(--gals-color-border-subtle, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--gals-color-surface, #fff);
  overflow: hidden;
}
.task-check-analysis > .task-recognized-answer {
  margin-top: 0.85rem;
}
.task-review-result > .task-recognized-answer,
[data-check-result] + .task-recognized-answer {
  margin-left: 2rem;
}
.task-recognized-answer-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: var(--gals-color-text-muted, #64748b);
  font-weight: 500;
  list-style: none;
  user-select: none;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.task-recognized-answer-body:has(> .task-flag--recognize) {
  padding-right: 4.75rem;
}
.task-recognized-answer-body > .task-flag--recognize {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  left: auto;
  width: max-content;
  z-index: 1;
  margin: 0;
}
.task-recognized-answer-summary::-webkit-details-marker {
  display: none;
}
.task-recognized-answer-summary::before {
  content: "▸";
  flex-shrink: 0;
  color: var(--gals-color-text-muted, #64748b);
  transition: transform 0.15s ease;
}
.task-recognized-answer[open] > .task-recognized-answer-summary::before {
  transform: rotate(90deg);
}
.task-recognized-answer-summary:hover {
  color: var(--gals-color-text-strong, #0f172a);
  background: var(--gals-color-surface-muted, #f8fafc);
}
.task-recognized-answer-read {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--gals-color-border-subtle, #e2e8f0);
}
.task-recognized-answer:not([open]) .task-recognized-answer-read {
  display: none;
}
.task-recognized-answer-body {
  position: relative;
  padding: 0.75rem 2.25rem 0.75rem 0.9rem;
  border: 1px solid var(--gals-color-border, #e2e8f0);
  border-radius: 0.375rem;
  background: var(--gals-color-surface-muted, #f8fafc);
}
.task-recognized-answer-edit {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--gals-color-border-subtle, #e2e8f0);
}
.task-recognized-edit-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--gals-color-text-muted, #64748b);
  cursor: pointer;
}
.task-recognized-edit-btn:hover,
.task-recognized-edit-btn[aria-pressed="true"] {
  color: var(--gals-color-text, #0f172a);
  background: var(--gals-color-surface, #fff);
}
.task-recognized-answer-input {
  margin-top: 0.5rem;
  width: 100%;
}
.task-recognized-answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.task-recognized-answer--editing .task-recognized-answer-read {
  display: none;
}
.task-recognized-answer--editing .task-recognized-answer-edit {
  display: block;
  border-top: 1px solid var(--gals-color-border-subtle, #e2e8f0);
}
.task-report-panel--after-check { margin-top: 0; padding: 0; border: none; background: transparent; }
.task-parent-verified-form { margin-bottom: 0.75rem; }
.task-parent-verified-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  margin-bottom: 0.65rem;
  font-weight: 500;
  cursor: pointer;
}
.task-parent-verified-checkbox { margin-top: 0; flex-shrink: 0; }

/* Locked task: «I checked it myself» is a button. The checkbox stays for the same POST. */
.task-parent-verified-label--btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: auto;
  min-height: 44px;
  margin-bottom: 0.65rem;
  padding: 0 22px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  gap: 0;
}

.task-parent-verified-label--btn:hover {
  background: #0d6b64;
  color: #fff;
}

/* Pressed: a light pill with a tick, so «on» is plain at a glance, not one shade darker. */
.task-parent-verified-label--btn:has(.task-parent-verified-checkbox:checked) {
  gap: 8px;
  padding-left: 18px;
  background: #e3f4f1;
  color: #0f766e;
  box-shadow: inset 0 0 0 2px #0f766e;
}

.task-parent-verified-label--btn:has(.task-parent-verified-checkbox:checked)::before {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-parent-verified-label--btn:has(.task-parent-verified-checkbox:checked):hover {
  background: #d3eee9;
  color: #0f766e;
}

.task-parent-verified-label--btn:has(.task-parent-verified-checkbox:focus-visible) {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.task-parent-verified-label--btn .task-parent-verified-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.task-parent-verified-verdict {
  margin: 0.35rem 0 0.75rem;
}
.task-parent-verified-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
}
.task-parent-verified-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  cursor: pointer;
}
.task-parent-verified-note {
  margin: 0.35rem 0 0;
}
.task-parent-verified-note-input { width: 100%; }
.task-ai-block--disabled { opacity: 0.55; }
.task-photo-form { margin-top: 0.75rem; }
.task-photo-upload { margin-bottom: 0.5rem; }
.task-review-result .task-photo-upload { margin-top: 0.75rem; }
.photo-upload-box { position: relative; display: inline-block; }
.school-work-phrase { width: 100%; max-width: 32rem; }
.school-block { max-width: 32rem; margin: 0 0 1.5rem; }
.school-block .school-confirm__title { display: block; margin: 0 0 0.45rem; }
.school-block .input { max-width: 32rem; font-family: inherit; }
.school-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.school-block__remove {
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: 0.45rem;
  padding: 0;
  border: 1px solid var(--gals-color-border, #cbd5e1);
  border-radius: 50%;
  background: var(--gals-color-surface, #fff);
  color: var(--gals-color-text-muted, #64748b);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.school-block__remove:hover { color: var(--gals-color-text-strong, #0f172a); }
.school-block__add { margin: 0 0 1.25rem; }
.school-drop {
  max-width: 32rem;
  padding: 0.75rem;
  border: 1.5px dashed var(--gals-color-border, #cbd5e1);
  border-radius: 0.75rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.school-drop.is-over {
  border-color: var(--gals-color-primary);
  background: var(--gals-color-surface-muted, #f1f5f9);
}
.school-drop [hidden] { display: none !important; }
.school-drop .photo-stack { margin-bottom: 0; }
.school-drop span.photo-stack-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.school-drop__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 100%;
  padding: 1rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.school-drop__empty:focus-visible {
  outline: 2px solid var(--gals-color-primary);
  outline-offset: 2px;
  border-radius: 0.5rem;
}
.school-drop__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--gals-color-primary);
  border: 1.5px solid currentColor;
  font-size: 1.6rem;
  line-height: 1;
}
.school-drop__more {
  display: block;
  margin: 0.6rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted, #64748b);
  text-decoration: underline;
  cursor: pointer;
}
.school-drop__more:hover { color: var(--gals-color-primary); }
.school-drop__more:focus-visible {
  outline: 2px solid var(--gals-color-primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}
.school-drop__label { font-weight: 600; }
.school-drop__error {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gals-color-danger-text, #b91c1c);
}
.school-drop__hint {
  font-size: 0.875rem;
  color: var(--gals-color-text-muted, #64748b);
}
.school-work-topics { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.school-work-topics li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.school-work-topics .input { flex: 1; min-width: 0; }
.school-topic__body { flex: 1; min-width: 0; }
.school-topic__body .input { width: 100%; }
/* A topic the package has words, pairs or rules for: the practice is built on them. */
.school-topic__src {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.8rem;
  color: var(--gals-color-text-muted, #64748b);
}
.school-topic__check {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.8rem 0 0;
  accent-color: var(--gals-color-primary);
}
.school-confirm { max-width: 40rem; }
.school-confirm .input { font-family: inherit; }
.school-confirm__field { margin: 0 0 1.25rem; }
.app-main .school-confirm__title {
  display: block;
  margin: 0 0 0.45rem;
  font-family: var(--gals-font-body, var(--gals-font-sans));
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--gals-color-text-muted, #64748b);
}
.school-confirm__group { margin: 1.5rem 0 0; }
.school-confirm__list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.school-confirm__orig { display: block; }
.school-confirm__why {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted, #64748b);
}
.school-confirm__group .school-drop { margin-top: 1rem; }
.school-confirm__add { margin: 0.75rem 0 0; }
.school-confirm__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1.75rem 0 0;
}
.photo-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.photo-capture-btn {
  margin: 0;
}
.photo-capture-btn__icon[hidden] {
  display: none;
}
.photo-capture-btn__icon { flex-shrink: 0; }
.photo-capture-btn__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: task-photo-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.photo-upload-box--busy .photo-capture-btn__icon { display: none; }
.photo-upload-box--disabled .photo-capture-btn {
  cursor: not-allowed;
  pointer-events: none;
}
.photo-quota-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 100%;
}
.photo-quota-note {
  margin: 0.35rem 0 0;
  max-width: 32rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--gals-color-text-muted);
}
.photo-quota-wrap .photo-quota-note {
  margin: 0;
}
.photo-quota-note a {
  display: inline;
  font-weight: 500;
}
.photo-quota-note--warn {
  color: var(--gals-color-text, #0f172a);
}
.photo-quota-note[hidden],
.photo-quota-wrap.is-tip-off .photo-quota-note,
.photo-quota-wrap.is-tip-off .quota-again {
  display: none;
}

/* The hidden attribute must beat .btn { display }, or Save shows on a locked task before the mark is on. */
[data-quota-save][hidden] {
  display: none !important;
}
.photo-upload-input:focus-visible + .photo-capture-btn {
  outline: 2px solid var(--gals-color-primary);
  outline-offset: 2px;
}
.photo-capture-error {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gals-color-danger-text, #b91c1c);
}
.photo-capture-success {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gals-color-success-text, #166534);
}
.photo-capture-success--error {
  color: var(--gals-color-danger-text, #b91c1c);
}
.photo-stack { margin-bottom: 0.65rem; }
.photo-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.photo-stack-item {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
}
.photo-stack-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.35rem;
  border: 1px solid var(--gals-color-border, rgba(255, 255, 255, 0.12));
  display: block;
}
.photo-stack-remove {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--gals-color-border, #cbd5e1);
  border-radius: 50%;
  background: var(--gals-color-surface, #fff);
  color: var(--gals-color-text-muted, #64748b);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
.photo-stack-remove:hover {
  background: var(--gals-color-surface-muted, #f1f5f9);
  color: var(--gals-color-text-strong, #0f172a);
  border-color: var(--gals-color-border, #94a3b8);
}
.photo-stack-item--add { display: flex; }
.photo-stack-add {
  width: 100%;
  height: 100%;
  border: 1px dashed var(--gals-color-border, rgba(255, 255, 255, 0.2));
  border-radius: 0.35rem;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.photo-stack-add:disabled,
.photo-stack-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.photo-capture-hints {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--gals-color-text-subtle);
}
.photo-capture-hints > summary {
  cursor: pointer;
  color: var(--gals-color-text-muted);
}
.photo-capture-hints > p {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}
@keyframes task-photo-spin {
  to { transform: rotate(360deg); }
}
.task-review-form .task-report-actions { margin-top: 0.75rem; }
.task-report-actions[hidden] { display: none; }

.photo-capture-hints > summary {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.task-report-panel--recheck { margin-top: 0.5rem; margin-left: 2rem; }
.task-recheck-toggle { margin-top: 0.35rem; margin-left: 2rem; }
.task-service-and-review {
  position: relative;
  min-width: 0;
}
.task-service-and-review:has(.task-flag--feedback) .task-check-head {
  padding-right: 4.75rem;
}
.task-service-and-review .task-flag--feedback {
  position: absolute;
  top: 0.35rem;
  right: 0;
  left: auto;
  width: max-content;
  z-index: 1;
  margin: 0;
}
.task-review-root { margin-top: 0.25rem; min-width: 0; }
/* ── Topic guide (справка по теме), 2026-10-25 ──
   A row above the task text opens the guide in its own sheet: from the right on a computer,
   from below on a phone. The same on the child's and the parent's screens, in the child's screens'
   palette (kid.css): warm paper, Literata for titles, teal for what belongs to the guide.
   Mockup: docs/dev/mockups/topic-guide.html; docs/dev/ui.md § «Справка по теме». */
.topic-theory {
  --tt-paper: #fbfaf7;
  --tt-surface: #fff;
  --tt-hover: #f4f1ea;
  --tt-ink: #16181c;
  --tt-muted: #6b6a66;
  --tt-faint: #9c998f;
  --tt-line: rgba(22, 24, 28, 0.08);
  --tt-line-strong: rgba(22, 24, 28, 0.16);
  --tt-accent: #0d9488;
  --tt-accent-ink: #0f6e65;
  --tt-accent-soft: #e3f4f1;
  --tt-accent-pale: #a9ded5;
  --tt-display: "Literata", Georgia, serif;
  margin: 0 0 1.25rem;
}

.topic-theory__label {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tt-faint);
}

.topic-theory__rows {
  border: 1px solid var(--tt-line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--tt-paper);
}

.topic-theory-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--tt-ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.topic-theory-row + .topic-theory-row { border-top: 1px solid var(--tt-line); }
.topic-theory-row:hover:not(:disabled) { background: var(--tt-hover); }
.topic-theory-row:focus-visible { outline: 2px solid var(--tt-accent); outline-offset: -2px; }
.topic-theory-row:disabled { opacity: 0.55; cursor: not-allowed; }

.topic-theory-row__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tt-accent-soft);
  color: var(--tt-accent-ink);
}
.topic-theory-row__text { flex: 1 1 auto; min-width: 0; }
.topic-theory-row__eyebrow {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--tt-muted);
}
.topic-theory-row__title {
  display: block;
  margin-top: 1px;
  font-family: var(--tt-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
/* Under the title, not a column of its own: on a phone a third column squeezes the title. */
.topic-theory-row__state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--tt-accent-ink);
}
.topic-theory-row__state[hidden] { display: none; }
.topic-theory-row__arrow { flex: none; color: var(--tt-faint); transition: transform 0.15s ease; }
.topic-theory-row:hover:not(:disabled) .topic-theory-row__arrow { transform: translateX(2px); color: var(--tt-ink); }

.topic-theory-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tt-accent);
  animation: topic-theory-pulse 1.4s ease-in-out infinite;
}
@keyframes topic-theory-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* The sheet */
html.topic-theory-open { overflow: hidden; }

.topic-theory-sheet {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(560px, 100vw);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  flex-direction: column;
  background: var(--tt-paper);
  color: var(--tt-ink);
  box-shadow: 0 0 0 1px rgba(22, 24, 28, 0.06), -24px 0 60px -30px rgba(22, 24, 28, 0.35);
}
.topic-theory-sheet[open] {
  display: flex;
  animation: topic-theory-from-right 0.32s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.topic-theory-sheet::backdrop {
  background: rgba(22, 24, 28, 0.22);
  backdrop-filter: blur(1.5px);
}
@keyframes topic-theory-from-right {
  from { transform: translateX(104%); }
  to { transform: none; }
}
@keyframes topic-theory-from-below {
  from { transform: translateY(104%); }
  to { transform: none; }
}

.topic-theory-sheet__grabber { display: none; }

.topic-theory-sheet__head {
  position: relative;
  flex: none;
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--tt-line);
}
.topic-theory-sheet__kicker {
  margin: 0 48px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tt-accent-ink);
}
.topic-theory-sheet__kicker span { color: var(--tt-faint); font-weight: 500; }
/* .topic-theory in front: body.app-course h2 sets the body face on the parent's screens. */
.topic-theory .topic-theory-sheet__title {
  margin: 10px 48px 0 0;
  font-family: var(--tt-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: anywhere;
  color: var(--tt-ink);
}
.topic-theory-sheet__meta {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--tt-muted);
}
.topic-theory-sheet__meta[hidden] { display: none; }
.topic-theory-sheet__close {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--tt-line-strong);
  border-radius: 50%;
  background: var(--tt-surface);
  color: var(--tt-ink);
  cursor: pointer;
}
.topic-theory-sheet__close:hover { background: var(--tt-hover); }

.topic-theory-sheet__slot,
.topic-theory-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.topic-theory-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 32px 36px;
}
/* The reading time moves to the sheet's header (topic_theory.js). */
.topic-theory-panel__meta { display: none; }
.topic-theory-panel__foot {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px 18px;
  border-top: 1px solid var(--tt-line);
  background: var(--tt-paper);
}
.topic-theory-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--tt-line-strong);
  border-radius: 12px;
  font-size: 14px;
  color: var(--tt-ink);
  text-decoration: none;
}
.topic-theory-print:hover { background: var(--tt-hover); text-decoration: none; }
.topic-theory-back {
  margin-left: auto;
  padding: 13px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--tt-ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.topic-theory-back:hover { background: #2a2d33; }

/* The guide's text */
.topic-theory-guide {
  counter-reset: topic-theory-section;
  font-size: 16px;
  line-height: 1.65;
  color: var(--tt-ink);
  overflow-wrap: break-word;
}
.topic-theory-guide > :first-child { margin-top: 22px; }
.topic-theory .topic-theory-guide h1,
.topic-theory .topic-theory-guide h2 {
  counter-increment: topic-theory-section;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 10px;
  font-family: var(--tt-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--tt-ink);
}
.topic-theory-guide h1::before,
.topic-theory-guide h2::before {
  content: counter(topic-theory-section, decimal-leading-zero);
  flex: none;
  font-family: var(--gals-font-body, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tt-accent-ink);
}
.topic-theory .topic-theory-guide h3,
.topic-theory .topic-theory-guide h4 {
  margin: 22px 0 8px;
  font-family: var(--tt-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.topic-theory-guide p { margin: 0 0 12px; }
.topic-theory-guide ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.topic-theory-guide ul > li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 20px;
}
.topic-theory-guide ul > li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tt-accent-pale);
}
.topic-theory-guide ol { margin: 0 0 14px; padding-left: 24px; }
.topic-theory-guide ol > li { margin: 0 0 8px; padding-left: 2px; }
.topic-theory-guide ol > li::marker { color: var(--tt-accent-ink); font-weight: 600; }
.topic-theory-guide li > ul,
.topic-theory-guide li > ol { margin: 8px 0 0; }
.topic-theory-guide em { font-style: italic; color: var(--tt-accent-ink); }
.topic-theory-guide strong { font-weight: 600; color: var(--tt-ink); }
.topic-theory-guide blockquote {
  margin: 14px 0 16px;
  padding: 14px 18px;
  border-left: 3px solid var(--tt-accent);
  border-radius: 0 12px 12px 0;
  background: var(--tt-surface);
  font-family: var(--tt-display);
  font-size: 17px;
  line-height: 1.5;
}
.topic-theory-guide blockquote p:last-child { margin-bottom: 0; }
.topic-theory-guide code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--tt-surface);
  box-shadow: 0 0 0 1px var(--tt-line);
  font-size: 0.9em;
}
.topic-theory-guide pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tt-surface);
  box-shadow: 0 0 0 1px var(--tt-line);
  overflow-x: auto;
}
.topic-theory-guide pre code { padding: 0; box-shadow: none; background: none; }
.topic-theory-guide table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 6px 0 16px;
  overflow-x: auto;
  border-collapse: collapse;
  border-radius: 12px;
  background: var(--tt-surface);
  box-shadow: 0 0 0 1px var(--tt-line);
  font-size: 15px;
}
.topic-theory-guide th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--tt-line);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  color: var(--tt-faint);
}
.topic-theory-guide td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tt-line);
  vertical-align: top;
  line-height: 1.45;
}
.topic-theory-guide tr:last-child td { border-bottom: 0; }
.topic-theory-guide hr { margin: 24px 0; border: 0; border-top: 1px solid var(--tt-line); }
.topic-theory-guide .task-math { display: inline-block; vertical-align: -0.15em; line-height: 1; }
.topic-theory-guide .task-math math { font-size: 1.05em; }
.topic-theory-guide .task-math--display {
  display: block;
  margin: 0.75em auto;
  text-align: center;
  vertical-align: baseline;
  overflow-x: auto;
  max-width: 100%;
}

/* Waiting: the sheet is laid out, the text is coming */
.topic-theory-wait { padding-top: 22px; }
.topic-theory-wait__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.topic-theory-wait__hint {
  margin: 6px 0 26px 17px;
  font-size: 14px;
  color: var(--tt-muted);
}
.topic-theory-skeleton { padding-top: 4px; }
.topic-theory-skeleton span {
  display: block;
  height: 12px;
  margin: 0 0 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #efece5 0%, #f7f5f0 40%, #efece5 80%);
  background-size: 300% 100%;
  animation: topic-theory-shimmer 1.6s ease-in-out infinite;
}
.topic-theory-skeleton span:nth-child(4n + 1) { width: 46%; height: 18px; margin: 26px 0 16px; }
.topic-theory-skeleton span:nth-child(5) { width: 38%; }
.topic-theory-skeleton span:nth-child(3) { width: 88%; }
.topic-theory-skeleton span:nth-child(4) { width: 64%; }
.topic-theory-skeleton span:nth-child(7) { width: 92%; }
.topic-theory-skeleton span:nth-child(8) { width: 70%; }
@keyframes topic-theory-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.topic-theory-error { padding-top: 22px; }
.topic-theory-error .btn { margin-top: 0.35rem; }

/* Phone: the sheet comes from below; the row gives its title the width */
@media (max-width: 560px) {
  .topic-theory-sheet {
    inset: auto 0 0 0;
    width: 100vw;
    height: 92%;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -20px 60px -30px rgba(22, 24, 28, 0.45);
  }
  .topic-theory-sheet[open] { animation-name: topic-theory-from-below; }
  .topic-theory-sheet__grabber {
    display: block;
    flex: none;
    width: 38px;
    height: 5px;
    margin: 8px auto 0;
    border-radius: 5px;
    background: var(--tt-line-strong);
  }
  .topic-theory-sheet__head { padding: 16px 22px 18px; }
  .topic-theory .topic-theory-sheet__title { font-size: 23px; }
  .topic-theory-sheet__close { top: 14px; right: 16px; }
  .topic-theory-panel__body { padding: 4px 22px 30px; }
  .topic-theory-panel__foot { padding: 12px 22px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .topic-theory-row { gap: 10px; padding: 14px 14px 14px 16px; }
  .topic-theory-row__mark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .topic-theory-dot,
  .topic-theory-skeleton span,
  .topic-theory-sheet[open] {
    animation: none;
  }
  .topic-theory-row,
  .topic-theory-row__arrow {
    transition: none;
  }
}
.task-job-status {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--gals-color-text-subtle);
}
.task-job-status--error { color: var(--gals-color-danger-text, #b91c1c); }
.task-review-in-progress {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-top: 0.5rem;
  min-width: 0;
}
.task-review-in-progress .task-job-status {
  margin-top: 0;
  min-width: 0;
}
.task-review-cancel-btn {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.9375rem;
  font-weight: 600;
}
.task-report-panel--busy { opacity: 0.92; }

/* Узкие экраны: вложенные отступы карточки задания съедают ~94px из 375px —
   схлопываем каскад, чтобы блоку проверки досталась почти вся ширина. */
@media (max-width: 540px) {
  .card {
    padding: 1rem;
  }

  .task-details-body {
    padding-left: 0.5rem;
    min-width: 0;
  }

  .task-body,
  .task-check,
  .task-check-form,
  .task-check-history,
  .task-check-reshoot-hint,
  .task-report-panel,
  .task-report-panel--recheck,
  .task-review-in-progress {
    margin-left: 0.5rem;
  }

  .task-recognized-answer,
  .task-review-result > .task-recognized-answer,
  [data-check-result] + .task-recognized-answer {
    margin-left: 0.5rem;
  }

}

/* child-facing */
.child-subtitle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--gals-space-lg);
}
.child-subtitle-row__text {
  margin-bottom: 0;
  min-width: 0;
}
.child-subtitle-row__text .subtitle {
  margin-bottom: 0.15rem;
}

.assignment-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  row-gap: 0.2rem;
  margin: 0.45rem 0 0;
  max-width: 36rem;
}

.assignment-facts__row {
  display: contents;
}

.assignment-facts dt {
  margin: 0;
  color: var(--gals-color-text-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.assignment-facts dd {
  margin: 0;
  color: var(--gals-color-text);
  font-size: 0.95rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.dashboard-date {
  margin: 0;
  font-size: 0.875rem;
  color: var(--landing-muted);
}
.child-subtitle-row__link {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--landing-muted);
  text-decoration: none;
  white-space: nowrap;
}
.child-subtitle-row__link:hover {
  color: var(--landing-accent-ink);
  text-decoration: none;
}

.task-check-child {
  margin-top: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: var(--gals-color-status-correct-bg);
  color: var(--gals-color-status-correct);
}
.task-check-child--minor_errors {
  background: var(--gals-color-status-notes-bg);
  color: var(--gals-color-status-notes);
}
.task-check-child--major_gaps,
.task-check-child--not_done {
  background: var(--gals-color-status-gap-bg);
  color: var(--gals-color-status-gap);
}
.task-check-child-status { font-weight: 600; }
.task-check-child-analysis { margin-top: 0.35rem; }
.task-check-child-analysis > summary {
  cursor: pointer;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}

/* The answer a photo check wrote out, its errors highlighted (core/answer_marks.py, 2026-10-26) */
.task-check-recognized { margin-top: 0.5rem; }
.task-check-recognized-title { margin: 0; font-weight: 600; }
.task-answer-marks-hint {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
}
.task-answer-marks {
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.answer-mark {
  padding: 1px 3px;
  border-bottom: 2px solid var(--gals-color-status-gap);
  border-radius: 3px;
  background: var(--gals-color-status-gap-bg);
  color: inherit;
}
/* The remark's number: a red circle after the fragment (not a superscript: after a fraction it reads as a power). */
.answer-mark-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.35rem;
  vertical-align: 0.1em;
  border-radius: 50%;
  background: #b91c1c;
  color: #fff;
  font-family: var(--gals-font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.child-past-list {
  list-style: none;
  display: block;
  margin: 0;
  padding: 0;
  max-height: none;
  overflow: visible;
  border-top: none;
  gap: 0;
}
.child-past-link {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gals-color-border, #e5e7eb);
  text-decoration: none;
  color: inherit;
}
.child-past-link:last-child {
  border-bottom: none;
}
.task-history-instructions {
  margin: 0.5rem 0 0.75rem;
}
.task-history-instructions > summary {
  cursor: pointer;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}
.task-history-label {
  margin: 0.5rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
}
.task-history-answer {
  margin: 0.35rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--gals-color-surface-muted, #f3f4f6);
}
.task-history-answer-text {
  white-space: pre-wrap;
  font-size: 0.95rem;
}
.task-history-status {
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: var(--gals-color-text-muted);
}
.task-history-status--done {
  color: var(--gals-color-success-text, #15803d);
}

.self-photo-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.self-photo-dialog[open] {
  display: flex;
  flex-direction: column;
}

.self-photo-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.self-photo-dialog__body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 20px 20px 0;
}

.self-photo-dialog .section-title {
  margin: 0;
}

.self-photo-dialog__lead {
  margin: 0;
  font-size: 15px;
}

.self-photo-zone {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  padding: 18px 14px;
  border: 1.5px dashed rgba(20, 32, 27, 0.16);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.self-photo-zone--short {
  grid-auto-flow: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
}

.self-photo-zone__count {
  font-size: 13px;
  font-weight: 400;
  color: #5c6b64;
}

.self-photo-zone__icon.is-hidden,
.self-photo-error[hidden] {
  display: none;
}

.self-photo-zone--full,
.self-photo-zone:disabled {
  cursor: default;
}

.self-photo-zone--full {
  border-style: solid;
  border-color: rgba(20, 32, 27, 0.1);
  background: #f4f7f6;
  color: #5c6b64;
}

.self-photo-error {
  margin: 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 500;
}

.self-photo-limits {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 4px;
  color: #5c6b64;
  font-size: 14px;
}

.self-photo-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: 12px 20px 20px;
}

.confirm-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 26rem;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}
.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.confirm-dialog__body {
  padding: 1.5rem;
}
.confirm-dialog__text {
  margin: 0 0 1.25rem;
}
.confirm-dialog__actions {
  justify-content: flex-end;
}

.control-work-modal {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 42rem;
  width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}
.control-work-modal[open] {
  display: flex;
  flex-direction: column;
}
.control-work-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.control-work-modal__form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  padding: 1.25rem 1.5rem 1.25rem;
}
.control-work-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}
.control-work-modal__header .section-title {
  margin: 0;
}
.control-work-modal__lead {
  flex-shrink: 0;
  margin: 0 0 0.75rem;
}
.control-work-modal__toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}
.control-work-modal__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.control-work-modal__toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.control-work-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.control-work-modal__actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}
.control-work-modal__status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}
.control-work-modal__count {
  margin: 0;
}
.control-work-modal__limit {
  margin: 0;
}
.control-work-modal__limit.is-over {
  color: var(--gals-color-danger, #dc2626);
}
.control-work-topic-list {
  flex: 1 1 auto;
  min-height: 8rem;
  overflow: auto;
  border: 1px solid var(--gals-color-border, #e5e7eb);
  border-radius: 10px;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
}
.control-work-modal__empty {
  margin: 0.75rem 0.35rem;
  color: var(--gals-color-text-muted);
}
.control-work-modal__empty .btn {
  margin-left: 0.5rem;
  vertical-align: baseline;
}
.control-work-modal__empty[hidden] {
  display: none !important;
}
.control-work-modal__footer {
  flex-shrink: 0;
}
.control-work-modal__footer .form-actions {
  margin-top: 0;
}
.control-work-topic-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.5rem;
  row-gap: 0.2rem;
  align-items: start;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--gals-color-border, #e5e7eb);
}
.control-work-topic-row[hidden] {
  display: none !important;
}
.control-work-topic-row:last-child {
  border-bottom: none;
}
.control-work-topic-row > input {
  margin-top: 0.35rem;
}
.control-work-topic-row__body {
  min-width: 0;
}
.control-work-topic-row__title {
  display: block;
  font-weight: 600;
}
.control-work-topic-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  margin-top: 0.15rem;
}
.control-work-topic-row__tag {
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}
.assignment--control-work {
  margin-top: 1rem;
}

/* Экран «Дети»: карточки в языке дашборда (.dash-profile). */
.child-card-edit {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--gals-color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.child-card-edit:hover {
  color: var(--landing-accent, var(--gals-color-accent));
}

.child-card-unnamed {
  color: var(--gals-color-text-muted);
  font-style: italic;
  font-weight: 500;
}

.child-card-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--gals-color-text-muted);
}

.child-card-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--landing-border, var(--gals-color-border-subtle));
}

.child-card-status.is-ready .child-card-dot {
  background: var(--landing-accent, var(--gals-color-accent));
}

.child-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.child-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--landing-border, var(--gals-color-border-subtle));
  border-radius: 999px;
  background: var(--gals-color-surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
}

.child-chip:hover {
  border-color: var(--landing-accent, var(--gals-color-accent));
  color: var(--landing-accent, var(--gals-color-accent));
  text-decoration: none;
}

.child-chip--add {
  border-style: dashed;
  color: var(--gals-color-text-muted);
}

.child-card-actions {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-shrink: 0;
}

.child-card-delete:hover {
  color: var(--gals-color-danger);
}

/* Дашборд: «Дети» — тихая ссылка в шапке, «Добавить профиль» — пунктирная карточка в конце списка. */
.dash-head-link {
  font-size: 0.9rem;
  color: var(--gals-color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dash-head-link:hover {
  color: var(--landing-accent, var(--gals-color-accent));
}

.dash-add {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  border: 1.5px dashed var(--landing-border, var(--gals-color-border-subtle));
  border-radius: var(--landing-radius, var(--gals-radius-md));
  color: var(--gals-color-text-muted);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.dash-add:hover,
.dash-add:focus-visible {
  border-color: var(--landing-accent, var(--gals-color-accent));
  color: var(--landing-accent, var(--gals-color-accent));
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 55%, #fff);
  text-decoration: none;
  outline: none;
}

/* Старые подготовки под «Показать прежние (N)»: пункт-заголовок выглядит как «+ Добавить». */
.dash-older summary {
  cursor: pointer;
  list-style: none;
}

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

.dash-older[open] summary {
  margin-bottom: 1rem;
}

/* «+ Добавить …» как кнопка формы (POST): сбрасываем стили <button>. */
button.dash-add {
  width: 100%;
  background: none;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

/* Плашка «По итогам прошлого набора»: заголовок и список «тема: было → стало». */
.mastery-changes-banner ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.mastery-changes-banner li + li {
  margin-top: 0.25rem;
}

/* Staff: экран упавших попыток (/staff/failures/). */
.fl-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 1rem 0;
}

.fl-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--gals-color-text-muted, #64748b);
}

.fl-filters .fl-check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.fl-sample {
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  background: var(--gals-color-surface-muted, #f1f5f9);
  border-radius: 6px;
}

/* Cabinet start cards (2026-10-14): the same flat tile as the public offers.
   Header and type stay the cabinet's. Empty dashboard tabs use this card too. */
.app-page .start-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f3f5f4;
  border: 0;
  border-radius: 28px;
  box-shadow: none;
  padding: clamp(28px, 3.5vw, 48px);
}

.app-page .start-card:hover,
.app-page .start-card:focus-within,
.app-page .start-card--first {
  transform: none;
  border: 0;
  box-shadow: none;
}

.app-page .start-card .landing-step-ico {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  color: var(--landing-accent-ink);
  background: transparent;
}

.app-page .start-card .landing-btn {
  margin-top: 32px;
  align-self: flex-start;
  border-radius: 999px;
}

/* Course onboarding only (profile, plan, first assignment). White frames for the
   questionnaire and the plan; night only while the first set is being prepared.
   public.css is not loaded. */
html:has(body.app-page.app-onboarding) {
  background: #fff;
}

html:has(body.app-page.app-onboarding.app-onboarding--night) {
  background: var(--gals-color-night);
}

body.app-page.app-onboarding {
  --onb-ink: #14201b;
  --onb-muted: #5c6b64;
  --onb-line: rgba(20, 32, 27, 0.10);
  --onb-track: rgba(20, 32, 27, 0.10);
  --onb-accent: #0f766e;
  --onb-tile: #f3f5f4;
  --onb-field-line: #7a8883;
  --onb-error: #b42318;
  --onb-error-bg: #fef3f2;
  --onb-night: var(--gals-color-night);
  --onb-on-night: var(--gals-color-on-night);
  --onb-on-night-muted: #9fb5ae;
  --onb-accent-night: var(--gals-color-accent-bright);
  --onb-radius-field: 14px;
  --onb-radius-tile: 28px;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: #fff;
  color: var(--onb-ink);
  color-scheme: light;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 17px;
  line-height: 1.5;
  font-optical-sizing: auto;
}

body.app-page.app-onboarding > .container {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  min-height: 100svh;
}

body.app-page.app-onboarding .app-main {
  flex: 1 0 auto;
  padding-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(72px, 10vw, 120px);
}

body.app-page.app-onboarding h1,
body.app-page.app-onboarding h2,
body.app-page.app-onboarding h3,
body.app-page.app-onboarding button,
body.app-page.app-onboarding input,
body.app-page.app-onboarding textarea,
body.app-page.app-onboarding select,
body.app-page.app-onboarding .btn {
  font-family: inherit;
}

body.app-page.app-onboarding ::selection {
  background: var(--landing-accent-soft);
}

body.app-page.app-onboarding .landing-logo-text {
  font-family: "Literata Logo", Georgia, serif;
}

body.app-page.app-onboarding .landing-wrap {
  padding-left: 24px;
  padding-right: 24px;
}

body.app-page.app-onboarding .landing-site-inner,
body.app-page.app-onboarding .onboarding-subnav-inner,
body.app-page.app-onboarding .app-site-footer .landing-wrap {
  max-width: 1200px;
}

@media (min-width: 1024px) {
  body.app-page.app-onboarding .landing-site-inner,
  body.app-page.app-onboarding .onboarding-subnav-inner,
  body.app-page.app-onboarding .app-site-footer .landing-wrap {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width: 480px) {
  body.app-page.app-onboarding .landing-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  body.app-page.app-onboarding .landing-site-inner:has(.landing-staff-link) .landing-logo-text {
    display: inline;
  }

  body.app-page.app-onboarding .landing-site-inner:has(.landing-staff-link) .landing-logo-mark {
    display: none;
  }
}

body.app-page.app-onboarding .app-site {
  background: rgba(255, 255, 255, 0.72);
  color: var(--onb-ink);
  border-bottom: 1px solid var(--onb-line);
  backdrop-filter: saturate(180%) blur(20px);
}

body.app-page.app-onboarding .landing-site-inner {
  height: 52px;
}

body.app-page.app-onboarding .landing-logo,
body.app-page.app-onboarding .app-toolbar-link,
body.app-page.app-onboarding .landing-staff-link,
body.app-page.app-onboarding .app-toolbar-form .btn-link {
  color: var(--onb-ink);
}

body.app-page.app-onboarding .app-toolbar-form .btn-link:hover,
body.app-page.app-onboarding .app-toolbar-link:hover,
body.app-page.app-onboarding .landing-staff-link:hover {
  color: var(--onb-ink);
  opacity: 0.85;
}

body.app-page.app-onboarding .lang-picker--landing .lang-picker__trigger {
  background: transparent;
  border-color: var(--onb-line);
  color: var(--onb-ink);
}

/* The plan badge is the same filled mint pill as in the rest of the cabinet (an outline of
   --onb-line on the white frame read as a smudge, 2026-10-16). The border stays, transparent,
   so the pill keeps the language button's height; the night frame paints it white. */
body.app-page.app-onboarding .app-toolbar-badge {
  background: var(--landing-accent-soft, #e6f5f3);
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

body.app-page.app-onboarding .app-subnav,
body.app-page.app-onboarding .app-main,
body.app-page.app-onboarding .app-site-footer {
  background: transparent;
}

body.app-page.app-onboarding .app-subnav {
  border-bottom: 0;
}

body.app-page.app-onboarding .onboarding-subnav-inner {
  display: block;
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: 0;
}

body.app-page.app-onboarding .onboarding-stepper {
  display: block;
  width: 100%;
}

body.app-page.app-onboarding .onboarding-stepper-list-desktop {
  display: none;
}

body.app-page.app-onboarding .app-main-inner {
  width: 100%;
  max-width: calc(34rem + 48px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

body.app-page.app-onboarding:has(.strategy-editor) .app-main-inner,
body.app-page.app-onboarding:has(.strategy-job-failed) .app-main-inner {
  max-width: calc(46rem + 48px);
}

body.app-page.app-onboarding .app-site-footer {
  border-top-color: var(--onb-track);
}

body.app-page.app-onboarding .app-site-footer a {
  color: var(--onb-muted);
}

body.app-page.app-onboarding .profile-head {
  display: none;
}

body.app-page.app-onboarding .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

body.app-page.app-onboarding .messages li {
  background: var(--onb-tile);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--onb-ink);
}

body.app-page.app-onboarding .messages li.error {
  background: var(--onb-error-bg);
  color: var(--onb-error);
}

body.app-page.app-onboarding .messages li.quota {
  padding: 0;
  background: transparent;
  color: inherit;
}

/* Head */
body.app-page.app-onboarding .onboarding-frame {
  width: 100%;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

body.app-page.app-onboarding .onboarding-back-row {
  min-height: 24px;
  margin-bottom: 12px;
  text-align: left;
}

body.app-page.app-onboarding .onboarding-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--onb-muted);
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
}

body.app-page.app-onboarding .onboarding-back:hover {
  color: var(--onb-ink);
  text-decoration: none;
}

body.app-page.app-onboarding .onboarding-chevron {
  flex: none;
}

body.app-page.app-onboarding .onboarding-kicker {
  margin: 0;
  color: var(--onb-accent);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}

body.app-page.app-onboarding .onboarding-segments {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

body.app-page.app-onboarding .onboarding-segment {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--onb-track);
}

body.app-page.app-onboarding .onboarding-segment.is-fill {
  background: var(--onb-accent);
}

body.app-page.app-onboarding .onboarding-frame h1 {
  margin: 20px auto 0;
  max-width: 16em;
  color: var(--onb-ink);
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

body.app-page.app-onboarding .onboarding-lead {
  margin: 14px auto 0;
  max-width: 34rem;
  color: var(--onb-muted);
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 400;
  line-height: 1.45;
  text-wrap: pretty;
}

body.app-page.app-onboarding .onboarding-lead .job-status-hint {
  display: block;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

body.app-page.app-onboarding .onboarding-lead .job-status-hint + .job-status-hint {
  margin-top: 6px;
}

body.app-page.app-onboarding:lang(ja) .onboarding-frame h1,
body.app-page.app-onboarding:lang(zh-hans) .onboarding-frame h1,
body.app-page.app-onboarding:lang(ko) .onboarding-frame h1,
body.app-page.app-onboarding:lang(hi) .onboarding-frame h1 {
  letter-spacing: 0;
  line-height: 1.15;
}

/* One pill */
body.app-page.app-onboarding .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--onb-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
}

body.app-page.app-onboarding .btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

body.app-page.app-onboarding .btn-primary:disabled,
body.app-page.app-onboarding .btn-primary.is-disabled {
  opacity: 0.4;
  filter: none;
  box-shadow: none;
}

@media (hover: hover) {
  body.app-page.app-onboarding .btn-primary:hover:not(:disabled):not(.is-disabled) {
    background: var(--onb-accent);
    filter: brightness(1.06);
  }
}

body.app-page.app-onboarding :focus-visible {
  outline: 2px solid var(--onb-accent);
  outline-offset: 2px;
}

body.app-page.app-onboarding .actions,
body.app-page.app-onboarding .form-actions,
body.app-page.app-onboarding .strategy-editor-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-top: 40px;
}

body.app-page.app-onboarding .onboarding-text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  align-self: center;
  width: fit-content;
  margin-top: 16px;
  color: var(--onb-accent);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

body.app-page.app-onboarding .onboarding-text-link:hover {
  color: var(--onb-accent);
  text-decoration: none;
}

body.app-page.app-onboarding .onboarding-text-link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Fields */
body.app-page.app-onboarding .briefing-field {
  margin: 0 0 24px;
}

body.app-page.app-onboarding .briefing-field-label-row,
body.app-page.app-onboarding .briefing-field > label,
body.app-page.app-onboarding .profile-child-block > .briefing-field > label,
body.app-page.app-onboarding .child-access .briefing-field > label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--onb-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

body.app-page.app-onboarding .briefing-field-label-row label {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

body.app-page.app-onboarding .input,
body.app-page.app-onboarding textarea.input,
body.app-page.app-onboarding select,
body.app-page.app-onboarding .briefing-field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.app-page.app-onboarding .briefing-field textarea,
body.app-page.app-onboarding .profile-child input[type="text"],
body.app-page.app-onboarding .profile-child input[type="password"],
body.app-page.app-onboarding .profile-child textarea,
body.app-page.app-onboarding .profile-child select {
  display: block;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--onb-field-line);
  border-radius: var(--onb-radius-field);
  background: #fff;
  color: var(--onb-ink);
  font-size: 17px;
  line-height: 1.3;
}

body.app-page.app-onboarding textarea.input,
body.app-page.app-onboarding .briefing-field textarea,
body.app-page.app-onboarding .profile-child textarea {
  height: auto;
  min-height: calc(1.45em * 3 + 28px);
  line-height: 1.45;
  resize: vertical;
}

body.app-page.app-onboarding .input::placeholder,
body.app-page.app-onboarding textarea::placeholder {
  color: var(--onb-muted);
}

body.app-page.app-onboarding .input:focus-visible,
body.app-page.app-onboarding textarea:focus-visible,
body.app-page.app-onboarding select:focus-visible,
body.app-page.app-onboarding .briefing-field input:focus-visible,
body.app-page.app-onboarding .profile-child input:focus-visible {
  outline: none;
  border-color: var(--onb-accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

body.app-page.app-onboarding input:-webkit-autofill {
  -webkit-text-fill-color: var(--onb-ink);
  caret-color: var(--onb-ink);
  box-shadow: 0 0 0 1000px #fff inset;
}

body.app-page.app-onboarding select,
body.app-page.app-onboarding select.input {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5' stroke='%235c6b64' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

body.app-page.app-onboarding .briefing-field:has(.form-errors) .input,
body.app-page.app-onboarding .briefing-field:has(.form-errors) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.app-page.app-onboarding .briefing-field:has(.form-errors) textarea,
body.app-page.app-onboarding .profile-child .briefing-field:has(.form-errors) input,
body.app-page.app-onboarding .profile-child .briefing-field:has(.form-errors) textarea {
  border-color: var(--onb-error);
}

body.app-page.app-onboarding .briefing-field .form-errors {
  margin: 6px 0 0;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--onb-error);
  font-size: 14px;
}

body.app-page.app-onboarding form > .form-errors,
body.app-page.app-onboarding .profile-child-block > .form-errors {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--onb-error-bg);
  color: var(--onb-error);
  font-size: 15px;
}

body.app-page.app-onboarding .briefing-field-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -12px -12px -12px -6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--onb-muted);
  cursor: pointer;
}

body.app-page.app-onboarding .briefing-field-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--onb-field-line);
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

body.app-page.app-onboarding .briefing-field-info-btn[aria-expanded="true"] .briefing-field-info-icon {
  border-color: var(--onb-accent);
  background: var(--onb-accent);
  color: #fff;
}

body.app-page.app-onboarding .briefing-field-tooltip {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--onb-tile);
  color: var(--onb-muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

/* Switches */
/* The same tile as «For a child» (.profile-child): both switches share one left and right edge. */
body.app-page.app-onboarding .interests-field {
  margin-top: 32px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--onb-radius-tile);
  background: var(--onb-tile);
}

body.app-page.app-onboarding .interests-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  cursor: pointer;
}

body.app-page.app-onboarding .interests-toggle span {
  flex: 1;
  order: -1;
  color: var(--onb-ink);
  font-size: 17px;
  font-weight: 500;
}

body.app-page.app-onboarding .interests-note {
  margin: 0;
  color: var(--onb-muted);
  font-size: 14px;
  line-height: 1.45;
}

body.app-page.app-onboarding .interests-toggle input,
body.app-page.app-onboarding .profile-child-check {
  appearance: none;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border: 1.5px solid var(--onb-field-line);
  border-radius: 999px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='10' cy='10' r='9' fill='%23fff' stroke='rgba(0,0,0,0.08)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 2px 50%;
  background-size: 20px 20px;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 200ms, background-position 200ms, border-color 200ms;
}

body.app-page.app-onboarding .interests-toggle input:checked,
body.app-page.app-onboarding .profile-child-check:checked {
  border-color: transparent;
  background-color: var(--onb-accent);
  background-position: 22px 50%;
}

body.app-page.app-onboarding .interests-toggle input:focus-visible,
body.app-page.app-onboarding .profile-child-check:focus-visible {
  outline: 2px solid var(--onb-accent);
  outline-offset: 2px;
  box-shadow: none;
}

body.app-page.app-onboarding .profile-child {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  margin: 32px 0 0;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--onb-radius-tile);
  background: var(--onb-tile);
}

body.app-page.app-onboarding .profile-child-toggle {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding-right: 60px;
  color: var(--onb-ink);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
}

body.app-page.app-onboarding .profile-child-check {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  justify-self: end;
  align-self: center;
}

body.app-page.app-onboarding .profile-child-block {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--onb-line);
}

body.app-page.app-onboarding .profile-child-person {
  position: relative;
  margin: 0 0 8px;
}

body.app-page.app-onboarding .profile-child-person > input[type="radio"] {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid var(--onb-field-line);
  border-radius: 50%;
  background: #fff;
  appearance: none;
}

body.app-page.app-onboarding .profile-child-person > input[type="radio"]:checked {
  border-width: 6px;
  border-color: var(--onb-accent);
}

body.app-page.app-onboarding .profile-child-person > input[type="radio"]:focus-visible {
  outline: 2px solid var(--onb-accent);
  outline-offset: 2px;
}

body.app-page.app-onboarding .profile-child-choice {
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: 0;
  padding: 0 16px 0 48px;
  border: 1px solid var(--onb-field-line);
  border-radius: 14px;
  background: #fff;
  color: var(--onb-ink);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
}

body.app-page.app-onboarding .profile-child-person > input:checked + .profile-child-choice {
  border-width: 1.5px;
  border-color: var(--onb-accent);
}

/* «Add a child» is an action, not one more child: a dashed card with a plus instead of the
   radio mark (the same dashed «+ Add» as in the cabinet); solid once chosen. */
body.app-page.app-onboarding .profile-child-person > input[value="new"] {
  border-color: transparent;
  background: none;
}

body.app-page.app-onboarding .profile-child-person > input[value="new"]:checked {
  border-width: 1.5px;
  border-color: transparent;
}

body.app-page.app-onboarding .profile-child-person > input[value="new"] + .profile-child-choice {
  border-style: dashed;
  color: var(--onb-accent);
}

body.app-page.app-onboarding .profile-child-person > input[value="new"] + .profile-child-choice::before {
  content: "+";
  position: absolute;
  top: 12px;
  left: 20px;
  font-size: 24px;
  font-weight: 400;
  line-height: 28px;
}

body.app-page.app-onboarding .profile-child-person > input[value="new"]:checked + .profile-child-choice {
  border-style: solid;
}

body.app-page.app-onboarding .profile-child-person > .profile-child-fill,
body.app-page.app-onboarding .profile-child-person > .profile-child-new {
  margin-left: 22px;
}

body.app-page.app-onboarding .child-access {
  margin: 8px 0 16px;
}

body.app-page.app-onboarding .child-access summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  color: var(--onb-ink);
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

body.app-page.app-onboarding .child-access summary::-webkit-details-marker {
  display: none;
}

body.app-page.app-onboarding .child-access summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 200ms;
}

body.app-page.app-onboarding .child-access[open] summary::after {
  transform: rotate(45deg);
}

body.app-page.app-onboarding .child-access .subtitle,
body.app-page.app-onboarding .help-text {
  color: var(--onb-muted);
  font-size: 14px;
}

/* Child forms in the sign-in look (handover stage 2). The course questionnaire,
   the homework task and solution, and those forms' submit buttons stay as they are.
   Radio markup is unchanged: the checkbox and radios stay siblings of the fields. */
body.child-person {
  background: #fff;
  color: #14201b;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
}

body.child-person .app-main,
body.child-person .app-site {
  background: #fff;
}

body.child-person h1,
body.child-person h2,
body.child-person button,
body.child-person input,
body.child-person .auth-submit {
  font-family: inherit;
}

body.child-person .landing-logo-text {
  font-family: "Literata Logo", Georgia, serif;
}

.child-sheet {
  max-width: 34rem;
  margin: 0 auto;
}

body.child-person h1.child-sheet__title {
  margin: 0 0 18px;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #14201b;
}


.child-field > label {
  margin: 0 2px 7px;
  color: #14201b;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.child-field .auth-control,
.child-field .password-field {
  margin-bottom: 14px;
}

.child-field .password-field .auth-control { margin-bottom: 0; }

.child-field__hint {
  margin: -6px 2px 14px;
  color: #5c6b64;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.4;
}

.child-sheet .form-errors,
body.app-page .child-landing .form-errors {
  margin: 7px 2px 14px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #8f3d3d;
  font-size: 13px;
  line-height: 1.35;
}

.child-sheet .form-errors ul,
body.app-page .child-landing .form-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.child-access-tile,
body.app-page .child-landing .child-access {
  background: #f3f5f4;
  border-radius: 22px;
  margin: 4px 0 18px;
  padding: 18px 16px 8px;
}

.child-access-tile__title,
body.app-page .child-landing .child-access > summary {
  margin: 0 0 4px;
  color: #14201b;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Кто придумывает логин и где ребёнок его вводит: читается до полей, поэтому над ними. */
.child-access-tile__hint {
  margin: 0 2px 14px;
  color: #5c6b64;
  font-size: 13.5px;
  line-height: 1.4;
}

body.app-page .child-landing .child-access > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin: 0 0 12px;
  list-style: none;
  cursor: pointer;
}

body.app-page .child-landing .child-access > summary::-webkit-details-marker { display: none; }

body.app-page .child-landing .child-access > summary::before { content: none; }

body.app-page .child-landing .child-access > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #5c6b64;
  border-bottom: 1.5px solid #5c6b64;
  transform: rotate(-45deg);
}

body.app-page .child-landing .child-access[open] > summary::after { transform: rotate(45deg); }

body.app-page .child-landing .child-access .subtitle {
  margin: 0 0 14px;
  color: #5c6b64;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.4;
}

.child-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-sheet__aside {
  margin: 18px 0 0;
  font-size: 14px;
}

.child-sheet__aside a {
  color: #0f766e;
  text-decoration: none;
}

.child-sheet__delete {
  margin: 22px 0 0;
  text-align: center;
  font-size: 14px;
}

.child-sheet__delete a {
  color: #a32d2d;
  font-weight: 500;
  text-decoration: none;
}

body.app-page.app-onboarding .profile-child.child-landing {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

body.app-page .child-landing .profile-child-person > .profile-child-new,
body.app-page .child-landing .profile-child-person > .profile-child-fill,
body.app-page.app-onboarding .child-landing .profile-child-person > .profile-child-new,
body.app-page.app-onboarding .child-landing .profile-child-person > .profile-child-fill {
  margin-left: 0;
  margin-right: 0;
}

body.app-page.app-onboarding .child-landing .briefing-field {
  margin: 0;
}

body.app-page.app-onboarding .child-landing .briefing-field > label,
body.app-page.app-onboarding .child-landing .briefing-field-label-row,
body.app-page.app-onboarding .child-landing .briefing-field-label-row label {
  margin: 0 2px 7px;
  color: #14201b;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

/* The onboarding field rule stacks three :not() and ties a shorter selector.
   .briefing-field plus one :not() wins that tie because this block comes later. */
body.app-page .child-landing .briefing-field input.auth-control:not([type="hidden"]),
body.app-page.app-onboarding .child-landing .briefing-field input.auth-control:not([type="hidden"]) {
  display: block;
  width: 100%;
  height: 52px;
  margin: 0 0 14px;
  padding: 0 16px;
  border: 1px solid rgba(20, 32, 27, 0.22);
  border-radius: 14px;
  background: #fff;
  color: #14201b;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 16px;
  line-height: 1.3;
  box-shadow: none;
}

body.app-page .child-landing .briefing-field input.auth-control::placeholder,
body.app-page.app-onboarding .child-landing .briefing-field input.auth-control::placeholder {
  color: #8a9893;
}

body.app-page .child-landing .briefing-field .password-field input.auth-control,
body.app-page.app-onboarding .child-landing .briefing-field .password-field input.auth-control {
  padding-right: 52px;
}

body.app-page .child-landing .briefing-field input.auth-control:focus,
body.app-page .child-landing .briefing-field input.auth-control:focus-visible,
body.app-page.app-onboarding .child-landing .briefing-field input.auth-control:focus,
body.app-page.app-onboarding .child-landing .briefing-field input.auth-control:focus-visible {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16);
}

body.app-page .child-landing .child-field.has-error input.auth-control,
body.app-page.app-onboarding .child-landing .briefing-field:has(.form-errors) input.auth-control:not([type="hidden"]) {
  border-color: #c47878;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[type="radio"] {
  top: 17px;
  left: 17px;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(20, 32, 27, 0.35);
  background: #fff;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[type="radio"]:checked {
  border-width: 5px;
  border-color: #14b8a6;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[type="radio"]:focus-visible {
  outline: 2px solid #14b8a6;
  outline-offset: 2px;
}

body.app-page.app-onboarding .child-landing .profile-child-choice {
  min-height: 52px;
  padding: 0 16px 0 48px;
  border: 1px solid rgba(20, 32, 27, 0.14);
  border-radius: 14px;
  background: #fff;
  color: #14201b;
  font-family: Inter, "Inter Fallback", var(--gals-font-sans);
  font-size: 16px;
  font-weight: 500;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input:checked + .profile-child-choice {
  border-width: 1px;
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[value="new"],
body.app-page.app-onboarding .child-landing .profile-child-person > input[value="new"]:checked {
  border-color: rgba(20, 32, 27, 0.35);
  border-width: 1.5px;
  background: #fff;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[value="new"]:checked {
  border-width: 5px;
  border-color: #14b8a6;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[value="new"] + .profile-child-choice {
  border-style: solid;
  color: #14201b;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[value="new"] + .profile-child-choice::before {
  content: none;
}

body.app-page.app-onboarding .child-landing .profile-child-person > input[value="new"]:checked + .profile-child-choice {
  border-style: solid;
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

body.app-page.app-onboarding .section-title {
  margin: 40px 0 16px;
  color: var(--onb-ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

/* Plan */
body.app-page.app-onboarding .strategy-editor,
body.app-page.app-onboarding .strategy-job-failed {
  border-radius: var(--onb-radius-tile);
  background: var(--onb-tile);
  padding: clamp(24px, 4.5vw, 56px);
}

/* The action bar is the foot of the tile. Bottom padding would leave a grey
   rounded lip under the buttons, wider than the pill. */
body.app-page.app-onboarding .strategy-editor:has(.strategy-editor-actions) {
  padding-bottom: 0;
}

body.app-page.app-onboarding .strategy-job-failed .job-status-label {
  margin: 0 0 8px;
  color: var(--onb-ink);
  font-size: 19px;
  font-weight: 600;
}

body.app-page.app-onboarding .strategy-job-failed .job-status-error {
  margin: 0;
  color: var(--onb-error);
  font-size: 15px;
}

body.app-page.app-onboarding .strategy-job-failed .btn-primary {
  width: min(100%, 34rem);
  align-self: center;
}

body.app-page.app-onboarding .strategy-editor--full-height #strategy-plan-form,
body.app-page.app-onboarding .strategy-editor--full-height .strategy-editor-panes,
body.app-page.app-onboarding .strategy-editor--full-height .strategy-plan-preview,
body.app-page.app-onboarding .strategy-plan-preview,
body.app-page.app-onboarding .strategy-pane-edit,
body.app-page.app-onboarding .strategy-pane-preview {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

body.app-page.app-onboarding .strategy-pane-preview,
body.app-page.app-onboarding .strategy-pane-edit {
  display: flex;
  flex-direction: column;
}

body.app-page.app-onboarding .strategy-editor.is-edit-mode .strategy-pane-preview,
body.app-page.app-onboarding .strategy-editor.is-view-mode .strategy-pane-edit,
body.app-page.app-onboarding .strategy-editor.is-edit-mode .strategy-plan-mode-btn--edit,
body.app-page.app-onboarding .strategy-editor.is-view-mode .strategy-plan-mode-btn--preview {
  display: none;
}

.strategy-plan-mode-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.app-page.app-onboarding .strategy-plan-mode-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
}

body.app-page.app-onboarding .strategy-plan-mode-btn {
  position: static;
  align-self: flex-end;
  width: auto;
  height: auto;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--onb-accent);
  font-size: 15px;
  font-weight: 500;
}

body.app-page.app-onboarding .strategy-plan-mode-btn:hover:not(:disabled) {
  background: transparent;
  color: var(--onb-accent);
}

body.app-page.app-onboarding .strategy-plan-preview {
  max-width: 40rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--onb-ink);
  font-size: 17px;
  line-height: 1.6;
}

body.app-page.app-onboarding .strategy-plan-preview h2,
body.app-page.app-onboarding .markdown-body.strategy-plan-preview h2 {
  margin: 32px 0 0;
  color: var(--onb-ink);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

body.app-page.app-onboarding .strategy-plan-preview h2:first-child {
  margin-top: 0;
}

body.app-page.app-onboarding .strategy-plan-preview h3 {
  margin: 24px 0 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

body.app-page.app-onboarding .strategy-plan-preview p {
  margin: 0.8em 0 0;
  font-size: 17px;
  line-height: 1.6;
}

body.app-page.app-onboarding .strategy-plan-preview li {
  margin-top: 6px;
}

body.app-page.app-onboarding .strategy-plan-preview li::marker {
  color: var(--onb-accent);
}

body.app-page.app-onboarding .strategy-plan-preview strong {
  font-weight: 600;
}

body.app-page.app-onboarding .strategy-plan-preview a {
  color: var(--onb-accent);
}

body.app-page.app-onboarding .strategy-plan-preview th,
body.app-page.app-onboarding .strategy-plan-preview td {
  border-color: var(--onb-line);
  background: transparent;
}

body.app-page.app-onboarding .strategy-textarea {
  min-height: calc(1.6em * 18 + 28px);
  padding: 14px 16px;
  border: 1px solid var(--onb-field-line);
  border-radius: 14px;
  background: #fff;
  color: var(--onb-ink);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
}

body.app-page.app-onboarding .strategy-editor.is-edit-mode .strategy-textarea {
  flex: none;
  height: auto;
  padding: 14px 16px;
}

body.app-page.app-onboarding .strategy-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  align-items: flex-start;
  margin: 24px calc(-1 * clamp(24px, 4.5vw, 56px)) 0;
  padding: 16px clamp(24px, 4.5vw, 56px) 20px;
  border-top: 1px solid var(--onb-line);
  border-radius: 0 0 var(--onb-radius-tile) var(--onb-radius-tile);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
}

/* Same column as the plan text (max 40rem, left edge), not the 34rem head.
   A 34rem pill centered in the wider tile sat inside the document. */
body.app-page.app-onboarding .strategy-editor-actions .btn-primary,
body.app-page.app-onboarding .strategy-editor-actions .onboarding-text-link {
  width: min(100%, 40rem);
  align-self: flex-start;
}

/* The chevron is as wide as the empty lead, so the words sit on the pill's axis. */
body.app-page.app-onboarding .strategy-editor-actions .onboarding-text-link::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
}

/* Night: first set */
body.app-page.app-onboarding.app-onboarding--night {
  background: var(--onb-night);
  color: var(--onb-on-night);
  color-scheme: dark;
}

body.app-page.app-onboarding.app-onboarding--night .app-main-inner {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

body.app-page.app-onboarding.app-onboarding--night .app-site {
  background: rgba(3, 17, 14, 0.55);
  color: var(--onb-on-night);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.app-page.app-onboarding.app-onboarding--night .landing-logo,
body.app-page.app-onboarding.app-onboarding--night .app-toolbar-link,
body.app-page.app-onboarding.app-onboarding--night .landing-staff-link,
body.app-page.app-onboarding.app-onboarding--night .app-toolbar-form .btn-link,
body.app-page.app-onboarding.app-onboarding--night .app-toolbar-badge {
  color: var(--onb-on-night);
}

body.app-page.app-onboarding.app-onboarding--night .app-toolbar-badge,
body.app-page.app-onboarding.app-onboarding--night .lang-picker--landing .lang-picker__trigger {
  border-color: rgba(255, 255, 255, 0.24);
  background: transparent;
  color: var(--onb-on-night);
}

body.app-page.app-onboarding.app-onboarding--night .app-site-footer,
body.app-page.app-onboarding.app-onboarding--night .app-site-footer a {
  color: var(--onb-on-night-muted);
  border-top-color: rgba(255, 255, 255, 0.10);
}

body.app-page.app-onboarding.app-onboarding--night .onboarding-kicker {
  color: var(--onb-accent-night);
}

body.app-page.app-onboarding.app-onboarding--night .onboarding-segment {
  background: rgba(255, 255, 255, 0.16);
}

body.app-page.app-onboarding.app-onboarding--night .onboarding-segment.is-fill {
  background: var(--onb-accent-night);
}

body.app-page.app-onboarding.app-onboarding--night .onboarding-frame h1 {
  color: var(--onb-on-night);
}

body.app-page.app-onboarding.app-onboarding--night .onboarding-lead,
body.app-page.app-onboarding.app-onboarding--night .onboarding-back {
  color: var(--onb-on-night-muted);
}

body.app-page.app-onboarding.app-onboarding--night :focus-visible {
  outline-color: var(--onb-accent-night);
}

body.app-page.app-onboarding.app-onboarding--night .btn-primary {
  background: var(--onb-accent-night);
  color: var(--onb-night);
}

@media (hover: hover) {
  body.app-page.app-onboarding.app-onboarding--night .btn-primary:hover:not(:disabled):not(.is-disabled) {
    background: var(--onb-accent-night);
    filter: brightness(1.06);
  }
}

/* The tree and the path of a long wait (templates/includes/wait_path.html, core/wait_path.py,
   docs/dev/wait-screens.md). Night by nature: it is all of step 3 of a course, and in a light
   frame it is a card on the same night as .set-moment. Its tokens are its own, so it stands on
   any page. */
.wait-path {
  --wp-night: var(--gals-color-night);
  --wp-glow: var(--gals-color-night-glow);
  --wp-text: var(--gals-color-on-night);
  --wp-muted: #9fb5ae;
  --wp-accent: var(--gals-color-accent-bright);
  --wp-error: #fda29b;
  --wp-line: rgba(255, 255, 255, 0.10);
  width: 100%;
  color: var(--wp-text);
}

.wait-path--card {
  padding: clamp(24px, 4.5vw, 48px) clamp(20px, 4.5vw, 56px);
  border-radius: var(--onb-radius-tile, 28px);
  background: radial-gradient(ellipse at 50% 36%, var(--wp-glow) 0%, var(--wp-night) 78%);
}

/* The tree and its caption go together: without scripts the whole of them is hidden and leaves no gap. */
.wait-path__art {
  margin-bottom: 32px;
}

.wait-path--card .wait-path__art {
  margin-bottom: 24px;
}

.wait-path__tree {
  --kt-branch: #2dd4bf;
  --kt-tip: #ccfbf1;
  --kt-fruit: var(--gals-color-accent-warm);
  position: relative;
  width: min(640px, 90vw);
  min-width: min(300px, 100%);
  aspect-ratio: 1.033 / 1;
  margin: 0 auto;
  pointer-events: none;
}

/* Behind the crown: the same glow as on the first screen of the main page. */
.wait-path__tree::before {
  content: "";
  position: absolute;
  inset: 8% 0 0;
  z-index: 0;
  background: radial-gradient(ellipse closest-side at 50% 42%, var(--wp-glow), transparent);
}

.wait-path--card .wait-path__tree {
  width: min(420px, 100%);
  min-width: 0;
}

.wait-path--card .wait-path__tree::before {
  content: none;
}

.wait-path__tree svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* The map is as tall as it is drawn: the picture inside takes its proportions from the drawing, so
   the caption stands under it and not under the empty rest of a frame made for the band tree. Until
   the drawing is mounted the frame holds a typical map's proportions, so nothing jumps by much.
   The tree of a wait only grows, it takes no pointer. */
.wait-path__tree[data-variant="graph"] {
  aspect-ratio: auto;
  pointer-events: none;
}

.wait-path__tree[data-variant="graph"]:not(:has(svg)) {
  aspect-ratio: 0.9 / 1;
}

.wait-path__tree[data-kt-mode="grow"] {
  width: min(640px, 90vw, calc(52vh * var(--kt-aspect, 0.72)));
}

.wait-path__tree[data-kt-mode="roots"] {
  pointer-events: auto;
}

.wait-path__tree[data-kt-mode="roots"]:not(:has(svg)) {
  aspect-ratio: 1.6 / 1;
}

.wait-path--solo .wait-path__art {
  margin-bottom: 0;
}

/* The wait of a single job (job_status.html): the card itself is the night, the tree stands alone
   in it. Its height follows the window, so the card does not grow past the first screen. */
.job-status-card--night {
  padding: clamp(20px, 3vw, 32px) clamp(20px, 4vw, 40px);
  border-radius: var(--landing-radius, 18px);
  background: radial-gradient(ellipse at 50% 70%, var(--gals-color-night-glow) 0%, var(--gals-color-night) 80%);
  color: var(--gals-color-on-night);
}

.job-status-card--night .job-status-label {
  color: var(--gals-color-on-night);
}

.job-status-card--night .job-status-hint {
  color: #9fb5ae;
}

.job-status-tree {
  margin-top: 8px;
}

.wait-path--solo .wait-path__tree {
  width: min(420px, 100%, 34vh);
  min-width: 0;
}

/* The roots are wider than they are tall: as wide as the card allows, but not taller than a third of the window. */
.wait-path--solo .wait-path__tree[data-kt-mode="roots"] {
  width: min(520px, 100%, calc(40vh * var(--kt-aspect, 1.6)));
}

/* Stands under the drawing: a hovered or tapped root writes its topic here (knowledge-tree.js).
   On the set wait the lines are the same as on Progress: section · topic, then the status.
   Not the browser tooltip. */
.wait-path__caption {
  position: relative;
  z-index: 1;
  margin: 6px auto 0;
  color: rgba(238, 251, 247, 0.85);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
}

.wait-path__tree[data-kt-mode="roots"] .wait-path__caption {
  min-height: 2.9em;
}

/* The path and its hints: one column under the tree, the right column from 900px. */
.wait-path__side {
  width: min(26rem, calc(100% - 48px));
  margin: 0 auto;
}

.wait-path--card .wait-path__side {
  width: min(26rem, 100%);
}

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

.wait-path__hints {
  margin: 14px 0 0;
  color: var(--wp-muted);
  font-size: 14px;
}

.wait-path__hints .job-status-hint {
  margin: 0 0 4px;
  color: inherit;
  font-size: 14px;
}

.wait-path__row {
  padding: 14px 0;
  border-top: 1px solid var(--wp-line);
}

.wait-path__row:last-child {
  padding-bottom: 0;
}

.wait-path__line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--wp-text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
}

.wait-path__row.is-future .wait-path__label {
  color: var(--wp-muted);
}

/* One mark box of 24px for every state, so the labels stand on one line. */
.wait-path__mark,
.wait-path__spinner {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-sizing: border-box;
}

.wait-path__mark {
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--wp-muted);
  font-size: 13px;
  font-weight: 600;
}

.wait-path__row.is-done .wait-path__mark {
  border-color: var(--wp-accent);
  background: var(--wp-accent);
  color: var(--wp-night);
}

.wait-path__row.is-failed .wait-path__mark {
  border-color: var(--wp-error);
  color: var(--wp-error);
}

/* The going step: a ring of 20px in the middle of the 24px box. */
.wait-path__spinner::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid rgba(45, 212, 191, 0.25);
  border-top-color: var(--wp-accent);
  border-radius: 50%;
  box-sizing: border-box;
  animation: task-photo-spin 1s linear infinite;
}

.wait-path__note {
  margin: 8px 0 0 36px;
  color: var(--wp-error);
  font-size: 15px;
  line-height: 1.4;
}

.wait-path__retry {
  width: auto;
  margin: 12px 0 0;
}

.wait-path .btn-primary {
  background: var(--wp-accent);
  color: var(--wp-night);
}

@media (hover: hover) {
  .wait-path .btn-primary:hover:not(:disabled) {
    background: var(--wp-accent);
    filter: brightness(1.06);
  }
}

.wait-path :focus-visible {
  outline: 2px solid var(--wp-accent);
  outline-offset: 2px;
}

/* Wide screens: the tree on the left, the path and its hints on the right, the block centred on
   the width and the columns on the height, so the going row does not slide below the fold
   (1440x900 and 1280x720 are measured, docs/dev/wait-screens.md § 8). The tree is sized by the
   height of the window: it stays the main thing of the frame and the path stays on the screen.
   Without a list the tree is alone and the column is one. */
@media (min-width: 900px) {
  .wait-path:not(.wait-path--solo) {
    --wp-tree: clamp(260px, 46vh, 520px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    column-gap: clamp(32px, 5vw, 72px);
    align-items: center;
    max-width: 62rem;
    margin: 0 auto;
    padding: 0 24px;
  }

  .wait-path:not(.wait-path--solo) .wait-path__art {
    margin-bottom: 0;
  }

  .wait-path:not(.wait-path--solo) .wait-path__tree {
    width: min(var(--wp-tree), 100%);
    min-width: 0;
  }

  .wait-path:not(.wait-path--solo) .wait-path__tree[data-kt-mode="grow"] {
    width: min(var(--wp-tree), 100%, calc(46vh * var(--kt-aspect, 0.72)));
  }

  .wait-path:not(.wait-path--solo) .wait-path__side {
    width: auto;
    margin: 0;
  }

  /* In a light frame the card grows wider than the 34rem column and stays on its axis. */
  .wait-path--card:not(.wait-path--solo) {
    --wp-card: min(60rem, calc(100vw - 48px));
    width: var(--wp-card);
    max-width: none;
    margin-left: calc(50% - var(--wp-card) / 2);
    padding: clamp(24px, 4vw, 48px) clamp(24px, 4vw, 56px);
  }
}

/* A course (docs/dev/course-tree-roots.md § 4): the head comes with the path and stands in the grid of
   the component. Narrow: head, tree, path. From 900px: the head, the path and its hints in a column
   of 460px, centred on the height, the tree beside it over the whole height of the frame. */
.wait-path--head {
  --wp-h: clamp(380px, calc(100vh - 228px), 780px);
}

.wait-path__head {
  margin: 0 auto 8px;
  max-width: 34rem;
  text-align: center;
}

body.app-page.app-onboarding .wait-path__head h1 {
  margin: 0;
  max-width: none;
  color: var(--wp-text);
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.wait-path__lead {
  margin: 12px 0 20px;
  color: var(--wp-muted);
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.4;
}

/* Retry stands under its error and is as wide as its words. */
body.app-page.app-onboarding .wait-path--head .wait-path__retry {
  align-items: flex-start;
  margin: 12px 0 0 36px;
}

body.app-page.app-onboarding .wait-path--head .wait-path__retry .btn {
  width: auto;
  height: auto;
  padding: 10px 24px;
  font-size: 15px;
}

@media (min-width: 900px) {
  /* The frame gives its air to the picture: the head of the page keeps only the way back. */
  body.app-page.app-onboarding.app-onboarding--night .onboarding-subnav-inner:has(.onboarding-frame--path) {
    padding-top: 24px;
  }

  body.app-page.app-onboarding.app-onboarding--night .app-main:has(.wait-path--head) {
    padding-top: 0;
    padding-bottom: 24px;
  }

  .wait-path.wait-path--head {
    grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
    grid-template-rows: 1fr auto auto 1fr;
    align-items: start;
    max-width: 76rem;
  }

  .wait-path--head .wait-path__head {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    max-width: none;
    text-align: left;
  }

  .wait-path--head .wait-path__side {
    grid-column: 1;
    grid-row: 3;
  }

  .wait-path--head .wait-path__art {
    grid-column: 2;
    grid-row: 1 / 5;
    align-self: center;
  }

  .wait-path.wait-path--head .wait-path__tree[data-variant] {
    width: min(100%, calc(var(--wp-h) * var(--kt-aspect, 1.033)));
  }

  /* The map of a wait has a hint under it (two lines at most), which the picture makes room for. */
  .wait-path.wait-path--head .wait-path__tree[data-variant="graph"][data-kt-mode="grow"] {
    width: min(100%, calc((var(--wp-h) - 60px) * var(--kt-aspect, 0.75)));
  }
}

/* Wide but short (a laptop, 1280x720): the head of a frame with a path gives up some air above,
   or the retry under a failed row slips below the edge of the window. */
@media (min-width: 900px) and (max-height: 820px) {
  body.app-page.app-onboarding .onboarding-subnav-inner:has(.onboarding-frame--path) {
    padding-top: clamp(32px, 6vh, 48px);
  }

  body.app-page.app-onboarding .app-main:has(.wait-path) {
    padding-top: 28px;
  }
}

/* The wait for a set (job_status.html, docs/dev/set-wait-screen.md): the head, the tree and the path
   stand inside the night card of the page. The head is an h2 (the h1 of the page stays above the card).
   Narrow: head, tree, path with the topics, hints. From 900px: the tree on the left over the height of the
   frame, the head, the path with its topics and the hints in the right column, centred on the height. */
.job-status-card--chain {
  text-align: left;
}

.wait-path--chain .wait-path__head {
  margin: 0 auto 4px;
  max-width: 26rem;
}

.wait-path--chain .wait-path__head h2 {
  margin: 0 0 16px;
  color: var(--wp-text);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.wait-path--chain .wait-path__art {
  margin-bottom: 20px;
}

.wait-path--chain .wait-path__side {
  width: min(26rem, 100%);
}

.wait-path--chain .wait-path__tree[data-variant] {
  width: min(100%, 420px, calc(36vh * var(--kt-aspect, 1.6)));
  min-width: 0;
}

.wait-path--chain .wait-path__tree[data-variant="band"] {
  width: min(100%, 300px);
}

/* After the label of a row: how many (muted). */
.wait-path__detail {
  margin-left: -6px;
  color: var(--wp-muted);
  font-size: 15px;
  font-weight: 400;
}

/* Under the first row: the topics of the set, small, one under another. */
.wait-path__topics {
  margin: 8px 0 0 36px;
  padding: 0;
  list-style: none;
  color: var(--wp-muted);
  font-size: 14px;
  line-height: 1.45;
}

.wait-path__topics li + li {
  margin-top: 2px;
}

@media (min-width: 900px) {
  .wait-path.wait-path--chain {
    --wp-tree: clamp(260px, 46vh, 520px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    grid-template-rows: 1fr auto auto 1fr;
    align-items: start;
    max-width: 62rem;
    padding: 0;
  }

  .wait-path.wait-path--chain .wait-path__art {
    grid-column: 1;
    grid-row: 1 / 5;
    align-self: center;
    margin: 0;
  }

  .wait-path.wait-path--chain .wait-path__head {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    margin: 0;
    text-align: left;
  }

  .wait-path.wait-path--chain .wait-path__side {
    grid-column: 2;
    grid-row: 3;
    width: auto;
    margin: 0;
  }

  .wait-path.wait-path--chain .wait-path__tree[data-variant] {
    width: min(100%, 560px, calc(var(--wp-tree) * var(--kt-aspect, 1.6)));
  }

  .wait-path.wait-path--chain .wait-path__tree[data-variant="band"] {
    width: min(100%, var(--wp-tree));
  }
}

/* No motion: the ring stands still with a dot on it. */
@media (prefers-reduced-motion: reduce) {
  .wait-path__spinner::before {
    border-color: var(--wp-accent);
    background: radial-gradient(circle at 50% 2px, var(--wp-accent) 0 2px, transparent 2.5px);
    animation: none;
  }
}

@media (max-width: 860px) {
  body.app-page.app-onboarding {
    --onb-radius-tile: 22px;
  }

  body.app-page.app-onboarding .strategy-editor-actions {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-right: 24px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: 24px;
    border-radius: 0;
  }
}

@media (min-resolution: 2dppx) {
  body.app-page.app-onboarding .profile-child-block,
  body.app-page.app-onboarding .strategy-editor-actions,
  .wait-path__row {
    border-width: 0.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.app-page.app-onboarding .interests-toggle input,
  body.app-page.app-onboarding .profile-child-check,
  body.app-page.app-onboarding .child-access summary::after {
    transition: none;
    animation: none;
  }
}

/* Test preparation creation (2026-10-15): the same frame as the course questionnaire
   (head, 34rem column, fields, switches, one pill) applied to «Test» → «Topics» → «Ready
   set». Only what the course frame does not already have is below. */
body.app-page.app-onboarding .prep-form {
  margin: 0;
}

body.app-page.app-onboarding .prep-block {
  margin: 0 0 32px;
}

body.app-page.app-onboarding .prep-block .briefing-field {
  margin-bottom: 0;
}

body.app-page.app-onboarding .prep-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

body.app-page.app-onboarding .prep-block__head label {
  margin: 0;
  color: var(--onb-ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

body.app-page.app-onboarding .prep-block__remove {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--onb-field-line);
  border-radius: 50%;
  background: #fff;
  color: var(--onb-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

body.app-page.app-onboarding .prep-block__remove::after {
  content: "";
  position: absolute;
  inset: -6px;
}

body.app-page.app-onboarding .school-drop {
  max-width: none;
  margin-top: 12px;
  padding: 20px;
  border: 1px dashed var(--onb-field-line);
  border-radius: var(--onb-radius-field);
  background: var(--onb-tile);
  color: var(--onb-muted);
  font-size: 15px;
}

body.app-page.app-onboarding .school-drop.is-over {
  border-color: var(--onb-accent);
  background: #e7f1ef;
}

body.app-page.app-onboarding .school-drop__empty {
  min-height: 44px;
  padding: 4px 0;
  color: var(--onb-ink);
}

body.app-page.app-onboarding .school-drop__plus {
  width: 40px;
  height: 40px;
  color: var(--onb-accent);
  font-size: 24px;
}

body.app-page.app-onboarding .school-drop__label {
  font-size: 17px;
  font-weight: 600;
}

body.app-page.app-onboarding .school-drop__hint {
  color: var(--onb-muted);
  font-size: 15px;
}

body.app-page.app-onboarding .school-drop__more {
  min-height: 44px;
  margin: 0;
  color: var(--onb-accent);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

body.app-page.app-onboarding .school-drop__more:hover {
  color: var(--onb-accent);
}

body.app-page.app-onboarding .school-drop__error {
  color: var(--onb-error);
  font-size: 14px;
}

body.app-page.app-onboarding .photo-stack-list {
  gap: 12px;
}

body.app-page.app-onboarding .photo-stack-item {
  width: 72px;
  height: 72px;
}

body.app-page.app-onboarding .photo-stack-thumb {
  border-radius: 10px;
  border-color: var(--onb-line);
}

body.app-page.app-onboarding .photo-stack-remove {
  width: 28px;
  height: 28px;
  top: -10px;
  right: -10px;
  border-color: var(--onb-field-line);
  color: var(--onb-muted);
}

body.app-page.app-onboarding .photo-stack-add {
  border-color: var(--onb-field-line);
  border-radius: 10px;
  color: var(--onb-accent);
}

body.app-page.app-onboarding .prep-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--onb-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

body.app-page.app-onboarding .prep-link--quiet {
  align-self: center;
  margin-top: 8px;
  color: var(--onb-muted);
}

@media (hover: hover) {
  body.app-page.app-onboarding .prep-link--quiet:hover {
    color: var(--onb-ink);
  }
}

body.app-page.app-onboarding .prep-link:disabled {
  opacity: 0.4;
  cursor: default;
}

body.app-page.app-onboarding .prep-add {
  margin: -16px 0 0;
}

body.app-page.app-onboarding .prep-heading {
  margin: 32px 0 8px;
  color: var(--onb-ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

body.app-page.app-onboarding .prep-topics {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.app-page.app-onboarding .prep-topic {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin: 0 0 12px;
}

body.app-page.app-onboarding .prep-topic__mark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 52px;
  margin: 0;
  cursor: pointer;
}

body.app-page.app-onboarding .prep-topic__check {
  appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1.5px solid var(--onb-field-line);
  border-radius: 50%;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms;
}

body.app-page.app-onboarding .prep-topic__check:checked {
  border-color: var(--onb-accent);
  background-color: var(--onb-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body.app-page.app-onboarding .prep-topic__body {
  flex: 1;
  min-width: 0;
}

body.app-page.app-onboarding .prep-topic__src {
  margin: 6px 0 0;
  color: var(--onb-muted);
  font-size: 14px;
  line-height: 1.4;
}

body.app-page.app-onboarding .prep-group {
  margin: 32px 0 0;
  padding: clamp(20px, 3vw, 28px);
  border-radius: var(--onb-radius-tile);
  background: var(--onb-tile);
}

body.app-page.app-onboarding .prep-group__title {
  margin: 0 0 12px;
  color: var(--onb-ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

body.app-page.app-onboarding .prep-group__list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.app-page.app-onboarding .prep-group__text {
  display: block;
  color: var(--onb-ink);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.app-page.app-onboarding .prep-group__why {
  display: block;
  margin-top: 2px;
  color: var(--onb-muted);
  font-size: 14px;
  line-height: 1.4;
}

body.app-page.app-onboarding .prep-group .school-drop {
  background: #fff;
}

body.app-page.app-onboarding .prep-group__add {
  margin: 8px 0 0;
}

body.app-page.app-onboarding .prep-note {
  margin: 0 0 24px;
  color: var(--onb-muted);
  font-size: 15px;
}

body.app-page.app-onboarding .prep-note--error {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--onb-error-bg);
  color: var(--onb-error);
}

/* «For: Mira» under the head of a preparation's «Topics» and «Ready set»: whose it is, quietly. */
body.app-page.app-onboarding .onboarding-person {
  margin: 12px auto 0;
  color: var(--onb-muted);
  font-size: 15px;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  body.app-page.app-onboarding .prep-topic__check {
    transition: none;
  }
}

/* Homework check start (2026-10-16): the same frame as the course and test preparation, a head
   without steps and one form (templates/parent/homework_start.html). The photo tiles, fields,
   the «For a child» switch and the pill are the frame's own; only what they lack is below. */
body.app-page.app-onboarding .hw-start {
  margin: 0;
}

body.app-page.app-onboarding .hw-step {
  margin: 0 0 24px;
}

body.app-page.app-onboarding .hw-step__title {
  margin: 0 0 8px;
  color: var(--onb-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

/* A low tile: the mark, the action and its limit on one line, so the button stays on the first
   screen of a phone. The solution is the main one: it has the accent outline. */
body.app-page.app-onboarding .hw-step .school-drop {
  margin-top: 0;
  padding: 10px 16px;
}

body.app-page.app-onboarding .hw-step--main .school-drop {
  border-style: solid;
  border-color: var(--onb-accent);
}

body.app-page.app-onboarding .hw-step .school-drop__empty {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 2px 12px;
  width: 100%;
  text-align: left;
}

body.app-page.app-onboarding .hw-step .school-drop__label {
  font-size: 16px;
}

/* The photo is the point of the screen: a big tile, the plus and the action stacked in its
   middle. Everything after it (a child, a typed answer, the task) is optional and quiet. */
body.app-page.app-onboarding .hw-step--hero .school-drop {
  padding: 0;
}

body.app-page.app-onboarding .hw-step--hero .school-drop__empty {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 24px 16px;
  text-align: center;
}

body.app-page.app-onboarding .hw-step--hero .photo-stack {
  padding: 12px;
}

body.app-page.app-onboarding .hw-step--hero .school-drop__plus {
  width: 64px;
  height: 64px;
  font-size: 34px;
}

body.app-page.app-onboarding .hw-step--hero .school-drop__label {
  font-size: 20px;
}

body.app-page.app-onboarding .hw-step .school-drop__hint {
  font-size: 14px;
}

body.app-page.app-onboarding .hw-text > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 44px;
  color: var(--onb-accent);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}

body.app-page.app-onboarding .hw-text > summary::-webkit-details-marker {
  display: none;
}

body.app-page.app-onboarding .hw-text > summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: -2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

body.app-page.app-onboarding .hw-text[open] > summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

body.app-page.app-onboarding .hw-text > summary:hover {
  color: var(--onb-accent);
}

body.app-page.app-onboarding .hw-text[open] > summary {
  margin-bottom: 4px;
}

/* The typed answer is for one's own homework only: a child's is dropped (core.homework). */
body.app-page.app-onboarding .hw-start:has(#for-child:checked) [data-homework-answer-block] {
  display: none;
}

body.app-page.app-onboarding .hw-start__foot {
  margin-top: 32px;
}

body.app-page.app-onboarding .hw-note {
  margin: 12px 0 0;
  color: var(--onb-muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

/* What is missing, said after the button was pressed too early. */
body.app-page.app-onboarding .hw-note--need {
  color: var(--onb-error);
}

body.app-page.app-onboarding .hw-start .input[aria-invalid="true"] {
  border-color: var(--onb-error);
}

body.app-page.app-onboarding .hw-note[hidden],
body.app-page.app-onboarding .hw-train[hidden] {
  display: none;
}

body.app-page.app-onboarding .hw-train {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  margin-top: 16px;
  padding: 0;
  border-radius: 0;
  background: none;
  text-align: center;
}

body.app-page.app-onboarding .hw-train p {
  flex: none;
  margin: 0;
  color: var(--onb-ink);
  font-size: 15px;
  line-height: 1.4;
}

body.app-page.app-onboarding .hw-start .photo-quota-note {
  margin: 12px 0 0;
  color: var(--onb-muted);
  font-size: 14px;
  text-align: center;
}

/* «For a child» on the check is an optional extra, not a step: a light row under the photo,
   not the heavy tile the questionnaires use. */
body.app-page.app-onboarding .hw-start .profile-child {
  margin: 8px 0 0;
  padding: 0;
  border-radius: 0;
  background: none;
}

body.app-page.app-onboarding .hw-start .profile-child-toggle {
  min-height: 44px;
  font-size: 15px;
  font-weight: 400;
}

/* On a phone the button of the check stays on the first screen (390×844): the stack is a little
   tighter than the course's. */
@media (max-width: 480px) {
  body.app-page.app-onboarding .hw-step {
    margin-bottom: 14px;
  }

  body.app-page.app-onboarding .hw-text > summary {
    min-height: 36px;
  }

  body.app-page.app-onboarding .hw-start .profile-child {
    margin-top: 20px;
  }

  body.app-page.app-onboarding .hw-start__foot {
    margin-top: 24px;
  }
}

/* The language select (templates/includes/language_select.html): its text field shows only
   while «Other…» is chosen. The form styles above set display and margin on every text
   input, so the toggle needs !important to win. */
.briefing-field > .language-other {
  display: none !important;
}

.briefing-field:has(> select.language-select option[value="__other__"]:checked) > .language-other {
  display: block !important;
  margin-top: 8px !important;
}

/* In a settings row the grid's row gap already spaces it */
body.app-course .profile-settings .briefing-field:has(> select.language-select option[value="__other__"]:checked) > .language-other {
  margin-top: 0 !important;
}

/* The course creation form folds the language of explanations into one quiet line
   (templates/includes/profile_create_fields.html): «Explanations in Russian · Change». Opening
   the <details> hides the line and shows the field; there is no way back. */
.language-fold:not([open]) {
  margin: 0 0 16px;
}

.language-fold__line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 44px;
  color: var(--onb-muted, #5b6b64);
  font-size: 15px;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.language-fold__line::-webkit-details-marker {
  display: none;
}

.language-fold[open] > .language-fold__line {
  display: none;
}

.language-fold__icon {
  flex: none;
  color: var(--onb-muted, #5b6b64);
}

.language-fold__change {
  color: var(--onb-accent, #0f766e);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.language-fold__line:hover .language-fold__change {
  text-decoration-thickness: 2px;
}

.language-fold__line:focus-visible {
  outline: 2px solid var(--onb-accent, #0f766e);
  outline-offset: 2px;
  border-radius: 8px;
}

.briefing-field-hint {
  margin: 8px 0 0;
  color: var(--onb-muted, #5b6b64);
  font-size: 14px;
  line-height: 1.45;
}

/* ── Passkeys (docs/dev/sso.md § Ключи доступа) ───────────────────────────── */
/* The offer after sign-in: a small card in the bottom corner, over the page — it does not push the
   cabinet down and stays quieter than the page's own main button. passkeys.js adds .is-shown. */
.passkey-offer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: 16px 40px 16px 16px;
  border: 1px solid rgba(20, 32, 27, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 32, 27, 0.12), 0 2px 6px rgba(20, 32, 27, 0.06);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.passkey-offer.is-shown { opacity: 1; transform: none; }
.passkey-offer[hidden] { display: none; }
.passkey-offer__icon { flex: none; margin-top: 1px; color: #0f766e; }
.passkey-offer__body { min-width: 0; }
.passkey-offer__title { margin: 0 0 3px; font-size: 15px; font-weight: 600; color: #14201b; }
.passkey-offer__lead { margin: 0; font-size: 13px; line-height: 1.45; color: #5b6b64; }
.passkey-offer__actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.passkey-offer__actions[hidden] { display: none; }
.passkey-offer__on {
  padding: 7px 14px;
  border: 1px solid rgba(20, 32, 27, 0.22);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #14201b;
  cursor: pointer;
  transition: background 0.12s ease;
}
.passkey-offer__on:hover { background: #f6f8f7; }
.passkey-offer__on:disabled { opacity: 0.6; cursor: default; }
.passkey-offer__later {
  border: 0;
  background: none;
  padding: 7px 2px;
  font: inherit;
  font-size: 14px;
  color: #5b6b64;
  cursor: pointer;
}
.passkey-offer__later:hover { color: #14201b; }
.passkey-offer__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #8a9790;
  cursor: pointer;
}
.passkey-offer__close:hover { background: #f1f4f2; color: #14201b; }
.passkey-offer :focus-visible { outline: 2px solid #14b8a6; outline-offset: 2px; }
/* Phone: the same card along the bottom edge, above the home indicator. */
@media (max-width: 560px) {
  .passkey-offer {
    right: 12px;
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .passkey-offer { transition: none; }
}

/* The passkeys page: the account's devices, one row each. */
.passkeys-lead { max-width: 640px; color: #3d4a44; }
.passkeys-list { list-style: none; margin: 22px 0; padding: 0; max-width: 640px; }
.passkeys-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(20, 32, 27, 0.1);
}
.passkeys-item__name { margin: 0; font-weight: 600; color: #14201b; }
.passkeys-item__meta { margin: 2px 0 0; font-size: 13px; color: #5b6b64; }
.passkeys-item__delete {
  border: 0;
  background: none;
  padding: 6px 2px;
  font: inherit;
  font-size: 14px;
  color: #b42318;
  cursor: pointer;
}
.passkeys-item__delete:hover { text-decoration: underline; }
.passkeys-empty { margin: 22px 0; color: #5b6b64; }
.passkeys-add[hidden] { display: none; }
.passkeys-note { margin: 12px 0 0; font-size: 14px; color: #3d4a44; min-height: 1.4em; }
.sub-account-links { margin: 28px 0 0; font-size: 14px; }

.view-as-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  padding: 6px 16px;
  background: #fde68a;
  color: #422006;
  font-size: 14px;
}
.view-as-bar form { margin: 0; }
.view-as-bar button {
  border: 1px solid #422006;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
}

/* Homework check in progress: the card on the task screen while its first check runs (templates/includes/homework_task_body.html). */
.hw-wait {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.25rem;
}

.hw-wait__spinner {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  border: 2px solid rgba(13, 148, 136, 0.2);
  border-top-color: var(--gals-color-accent, #0d9488);
  border-radius: 50%;
  animation: task-photo-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.hw-wait__body {
  flex: 1 1 auto;
  min-width: 0;
}

.hw-wait__label {
  margin: 0;
  font-weight: 600;
}

.hw-wait__hint {
  margin: 0.35rem 0 0;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}

/* The task's text field sits right above its photo zone. */
.hw-textarea + [data-homework-zone] {
  margin-top: 0.5rem;
}

/* Sound set (docs/product/sound-set.md, templates/includes/sound_task_learner.html) */
/* Until the device check passes: this sound set's list, and the card on its task screen.
   Another set on the same page (a control) stays open. */
.sound-locked .task-list--sound,
.sound-locked [data-sound-task] { display: none; }
.sound-device-check,
.sound-task { margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.sound-task-hint { color: var(--muted, #5c6560); margin: 0; }
.sound-task-wait { margin: 0; font-style: italic; color: var(--muted, #5c6560); }
/* The picture of a speaking task by a picture: the full width of the card, large enough to read on a phone. */
.sound-picture { display: block; width: 100%; height: auto; border-radius: 14px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--gals-surface-muted, #eef2ef); }
.sound-picture[hidden] { display: none; }

/* Device check (templates/includes/sound_device_check.html, 2026-10-25): a card per step —
   round icon, title, «Step N of 2», the common buttons and a segmented level meter.
   Colours come from the cabinet's tokens, falling back to the child's (kid.css), then to literals. */
.sound-device-check {
  --sc-ink: var(--gals-ink-primary, var(--kid-ink, #14201b));
  --sc-muted: var(--gals-ink-secondary, var(--kid-muted, #5c6b64));
  --sc-accent: var(--landing-accent, var(--kid-accent, #0d9488));
  --sc-accent-ink: var(--landing-accent-ink, var(--kid-accent-ink, #0f766e));
  --sc-accent-soft: var(--landing-accent-soft, var(--kid-accent-soft, #e6f5f3));
  gap: 0;
  padding: 24px;
  border: 1px solid var(--landing-border, rgba(20, 32, 27, 0.08));
  border-radius: var(--gals-radius-card, 14px);
  background: var(--landing-surface, #fff);
  box-shadow: var(--landing-shadow, 0 1px 2px rgba(20, 32, 27, 0.04), 0 12px 32px -12px rgba(20, 32, 27, 0.14));
  color: var(--sc-ink);
}
.sound-check-step { display: flex; flex-direction: column; gap: 16px; }
.sound-check-head { display: flex; align-items: center; gap: 14px; }
.sound-check-icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--sc-accent-soft); color: var(--sc-accent-ink);
  transition: background-color 0.25s ease, color 0.25s ease;
}
/* A soft ring that breathes while the beep plays and follows the voice on the microphone step. */
.sound-check-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.18);
  transition: box-shadow 0.12s ease-out;
}
.sound-device-check.is-playing [data-step="sound"] .sound-check-icon::after { animation: sound-check-ring 0.7s ease-out; }
.sound-check-icon--mic::after { box-shadow: 0 0 0 calc(var(--sound-level, 0) * 12px) rgba(13, 148, 136, 0.16); }
.sound-device-check.is-heard .sound-check-icon--mic { background: var(--sc-accent-ink); color: #fff; }
@keyframes sound-check-ring {
  from { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.28); }
  to { box-shadow: 0 0 0 14px rgba(13, 148, 136, 0); }
}
.sound-check-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sound-check-title {
  margin: 0;
  font-family: var(--gals-font-body, inherit);
  font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--sc-ink);
}
.sound-check-count {
  margin: 0;
  font-size: 13px; line-height: 1.3; font-variant-numeric: tabular-nums;
  color: var(--sc-muted);
}
.sound-check-text { margin: 0; max-width: 60ch; line-height: 1.6; color: var(--sc-muted); }
.sound-check-answer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--landing-border, rgba(20, 32, 27, 0.08));
}
.sound-check-ask { margin: 0; font-weight: 600; color: var(--sc-ink); }
.sound-device-fail {
  margin: 16px 0 0; padding: 12px 14px;
  border-radius: var(--gals-radius-control, 8px);
  background: var(--gals-color-error-bg, #fee2e2); color: var(--gals-color-error-text, #991b1b);
  line-height: 1.5;
}
/* Segmented meter: 32 narrow pills filled by sound_task.js, teal like the rest of the progress. */
.sound-level { display: flex; gap: 4px; width: 100%; max-width: 380px; height: 28px; align-items: center; }
.sound-level span {
  flex: 1 1 0; min-width: 3px; height: 100%; border-radius: 999px;
  background: rgba(20, 32, 27, 0.08);
  transition: background-color 0.08s linear;
}
.sound-level span.is-on { background: var(--sc-accent); }
@media (max-width: 480px) {
  .sound-device-check { padding: 20px 16px; }
  .sound-level { gap: 3px; height: 24px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sound-check-icon, .sound-check-icon::after, .sound-level span { transition: none; }
  .sound-device-check.is-playing [data-step="sound"] .sound-check-icon::after { animation: none; }
}
.sound-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.sound-play-btn { display: inline-flex; align-items: center; gap: 8px; }
/* The play circle sits close to the edge, so the left padding is smaller. */
.btn-secondary.sound-play-btn { padding-left: 9px; }
.sound-play-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(13, 148, 136, 0.12); color: #0f766e;
}
.sound-play-icon svg { margin-left: 1px; }
.btn-primary .sound-play-icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
/* From the moment the one listen starts, the circle is not a play mark. */
.sound-play-btn:disabled .sound-play-icon,
.btn-primary.sound-play-btn:disabled .sound-play-icon {
  background: rgba(20, 32, 27, 0.08);
  color: currentColor;
}
/* Switched off at the start of the listen: an outline, not a button that invites another press.
   :hover is listed so a disabled primary/secondary fill does not come back under the pointer. */
button.sound-play-btn.is-spent,
button.sound-play-btn.is-spent:hover,
button.sound-play-btn.is-spent:disabled,
button.sound-play-btn.is-spent:disabled:hover {
  opacity: 1;
  background: transparent;
  color: var(--gals-btn-muted);
  box-shadow: inset 0 0 0 1px var(--gals-btn-line);
  cursor: not-allowed;
  pointer-events: auto;
}
.sound-show-text { display: inline-flex; align-items: center; gap: 6px; padding: 0.5rem 0.25rem; }
.sound-show-text:hover { color: var(--gals-ink-primary, var(--gals-color-text)); }
.sound-questions { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.sound-question { position: relative; }
.sound-question-text { margin: 0 0 0.35rem; }
.sound-gap { width: 100%; max-width: 20rem; }
.sound-option { display: block; padding: 0.15rem 0; }
.sound-mark { margin-left: 0.25rem; font-weight: 700; }
.sound-question.is-right .sound-mark { color: var(--gals-color-success-text); }
.sound-question.is-wrong .sound-mark { color: var(--gals-color-error-text); }
.sound-script {
  padding: 0.75rem 1rem;
  border: 1px solid var(--gals-color-border-subtle);
  border-radius: var(--gals-radius-sm);
  background: var(--gals-color-bg);
}
.sound-script summary { cursor: pointer; font-weight: 600; color: var(--gals-color-text-strong); }
.sound-script p { margin: 0.5rem 0 0; line-height: 1.65; }
.sound-script mark {
  padding: 0 0.2em;
  border-radius: 4px;
  background: var(--gals-color-success-bg);
  color: var(--gals-color-success-text);
  font-weight: 600;
}
.sound-spoken-review { display: grid; gap: 0.75rem; }
.sound-timer { text-align: center; }
.sound-timer-label { margin: 0; color: var(--muted, #5c6560); }
.sound-timer-value { margin: 0.2rem 0 0.5rem; font-size: 2rem; font-weight: 700; }
/* A live dialogue: the partner is writing his line */
.sound-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  vertical-align: -0.15em;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: task-photo-spin 0.7s linear infinite;
}
.sound-spinner[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .sound-spinner { animation-duration: 2.4s; } }
.sound-tempo { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.sound-tempo-seconds { width: 5rem; margin-left: 0.4rem; }
.sound-own-answer { display: block; margin-top: 0.5rem; }
.sound-parent-audio,
.sound-task-player,
.sound-own-answer,
.sound-recording audio { width: 100%; max-width: 28rem; }
.sound-parent-meta { margin: 0; color: var(--muted, #5c6560); font-size: 0.9rem; }
/* A dialogue: the partner's line, the learner's answer under it */
.sound-dialogue-lines { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.75rem; }
.sound-dialogue-lines p,
.sound-dialogue-answer p { margin: 0.25rem 0; }
.sound-dialogue-answer { margin-top: 0.75rem; }
.sound-dialogue-progress { margin: 0 0 0.5rem; font-size: 0.9375rem; font-weight: 600; }
/* display:flex above would otherwise show elements the script keeps hidden */
.sound-device-check[hidden],
.sound-device-check [hidden],
.sound-task [hidden] { display: none !important; }

/* ── Homework tab and task screen (docs/dev/homework-tab-redesign.md, 2026-10-30) ──
   The tab holds short rows that lead to the task screen; the review is a document of its own. */

/* «+ Add» and the two pickers (people, subjects) on one line over the list (2026-11-07).
   On a phone: «+ Add» full width, the pickers side by side under it. */
.hw-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.hw-bar__add {
  flex: 1 1 auto;
  min-width: 0;
}

/* The compact card of a used-up month is a row of its own; the pickers sit under it. */
.hw-bar > .quota-card {
  flex: 1 1 100%;
  min-width: 0;
}

.hw-bar--quota > .hw-picks {
  margin-left: auto;
}

.hw-picks {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.hw-pick {
  position: relative;
  display: block;
  min-width: 0;
}

.hw-pick select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 2.25rem 0 1rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--gals-btn-line);
  color: var(--gals-btn-ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-overflow: ellipsis;
  cursor: pointer;
}

.hw-pick::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--gals-color-text-muted);
  border-bottom: 2px solid var(--gals-color-text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.hw-pick.is-set select {
  background: #e6f4f1;
  box-shadow: inset 0 0 0 1.5px #0f766e;
  color: #0f766e;
  font-weight: 600;
}

.hw-pick.is-set::after {
  border-color: #0f766e;
}

.hw-pick select:focus-visible {
  outline: 2px solid var(--gals-color-accent);
  outline-offset: 2px;
}

/* «Show» is for a page without the script; dash_tabs.js adds .is-live and the select submits itself. */
.hw-picks.is-live .hw-picks__submit {
  display: none;
}

@media (max-width: 600px) {
  .hw-bar__add,
  .hw-picks {
    flex: 1 1 100%;
  }

  .hw-pick {
    flex: 1 1 0;
  }

  .hw-picks__submit {
    flex: none;
  }
}

/* The list: one surface, hairlines between rows, no shadow of its own. */
.hw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--landing-border, var(--gals-color-border-subtle));
  border-radius: var(--landing-radius, 14px);
  background: var(--landing-surface, #fff);
}

.hw-list .hw-day {
  margin: 0;
  padding: 0.75rem 1rem 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.hw-list .hw-day:not(:first-child) {
  border-top: 1px solid var(--landing-border, var(--gals-color-border-subtle));
}

.hw-row + .hw-row {
  border-top: 1px solid var(--landing-border, var(--gals-color-border-subtle));
}

.hw-list .hw-day + .hw-row {
  border-top: 0;
}

.hw-row__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
  min-height: 56px;
  padding: 0.65rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.hw-row__link:hover {
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 45%, #fff);
  text-decoration: none;
}

.hw-row__link:focus-visible {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: -2px;
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 45%, #fff);
}

.hw-row__main {
  flex: 1 1 auto;
  min-width: 0;
}

.hw-row__title,
.hw-row__meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hw-row__title {
  font-weight: 600;
  line-height: 1.4;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.hw-row__meta {
  margin-top: 0.1rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--gals-color-text-muted);
}

.hw-row__meta > span + span::before {
  content: "·";
  margin: 0 0.4em;
}

.hw-row__badge {
  flex: none;
}

.hw-row__arrow {
  flex: none;
  color: var(--gals-color-text-subtle);
}

.hw-row__link:hover .hw-row__arrow {
  color: var(--landing-ink, var(--gals-color-text-strong));
}

/* ── The task screen ── */
.hw-task {
  min-width: 0;
  padding-bottom: 1.5rem;
}

.hw-task .hw-task__title {
  margin: 0.25rem 0 0.5rem;
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hw-task__root {
  min-width: 0;
}

/* A homework sent without a solution: the quiet way out to practice tasks, under the photo button. */
.hw-task__train {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 60%, #fff);
}

.hw-task__train p {
  flex: 1 1 12rem;
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.45;
}

.hw-task__train button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--landing-accent, var(--gals-color-accent));
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.hw-task__train button:hover,
.hw-task__train button:focus-visible {
  text-decoration: underline;
}

.hw-task__remove {
  margin: 2rem 0 0;
  text-align: center;
}

.hw-task__remove a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.5rem;
  color: #b42318;
  font-weight: 600;
  text-decoration: none;
}

.hw-task__remove a:hover {
  text-decoration: underline;
}

.hw-task__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--gals-color-text-muted);
}

.hw-task__person {
  font-weight: 600;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.hw-task__date {
  font-variant-numeric: lining-nums tabular-nums;
}

.hw-checks__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.hw-checks__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--landing-border-strong, var(--gals-color-border));
  border-radius: 999px;
  color: var(--landing-ink, var(--gals-color-text-strong));
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.hw-checks__link:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 55%, #fff);
}

.hw-checks__link.is-active {
  border-color: var(--gals-ink-primary, #14201b);
  background: var(--gals-ink-primary, #14201b);
  color: #fff;
}

.hw-checks__link:focus-visible {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
  outline-offset: 2px;
}

/* The photos: condition and the shown check in one strip. */
.hw-task .task-check-photos {
  margin: 0 0 1rem;
}

/* The shared report is drawn for a card inside a list and indents by a level; here it is the page. */
.hw-task :is(.task-body, .task-check, .task-check-form, .task-check-history, .task-check-reshoot-hint, .task-report-panel, .task-report-panel--recheck, .task-review-in-progress, .task-recognized-answer, .task-review-result > .task-recognized-answer, [data-check-result] + .task-recognized-answer) {
  margin-left: 0;
}

.hw-task .task-check {
  margin-top: 0;
  padding: 1rem 1.1rem;
  background: var(--landing-surface, #fff);
}

.hw-task .task-check-analysis {
  font-size: 1rem;
  line-height: 1.6;
}

/* Homework task screen, the check card: two sections (the work, the review), each with its own rating under it
   (operator, 2026-11-07, variant A, docs/dev/mockups/homework-check-report.html). */
.hw-task .task-check.task-check--hw {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hw-work,
.hw-review {
  margin: 0 0 1.5rem;
  min-width: 0;
}

.hw-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 0.75rem;
  margin: 0 0 0.6rem;
}

.hw-sec-title {
  margin: 0;
  font-family: var(--gals-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--landing-ink, #14201b);
}

.hw-sec-note {
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
}

.hw-work__body {
  min-width: 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--landing-border, #e4eae7);
  border-radius: 14px;
  background: #fff;
  font-size: 1.05rem;
}

.hw-work__body .task-answer-marks {
  line-height: 2;
  font-variant-numeric: tabular-nums;
}

.task-check--hw .task-flag {
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.task-flag-label {
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
}

.hw-task .task-check--hw .task-check-analysis {
  font-size: var(--gals-text-reading, 1.0625rem);
  line-height: 1.6;
}

.task-check--hw .task-check-analysis > :first-child {
  margin-top: 0;
}

/* The first list of the review is the remarks the marks point to: the same red circles instead of plain numbers. */
.task-check-analysis--marked > ol:first-of-type {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
  counter-reset: hw-point;
}

.task-check-analysis--marked > ol:first-of-type > li {
  position: relative;
  margin-left: 0;
  padding-left: 1.9rem;
  counter-increment: hw-point;
}

.task-check-analysis--marked > ol:first-of-type > li::before {
  content: counter(hw-point);
  position: absolute;
  left: 0;
  top: 0.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #b91c1c;
  color: #fff;
  font-family: var(--gals-font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.hw-check-foot {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--landing-border, #e4eae7);
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}

/* The re-shoot panel. With errors found it waits as a sheet that «Fixed it? Check again» opens;
   without the script (or with a clean verdict) it is a calm block at the bottom of the page. */
.hw-recheck {
  margin: 1.25rem 0 0;
}

.hw-recheck__head {
  display: none;
}

html.hw-js .hw-recheck[data-hw-sheet]:not(.is-sheet) {
  display: none;
}

.hw-recheck.is-sheet {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  width: min(100%, 34rem);
  max-height: min(88vh, 42rem);
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 1.1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: var(--landing-surface, #fff);
  box-shadow: 0 -14px 40px -10px rgba(20, 32, 27, 0.4);
  animation: hw-sheet-up 0.28s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.hw-recheck.is-sheet .hw-recheck__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.75rem;
  background: var(--landing-surface, #fff);
}

.hw-recheck__title {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
}

.hw-recheck__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -0.6rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--gals-color-text-muted);
  cursor: pointer;
}

.hw-recheck__close:hover {
  background: var(--gals-color-secondary-bg);
}

.hw-recheck__close:focus-visible {
  outline: 2px solid var(--landing-accent, var(--gals-color-accent));
}

.hw-recheck.is-sheet .task-report-panel,
.hw-recheck.is-sheet .task-report-panel--after-check {
  margin: 0;
}

.hw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(20, 32, 27, 0.5);
}

html.hw-sheet-open {
  overflow: hidden;
}

html.hw-sheet-open .hw-pin {
  display: none;
}

@keyframes hw-sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* «Fixed it? Check again»: always in sight while the review is being read, and at rest under
   it once the end is reached — it never covers the last lines. */
.hw-pin {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin-top: 1rem;
  padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--landing-ground, #fbfcfc) 72%, rgba(251, 252, 252, 0));
}

html:not(.hw-js) .hw-pin {
  display: none;
}

.hw-pin__note {
  margin: 0.4rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}

/* .btn-wide, but not wider than a reading column on a desktop. */
@media (min-width: 720px) {
  .hw-pin__btn {
    max-width: 26rem;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hw-recheck.is-sheet {
    animation: none;
  }

  .hw-row__link {
    transition: none;
  }
}
