*,
*::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;

  /* 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;
}

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-block;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--gals-radius-sm);
  /* <button> would otherwise fall back to the UA font while <a class="btn"> inherits ours. */
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

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

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

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

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

.btn-primary:disabled:hover,
.btn-primary.is-disabled:hover {
  background: var(--gals-color-primary);
}

.btn-secondary:disabled:hover,
.btn-secondary.is-disabled:hover {
  background: var(--gals-color-secondary-bg);
}

.btn-go {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--gals-color-accent), var(--gals-color-accent-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-go:hover {
  background: linear-gradient(135deg, var(--gals-color-accent-dark), var(--gals-color-accent-hover));
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: var(--gals-color-secondary-bg);
  color: var(--gals-color-secondary-text);
}

.btn-secondary:hover {
  background: var(--gals-color-secondary-hover);
  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;
}

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

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

.btn-link {
  background: none;
  color: var(--gals-color-text-muted);
  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;
  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;
}

.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;
}

/* Header navigation inside the language menu — phone only (see @media below); on desktop the
   same links sit in the header row. */
.lang-picker__nav,
.lang-picker__burger,
.lang-picker__name-menu {
  display: none;
}

.lang-picker__nav {
  flex-direction: column;
  gap: 0.125rem;
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--gals-color-border);
}

.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;
}

/* ☰ drawn with borders: three 2px bars, 14px wide. */
.lang-picker__burger {
  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;
}

@media (max-width: 860px) {
  .lang-picker__nav {
    display: flex;
  }

  /* No header links to show at this moment: no empty block and divider above the languages. */
  .lang-picker__nav:not(:has(a)) {
    display: none;
  }

  .lang-picker__burger {
    display: block;
  }

  .lang-picker__details:has(.lang-picker__burger) .lang-picker__chevron,
  .lang-picker__name-lang {
    display: none;
  }

  .lang-picker__name-menu {
    display: inline;
  }

  .lang-picker__details:has(.lang-picker__nav) .lang-picker__menu {
    min-width: 13rem;
    width: max-content;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
}

.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;
}

.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 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;
  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 {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  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: three equal columns, the mark above a
     two-line name. Every name is two words, so each breaks the same way. */
  .dash-head {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .dash-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    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;
  }
}

@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-focus {
  margin: 0;
  font-size: 0.88rem;
  color: var(--landing-muted, var(--gals-color-text-muted));
  line-height: 1.35;
}

.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-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-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
  background: var(--landing-accent-soft, var(--gals-color-accent-soft));
}

.dash-btn:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 60%, var(--landing-accent, #0d9488) 14%);
}

.dash-btn--primary {
  color: #fff;
  background: var(--landing-accent-ink, var(--gals-color-accent-dark));
}

.dash-btn--primary:hover {
  background: var(--landing-accent, var(--gals-color-accent));
}

.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;
}

.home-links .btn {
  text-align: center;
}

/* ── 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 language menu is the last thing in the row (includes/site_nav_end.html) and keeps its
   size: whatever changes width — links, account — gives way to the left of it, so the menu does
   not jump from page to page. */
.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 {
  font-size: 13px;
  font-weight: 550;
  color: var(--landing-faint);
  text-decoration: none;
}

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

.landing-staff-count {
  color: var(--landing-ink);
  font-weight: 650;
}

/* 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;
}

.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;
}

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

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

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

.auth-overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(1.5px);
  cursor: pointer;
}

.auth-overlay__stage {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: 100%;
  overflow: auto;
}

.auth-overlay__panel {
  position: relative;
  padding-top: 44px;
}

.auth-overlay__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-overlay__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.auth-overlay .auth-card {
  margin: 0;
  box-shadow: 0 24px 48px -20px rgba(20, 32, 27, 0.35);
}

.auth-overlay .auth-alt-role {
  margin-top: 16px;
}

.auth-overlay .auth-alt-role a {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.auth-overlay .auth-alt-role a:hover {
  color: #fff;
}

/* Адрес поддержки под карточкой входа: форма обращений только для авторизованных,
   поэтому тем, кто войти не может, нужна видимая дверь. Оформлен как соседний
   alt-role: тот же размер и та же читаемость поверх скрима. */
.auth-support-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--landing-muted);
}

.auth-support-note a {
  color: inherit;
  font-weight: 560;
}

.auth-overlay .auth-support-note {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
}

.auth-overlay .auth-support-note a {
  color: #fff;
}

.auth-card-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--landing-border);
}

.auth-card-links__back {
  color: var(--landing-muted);
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
}

.auth-card-links__back:hover {
  color: var(--landing-accent-ink);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 64px;
}

.auth-main-inner {
  width: 100%;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: 22px;
  box-shadow: 0 18px 40px -24px rgba(20, 32, 27, 0.25);
  padding: 38px 36px 34px;
}

/* Карточка ученика белая, как вход родителя. На публичной странице кнопка та же бирюзовая пилюля (public.css): роль уже названа заголовком. Янтарная остаётся, только если public.css не подключён. */
.auth-card--student .auth-submit {
  color: #2a2114;
  background: #e8a317;
}

.auth-card--student .auth-submit:hover,
.auth-card--student .auth-submit:disabled:hover {
  background: #c4840a;
  color: #2a2114;
}

.auth-card--student .auth-submit:focus-visible {
  outline-color: #e8a317;
}
.auth-card .landing-eyebrow {
  margin-bottom: 16px;
}

.auth-card h1 {
  font-size: clamp(2rem, 5vw, 2.375rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  color: var(--landing-muted);
  font-size: 14.5px;
  line-height: 1.4;
}

.auth-switch a {
  color: var(--landing-accent-ink);
  font-weight: 650;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-legal {
  margin: 12px 0 0;
  text-align: center;
  color: var(--gals-color-text-subtle, #8a9691);
  font-size: 12.5px;
  line-height: 1.45;
}

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

.auth-legal a:hover {
  color: var(--landing-accent-ink);
}

.auth-lead {
  color: var(--landing-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 26px;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  font-size: 13.5px;
  margin-bottom: 7px;
}

body.auth-page .auth-card .input,
.auth-overlay .auth-card .input {
  font-size: 15px;
  border-width: 1.5px;
  border-color: #cbd5e1;
  border-radius: 11px;
  padding: 13px 14px;
}

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

body.auth-page .auth-card .input::placeholder,
.auth-overlay .auth-card .input::placeholder {
  color: #9aa8a2;
}

body.auth-page .auth-card .password-field .input,
.auth-overlay .auth-card .password-field .input {
  padding-right: 3rem;
}

.auth-forgot-row {
  margin: -6px 0 22px;
}

.auth-forgot {
  color: var(--landing-accent);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.auth-forgot:hover {
  color: var(--landing-accent-ink);
  text-decoration: underline;
}

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

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

body.auth-page .auth-card .auth-field.has-error .input,
.auth-overlay .auth-card .auth-field.has-error .input {
  border-color: #c47878;
  background: #fffdfb;
}

body.auth-page .auth-card .auth-field.has-error .input:focus,
.auth-overlay .auth-card .auth-field.has-error .input:focus {
  border-color: #a34b4b;
  box-shadow: 0 0 0 3px rgba(163, 75, 75, 0.12);
}

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

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

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

.auth-messages li:last-child {
  margin-bottom: 0;
}

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

.auth-submit {
  width: 100%;
  font-family: inherit;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: var(--landing-accent);
  border: 0;
  border-radius: 12px;
  padding: 15px 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.auth-submit:hover {
  background: var(--landing-accent-ink);
}

.auth-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.auth-submit:disabled:hover {
  background: var(--landing-accent);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-submit:disabled:active {
  transform: none;
}

.auth-submit:focus-visible {
  outline: 2px solid var(--landing-accent);
  outline-offset: 2px;
}

.auth-submit--link {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.auth-step-title {
  font-family: var(--gals-font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 10px;
}

.auth-step-lead {
  color: var(--landing-muted);
  font-size: 14.5px;
  line-height: 1.45;
  margin: 0 0 24px;
  word-break: break-word;
}

.auth-step-secondary {
  appearance: none;
  width: 100%;
  margin-top: 10px;
  border: none;
  background: transparent;
  color: var(--landing-muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 560;
  cursor: pointer;
  padding: 12px;
}

.auth-step-secondary:hover {
  color: var(--landing-accent-ink);
}

.auth-help {
  color: var(--gals-color-text-subtle, #8a9691);
  font-size: 12px;
  line-height: 1.4;
  margin: 6px 2px 0;
}

.auth-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--landing-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 18px 2px 0;
}

.auth-hint svg {
  flex: none;
  margin-top: 1px;
  color: var(--landing-faint);
}

.auth-alt-role {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
}

.auth-alt-role a {
  color: var(--landing-muted);
  font-weight: 560;
  text-decoration: none;
}

.auth-alt-role a:hover {
  color: var(--landing-accent-ink);
}

@media (max-width: 520px) {
  .auth-card {
    padding: 30px 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;
}

/* 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, 420px) 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;
  /* the legend's colour, so an untouched light does not melt into the branches */
  --kt-untouched: #cbd5e1;
}

.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__note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(238, 251, 247, 0.16);
  font-size: 15px;
  line-height: 1.45;
  color: rgba(238, 251, 247, 0.9);
}

.set-moment-next {
  margin: 0 0 18px;
}

/* «Прогресс»: 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-untouched: #cbd5e1;
  min-width: 0;
}

/* 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;
  }

  /* Too small to read at phone width — the list below is grouped by the same sections. */
  .map-hero .kt-label {
    display: none;
  }
}

@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;
}

/* «Log out» inside the phone menu is a button of the language form: it must look like the
   links around it. */
.lang-picker__link--button {
  width: 100%;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

@media (max-width: 860px) {
  /* Phone: the account links leave the row for the menu next to the language; the plan badge
     stays. 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,
  body.app-page .app-site .landing-nav-end > .app-toolbar-form {
    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__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,
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 .btn {
  border-radius: var(--gals-radius-control);
}

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-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,
body.app-course .topic-theory-picker__option {
  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 .topic-theory-result,
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 .topic-theory,
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;
}

body.app-course .topic-theory-picker__label,
body.app-course .topic-theory-result__title {
  font-size: var(--gals-text-body);
  font-weight: var(--gals-weight-semibold);
}

body.app-course .topic-theory-picker__label {
  color: var(--gals-ink-secondary);
}

body.app-course .topic-theory-picker__label:hover,
body.app-course .topic-theory-result__title:hover {
  color: var(--gals-ink-primary);
}

body.app-course .topic-theory-picker__hint,
body.app-course .topic-theory-picker__subject,
body.app-course .topic-theory-wait__hint {
  font-size: var(--gals-text-caption);
  color: var(--gals-ink-secondary);
}

body.app-course .topic-theory-picker__title,
body.app-course .topic-theory-result__body,
body.app-course .topic-theory-wait__label {
  font-size: var(--gals-text-body);
}

body.app-course .topic-theory-result__body {
  line-height: 1.6;
}

/* Disclosures inside an opened card: the chevron, not the ▸ */
body.app-course .topic-theory-picker__label::before,
body.app-course .topic-theory-result__title::before {
  content: none;
}

body.app-course .topic-theory-picker__label::after,
body.app-course .topic-theory-result__title::after {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 7px;
  height: 7px;
  margin: 0 2px 3px 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-theory-result__title::after {
  margin-left: auto;
}

body.app-course .topic-theory-picker[open] > .topic-theory-picker__label::after,
body.app-course .topic-theory-result[open] > .topic-theory-result__title::after {
  margin-bottom: 0;
  margin-top: 3px;
  transform: rotate(225deg);
}

/* 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 .task-report-attach-note,
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);
}

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

/* 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;
  border-radius: 999px;
  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;
  }

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

@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;
}

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-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 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.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-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.75rem;
}

/* «Показать ещё» под списком. */
.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 limit is used up (includes/check_quota_banner.html): one loud block at the top of
   the tasks screen — the fact, what still works, and the button to the plans. */
.quota-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--gals-color-accent-warm, #f59e0b) 45%, var(--landing-border, #e4eae7));
  border-left: 4px solid var(--gals-color-accent-warm, #f59e0b);
  border-radius: 14px;
  background: color-mix(in srgb, var(--gals-color-accent-warm, #f59e0b) 9%, #fff);
}

.quota-banner-text {
  flex: 1 1 18rem;
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.quota-banner-action {
  flex: none;
}

/* The wall of unclosed sets lists every one of them: five rows need no scroll box. */
.assignment-nav-list.assignment-nav-list--all {
  max-height: none;
  overflow: visible;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 560px) {
  /* A subject and "whose · what · when" do not fit one line on a phone: the second goes under. */
  .assignment-nav-list--all .assignment-nav-link {
    grid-template-columns: minmax(0, 1fr);
  }

  .assignment-nav-list--all .assignment-nav-meta {
    text-align: left;
  }
}

.unclosed-upgrade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gals-color-border-subtle);
}

.unclosed-upgrade .strategy-hint {
  margin: 0;
}

/* «Кнопки главной»: the row that sums one position of the switch. */
.staff-metrics-table tr.funnel-group-row th[scope="row"],
.staff-metrics-table tr.funnel-group-row td {
  font-weight: 650;
}

.funnel-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.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-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.funnel-kpi {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gals-color-border-subtle, #e2e8f0);
  border-radius: var(--gals-radius-md, 12px);
}

.funnel-kpi-value {
  font-family: var(--gals-font-display, Georgia, serif);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gals-color-text-strong, #1e293b);
  font-variant-numeric: tabular-nums;
}

.funnel-kpi-label {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--gals-color-text, #1a1a1a);
}

.funnel-kpi-sub {
  font-size: 0.78rem;
  color: var(--gals-color-text-muted, #64748b);
}

.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);
}

.funnel-flag {
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--gals-color-status-untouched-bg, #f1f5f9);
  color: var(--gals-color-status-untouched, #475569);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.funnel-bar {
  display: inline-block;
  width: 5rem;
  height: 0.45rem;
  margin-right: 0.5rem;
  vertical-align: middle;
  border-radius: 999px;
  background: var(--gals-color-secondary-bg, #e2e8f0);
  overflow: hidden;
}

.funnel-bar > span {
  display: block;
  height: 100%;
  background: var(--gals-color-accent, #14b8a6);
}

.funnel-steps tr.funnel-nested th[scope="row"] {
  padding-left: 1.75rem;
}

@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;
  }

  .funnel-bar {
    display: none;
  }
}

.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-compose .task-report-input {
  padding-right: 3.4rem;
}

.task-report-attach-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.task-report-attach-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted, #5c6560);
  cursor: pointer;
}

.task-report-attach-btn:hover:not(:disabled) {
  color: var(--text, #1c241f);
  background: rgba(0, 0, 0, 0.04);
}

.task-report-attach-btn:disabled {
  opacity: 0.5;
  cursor: progress;
}

.task-report-attach-note {
  margin: 0 0 0.5rem;
  color: var(--muted, #5c6560);
  font-size: 0.8rem;
}

.task-report-attach-note--error {
  color: #b3261e;
}

.task-report-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.task-report-attach-list li {
  position: relative;
}

.task-report-attach-list img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.4rem;
}

.task-report-attach-remove {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1c241f;
  color: #fff;
  font-size: 1rem;
  line-height: 1.5rem;
  cursor: pointer;
}

/* Зона нажатия крестика — 44px, хотя рисуется он меньше. */
.task-report-attach-remove::after {
  content: "";
  position: absolute;
  inset: -0.65rem;
}

.task-report-answer-label {
  font-size: 0.95rem;
}

.task-report-input {
  padding-right: 2.6rem;
}

.task-report-attach-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.task-report-attach-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.4rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted, #5c6560);
  cursor: pointer;
}

.task-report-attach-btn:hover {
  color: var(--text, #1c241f);
  background: rgba(0, 0, 0, 0.04);
}

.task-report-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  padding: 0;
  list-style: none;
}

.task-report-attach-list li {
  position: relative;
}

.task-report-attach-list img {
  display: block;
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 0.35rem;
}

.task-report-attach-remove {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1c241f;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.1rem;
  cursor: pointer;
}

.task-report-input {
  margin-bottom: 0.65rem;
  min-height: 5.5rem;
  max-height: 16rem;
  overflow: auto;
  font-size: 0.9rem;
  resize: vertical;
}

.task-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.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 ──
   Two treatments, deliberately unlike each other: the status panel is tinted and
   rail-marked by state, the plan chooser is a plain white card. One type scale. */

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: 1.5rem;
  --sub-fs-xl: 1.75rem;
  --sub-state: var(--landing-border-strong, var(--gals-color-border));
  --sub-state-soft: color-mix(in srgb, var(--landing-border, #e4eae7) 30%, #fff);
  --sub-state-ink: var(--landing-ink, var(--gals-color-text-strong));
}

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-status {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.35rem 1rem;
  overflow: hidden;
  margin: 0 0 1rem;
  padding: 1.35rem 1.5rem 1.5rem 1.65rem;
  border: 1px solid color-mix(in srgb, var(--sub-state) 40%, var(--landing-border, #e4eae7));
  border-radius: var(--landing-radius, var(--gals-radius-md));
  background: var(--sub-state-soft);
}

.sub-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--sub-state);
}

.sub-status--active,
.sub-status--managed {
  --sub-state: var(--landing-accent, var(--gals-color-accent));
  --sub-state-soft: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 45%, #fff);
  --sub-state-ink: var(--landing-accent-ink, var(--gals-color-accent-dark));
}

.sub-status--pending_payment,
.sub-status--cancelling {
  --sub-state: var(--gals-color-status-in-progress);
  --sub-state-soft: color-mix(in srgb, var(--gals-color-status-in-progress-bg) 55%, #fff);
  --sub-state-ink: var(--gals-color-status-in-progress);
}

.sub-status-main {
  min-width: 0;
}

.sub-status-eyebrow {
  margin: 0 0 0.35rem;
  font-size: var(--sub-fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.sub-status-plan {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.1rem 0.75rem;
  margin: 0;
  font-family: var(--gals-font-display);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.sub-status-plan-name {
  font-size: var(--sub-fs-xl);
  font-weight: 600;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.sub-status-line {
  margin: 0.6rem 0 0;
  max-width: 46ch;
  font-size: var(--sub-fs-sm);
  line-height: 1.45;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.sub-status--pending_payment .sub-status-line,
.sub-status--cancelling .sub-status-line {
  font-weight: 500;
  color: var(--sub-state-ink);
}

.sub-status-foot {
  margin: 0.4rem 0 0;
  max-width: 52ch;
  font-size: var(--sub-fs-xs);
  line-height: 1.4;
  color: var(--landing-faint, var(--gals-color-text-subtle));
}

.sub-status-badge {
  align-self: start;
  justify-self: end;
  padding: 0.25rem 0.7rem;
  /* The border carries the pill on the free state, where the tint is near-white. */
  border: 1px solid color-mix(in srgb, var(--sub-state) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--sub-state) 16%, #fff);
  color: var(--sub-state-ink);
  font-size: var(--sub-fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sub-meters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 2rem;
}

.sub-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.4rem;
}

.sub-meter-label {
  font-size: var(--sub-fs-xs);
  font-weight: 600;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.sub-meter-value {
  font-size: var(--sub-fs-sm);
  color: var(--landing-muted, var(--gals-color-text-muted));
  font-variant-numeric: lining-nums tabular-nums;
}

.sub-meter-value b {
  font-size: var(--sub-fs-lg);
  font-weight: 600;
  font-family: var(--gals-font-display);
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.sub-meter-rail {
  height: 0.4rem;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--sub-state) 18%, #fff);
}

.sub-meter-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--sub-state);
  transition: width 0.35s ease;
}

.sub-meter--exhausted .sub-meter-bar {
  background: var(--gals-color-status-in-progress);
}

.sub-meter--exhausted .sub-meter-value,
.sub-meter--exhausted .sub-meter-foot {
  color: var(--gals-color-status-in-progress);
}

.sub-meter-foot {
  margin: 0.35rem 0 0;
  font-size: var(--sub-fs-xs);
  color: var(--landing-faint, var(--gals-color-text-subtle));
}

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

.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;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--landing-border, var(--gals-color-border));
  border-radius: 999px;
  background: var(--landing-ground, var(--gals-color-bg));
}

.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: var(--landing-accent, var(--gals-color-accent));
  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(auto-fit, minmax(13rem, 1fr));
  align-items: stretch;
  gap: 0.75rem;
  margin: 0;
  border: none;
  padding: 0;
  min-width: 0;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  border: 1.5px solid var(--landing-border, var(--gals-color-border));
  border-radius: var(--landing-radius, var(--gals-radius-md));
  background: var(--gals-color-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* Selectable plans only — the Free card is a destination, not a radio. */
label.plan-card {
  cursor: pointer;
}

label.plan-card:hover {
  border-color: color-mix(in srgb, var(--landing-accent, #0d9488) 45%, var(--landing-border, #e4eae7));
}

.plan-card:has(input:checked) {
  border-color: var(--landing-accent, var(--gals-color-accent));
  background: color-mix(in srgb, var(--landing-accent-soft, #e6f5f3) 45%, #fff);
}

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

.plan-card:has(input:disabled) {
  cursor: default;
}

label.plan-card:has(input:disabled):hover {
  border-color: var(--landing-border, var(--gals-color-border));
}

.plan-card--free {
  background: color-mix(in srgb, var(--landing-ground, #fbfcfc) 70%, #fff);
}

.plan-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.plan-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* The plan's tag (Неспешно / Спокойно / Усердно): the loud line of the card. */
.plan-card-tag {
  font-size: var(--sub-fs-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
}

/* The plan's permanent name (Бесплатно / Тариф S / Тариф M): the quiet last line. */
.plan-card-name {
  font-size: var(--sub-fs-xs);
  font-weight: 500;
  color: var(--landing-faint, var(--gals-color-text-subtle));
}

.plan-card-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--landing-accent-soft, #e6f5f3);
  color: var(--landing-accent-ink, var(--gals-color-accent-dark));
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.plan-card-price {
  font-family: var(--gals-font-display);
  font-size: var(--sub-fs-price);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--landing-ink, var(--gals-color-text-strong));
}

.plan-card-price--free {
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.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-period {
  font-family: var(--gals-font-sans);
  font-size: var(--sub-fs-sm);
  font-weight: 500;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.plan-card-facts {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.15rem;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--landing-border, #e4eae7) 75%, transparent);
}

.plan-card-fact {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: var(--sub-fs-xs);
  color: var(--landing-muted, var(--gals-color-text-muted));
}

.plan-card-fact-n {
  font-size: var(--sub-fs-sm);
  font-weight: 600;
  color: var(--landing-ink, var(--gals-color-text-strong));
  font-variant-numeric: lining-nums tabular-nums;
}

.plan-card-note {
  margin: 0;
  font-size: var(--sub-fs-xs);
  line-height: 1.35;
  color: var(--gals-color-status-in-progress);
}

.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: flex-start;
  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-go is full-bleed by default — sized for a narrow column, not this one. */
.sub-plans .form-actions {
  margin-top: 0;
}

.sub-plans .btn-go {
  width: auto;
  min-width: 15rem;
  font-size: var(--sub-fs-md);
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .sub-plans .btn-go {
    width: 100%;
  }
}

.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;
}

.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;
}

.onboarding-plan-skeleton__hint,
.onboarding-plan-skeleton .job-status-hint {
  color: #64748b;
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}

.onboarding-plan-skeleton .job-status-hint--secondary {
  margin-top: 0.35rem;
}

.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--full-height .onboarding-plan-skeleton {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 18rem);
}

.strategy-editor--full-height .onboarding-plan-skeleton__preview {
  flex: 1;
  min-height: 10rem;
}

.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--full-height .onboarding-plan-skeleton {
    min-height: calc(100dvh - 21rem);
  }

  .onboarding-assignment-skeleton {
    min-height: calc(100dvh - 18rem);
  }

  .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-stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.onboarding-stage-list > .onboarding-stepper-item {
  flex-direction: column;
  align-items: flex-start;
}

.onboarding-stage-spinner {
  margin-top: 0.1rem;
}

.onboarding-map-skeleton {
  margin-top: 1.15rem;
}

.onboarding-stage-note {
  margin: 0.2rem 0 0 1.75rem;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}

.onboarding-stage-retry {
  margin: 0.45rem 0 0 1.75rem;
}

.onboarding-stepper-sep {
  width: 1.25rem;
  height: 1px;
  background: var(--gals-color-border);
  list-style: none;
}

.onboarding-step-panel {
  margin-bottom: 1rem;
}

.onboarding-wait {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.onboarding-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;
}

.onboarding-wait__body {
  flex: 1 1 auto;
  min-width: 0;
}

.onboarding-wait__label {
  margin: 0;
  font-weight: 600;
}

.onboarding-wait__hint {
  margin: 0.35rem 0 0;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}

.onboarding-plan-skeleton__label {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.onboarding-plan-skeleton__hint {
  margin: 0 0 1rem;
  color: var(--gals-color-text-muted);
  font-size: 0.9rem;
}

.onboarding-plan-skeleton__preview {
  display: grid;
  gap: 0.65rem;
}

.onboarding-plan-skeleton__line {
  height: 0.85rem;
  border-radius: 0.35rem;
  background: linear-gradient(
    90deg,
    rgba(13, 148, 136, 0.08) 0%,
    rgba(13, 148, 136, 0.18) 50%,
    rgba(13, 148, 136, 0.08) 100%
  );
  background-size: 200% 100%;
  animation: onboarding-plan-shimmer 1.4s ease-in-out infinite;
}

.onboarding-plan-skeleton__line--title {
  width: 42%;
  height: 1.1rem;
}

.onboarding-plan-skeleton__line--short {
  width: 58%;
}

.onboarding-plan-skeleton__line--medium {
  width: 78%;
}

.onboarding-assignment-loading {
  margin-bottom: 1rem;
}

.onboarding-assignment-skeleton {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 16rem);
}

.onboarding-assignment-skeleton__tasks {
  display: grid;
  gap: 0.75rem;
  flex: 1;
}

.onboarding-assignment-skeleton__task {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gals-color-border);
  border-radius: var(--gals-radius-sm);
  background: #fafafa;
}

@keyframes onboarding-plan-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@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;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}

.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);
}

.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: 1.5rem 0 1rem;
  text-align: center;
}
.task-check-gate-ghost {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 2rem;
  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-title {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.task-check-gate-note {
  margin: 0 0 1.4rem;
  color: var(--gals-color-text-muted);
}
.task-check-gate-btn {
  padding: 0.8rem 1.9rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}
.task-check-gate-login {
  margin: 1rem 0 0;
  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; }
.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 {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  cursor: pointer;
  font: inherit;
}
.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 rgba(255, 255, 255, 0.35);
  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 {
  opacity: 0.55;
  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 {
  display: none;
}
.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-theory {
  margin-top: 0.5rem;
  margin-left: 2rem;
}
.topic-theory-picker { margin-bottom: 0.5rem; }
.topic-theory-picker__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  margin: 0;
  padding: 0.15rem 0;
  color: var(--gals-color-text-subtle);
  cursor: pointer;
  list-style: none;
}
.topic-theory-picker__label::-webkit-details-marker {
  display: none;
}
.topic-theory-picker__label::before {
  content: "▸";
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.topic-theory-picker[open] > .topic-theory-picker__label::before {
  transform: rotate(90deg);
}
.topic-theory-picker__label:hover {
  color: var(--gals-color-text-strong, #0f172a);
}
.topic-theory-picker__hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--gals-color-text-muted, #64748b);
}
.topic-theory-picker__options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.topic-theory-picker__option {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--gals-color-border, #cbd5e1);
  border-radius: 0.35rem;
  font: inherit;
  font-weight: 400;
  text-align: left;
  color: inherit;
  cursor: pointer;
  background: transparent;
}
.topic-theory-picker__option:hover:not(:disabled) {
  border-color: var(--gals-color-text-strong, #1e293b);
  text-decoration: none;
}
.topic-theory-picker__option.is-active {
  border-color: var(--gals-color-text-strong, #1e293b);
  border-width: 2px;
  padding: calc(0.45rem - 1px) calc(0.55rem - 1px);
}
.topic-theory-picker__option.is-busy,
.topic-theory-picker__option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.topic-theory-picker__option-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.topic-theory-picker__subject {
  font-size: 0.75rem;
  color: var(--gals-color-text-subtle);
}
.topic-theory-picker__title {
  font-size: 0.95rem;
  line-height: 1.3;
  word-break: break-word;
}
.topic-theory__panel-slot { margin-top: 0.5rem; }

.topic-theory-wait {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.topic-theory-wait__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;
}

.topic-theory-wait__body {
  flex: 1 1 auto;
  min-width: 0;
}

.topic-theory-wait__label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gals-color-text);
}

.topic-theory-wait__hint {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
  transition: opacity 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .topic-theory-wait__spinner {
    animation: none;
    border-color: var(--gals-color-accent, #0d9488);
    opacity: 0.55;
  }
  .topic-theory-wait__hint {
    transition: none;
  }
}

.topic-theory-result-row {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
}
.topic-theory-result-row .topic-theory-result {
  flex: 1 1 auto;
  min-width: 0;
}
.topic-theory-print {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.topic-theory-result {
  margin: 0;
  border: 1px solid var(--gals-color-border-subtle, rgba(0, 0, 0, 0.12));
  border-radius: 0.35rem;
  background: var(--gals-color-surface, #fff);
  overflow: hidden;
}
.topic-theory-result__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gals-color-text-muted, #64748b);
  cursor: pointer;
  list-style: none;
}
.topic-theory-result__title::-webkit-details-marker {
  display: none;
}
.topic-theory-result__title::before {
  content: "▸";
  flex-shrink: 0;
  color: var(--gals-color-text-muted, #64748b);
  transition: transform 0.15s ease;
}
.topic-theory-result[open] > .topic-theory-result__title::before {
  transform: rotate(90deg);
}
.topic-theory-result__title:hover {
  color: var(--gals-color-text-strong, #0f172a);
  background: var(--gals-color-surface-muted, #f8fafc);
}
.topic-theory-result__body {
  padding: 0 0.7rem 0.7rem;
  font-size: 0.95rem;
  border-top: 1px solid var(--gals-color-border-subtle, rgba(0, 0, 0, 0.08));
  min-width: 0;
}
.topic-theory-error .btn { margin-top: 0.35rem; }
.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,
  .topic-theory {
    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;
}

.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);
}

.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);
}

/* 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;
}

@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 */
body.app-page.app-onboarding .interests-field {
  margin-top: 32px;
}

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);
}

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;
}

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);
}

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-editor--full-height .onboarding-plan-skeleton,
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;
  margin: 24px calc(-1 * clamp(24px, 4.5vw, 56px)) 0;
  padding: 16px clamp(24px, 4.5vw, 56px) 16px;
  border-top: 1px solid var(--onb-line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
}

body.app-page.app-onboarding .strategy-editor-actions .btn-primary {
  width: min(100%, 34rem);
  align-self: center;
}

body.app-page.app-onboarding .onboarding-plan-skeleton__preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: 28rem;
}

body.app-page.app-onboarding .onboarding-plan-skeleton__line {
  height: 12px;
  border-radius: 6px;
  background: rgba(20, 32, 27, 0.06);
  background-size: auto;
  animation: onb-line-shimmer 1.8s ease-in-out infinite;
}

body.app-page.app-onboarding .onboarding-plan-skeleton__line--title {
  width: 72%;
  height: 12px;
}

body.app-page.app-onboarding .onboarding-plan-skeleton__line--short {
  width: 40%;
}

body.app-page.app-onboarding .onboarding-plan-skeleton__line--medium {
  width: 56%;
}

@keyframes onb-line-shimmer {
  0%,
  100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* 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);
  }
}

body.app-page.app-onboarding .onboarding-tree {
  position: relative;
  width: min(640px, 90vw);
  min-width: min(300px, 100%);
  aspect-ratio: 1.033 / 1;
  margin: 0 auto;
  pointer-events: none;
}

body.app-page.app-onboarding .onboarding-tree::before {
  content: "";
  position: absolute;
  inset: 8% 0 0;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 42%, var(--gals-color-night-glow), transparent 68%);
}

body.app-page.app-onboarding .onboarding-tree svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

body.app-page.app-onboarding .onboarding-tree[data-variant="graph"] {
  --kt-branch: #2dd4bf;
  --kt-tip: #ccfbf1;
  --kt-untouched: #cbd5e1;
}

body.app-page.app-onboarding .onboarding-tree-caption {
  margin: 8px auto 0;
  color: var(--onb-on-night-muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

body.app-page.app-onboarding .onboarding-stage-list {
  width: min(26rem, calc(100% - 48px));
  margin: 32px auto 0;
  padding: 0;
  list-style: none;
}

body.app-page.app-onboarding .onboarding-stage-list > li {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

body.app-page.app-onboarding .onboarding-stage-list .onboarding-stepper-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--onb-on-night);
  font-size: 17px;
  font-weight: 500;
  opacity: 1;
}

body.app-page.app-onboarding .onboarding-stage-list .onboarding-stepper-link.is-disabled {
  opacity: 1;
}

body.app-page.app-onboarding .onboarding-stage-list > li:not(.is-done):not(.is-current):not(:has(.job-status-error)) .onboarding-stepper-label {
  color: var(--onb-on-night-muted);
}

body.app-page.app-onboarding .onboarding-stage-list .onboarding-stepper-marker {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: var(--onb-on-night-muted);
  font-size: 13px;
}

body.app-page.app-onboarding .onboarding-stage-list .is-done .onboarding-stepper-marker {
  border-color: var(--onb-accent-night);
  background: var(--onb-accent-night);
  color: #fff;
}

body.app-page.app-onboarding.app-onboarding--night .onboarding-wait__spinner {
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid rgba(45, 212, 191, 0.25);
  border-top-color: var(--onb-accent-night);
  animation: task-photo-spin 1s linear infinite;
}

body.app-page.app-onboarding.app-onboarding--night .job-status-error,
body.app-page.app-onboarding.app-onboarding--night .onboarding-stage-note {
  color: #fda29b;
  font-size: 15px;
}

body.app-page.app-onboarding .onboarding-stage-retry {
  width: 100%;
  margin: 12px 0 0;
}

body.app-page.app-onboarding .onboarding-stage-hints {
  width: min(26rem, calc(100% - 48px));
  margin: 14px auto 0;
  color: var(--onb-on-night-muted);
  font-size: 14px;
}

body.app-page.app-onboarding .onboarding-stage-hints .job-status-hint {
  margin: 0 0 4px;
  color: inherit;
  font-size: 14px;
}

@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,
  body.app-page.app-onboarding .onboarding-stage-list > li {
    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,
  body.app-page.app-onboarding .onboarding-plan-skeleton__line,
  body.app-page.app-onboarding .onboarding-wait__spinner {
    transition: none;
    animation: none;
  }

  body.app-page.app-onboarding.app-onboarding--night .onboarding-wait__spinner {
    border-color: var(--onb-accent-night);
    background: radial-gradient(circle at 50% 2px, var(--onb-accent-night) 0 2px, transparent 2.5px);
  }
}

/* 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;
}

body.app-page.app-onboarding .prep-hints {
  margin: 14px 0 0;
  color: var(--onb-muted);
  font-size: 14px;
  text-align: center;
}

body.app-page.app-onboarding .prep-hints .job-status-hint {
  margin: 0 0 4px;
  color: inherit;
  font-size: inherit;
}

body.app-page.app-onboarding:not(.app-onboarding--night) .onboarding-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--onb-ink);
  font-size: 17px;
  font-weight: 500;
}

body.app-page.app-onboarding:not(.app-onboarding--night) .onboarding-wait__body {
  flex: 0 1 auto;
}

body.app-page.app-onboarding:not(.app-onboarding--night) .onboarding-wait__label {
  margin: 0;
  font-weight: 500;
}

body.app-page.app-onboarding:not(.app-onboarding--night) .onboarding-wait__hint {
  display: none;
}

body.app-page.app-onboarding:not(.app-onboarding--night) .onboarding-wait__spinner {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid rgba(15, 118, 110, 0.2);
  border-top-color: var(--onb-accent);
  border-radius: 50%;
  animation: task-photo-spin 1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  body.app-page.app-onboarding .prep-topic__check {
    transition: none;
  }

  body.app-page.app-onboarding:not(.app-onboarding--night) .onboarding-wait__spinner {
    animation: none;
    border-color: var(--onb-accent);
  }
}

body.app-page.app-onboarding .prep-wait {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

body.app-page.app-onboarding .prep-wait .onboarding-wait__spinner {
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 3px solid rgba(15, 118, 110, 0.2);
  border-top-color: var(--onb-accent);
  border-radius: 50%;
  animation: task-photo-spin 1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  body.app-page.app-onboarding .prep-wait .onboarding-wait__spinner {
    animation: none;
    border-color: var(--onb-accent);
  }
}

/* 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;
}

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;
}

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;
}

body.app-page.app-onboarding .app-main-inner > .card .unclosed-upgrade {
  margin-top: 24px;
}

/* 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;
}
