*,
*::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-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-untouched: #475569;
  --gals-color-status-untouched-bg: #f1f5f9;

  /* Typography */
  --gals-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gals-font-display: "Fraunces", 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);
  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);
  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;
}

.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-meta,
.task-summary-duration {
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}

.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 {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

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

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

.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 {
  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.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;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dash-head-text {
  min-width: 0;
}

.dash-title {
  margin: 0 0 0.2rem;
  font-family: "Fraunces", 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-date {
  margin: 0;
  font-size: 0.9rem;
  color: var(--landing-muted, var(--gals-color-text-muted));
}

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

.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, #e8f6ef) 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, #0e9f6e) 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;
}

.dash-profile-name {
  margin: 0;
  font-family: "Fraunces", 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, #0e9f6e) 70%, #86efac)
  );
  border-radius: 999px;
  transition: width 0.35s ease;
}

.dash-rhythm {
  display: flex;
  gap: 0.2rem;
}

.dash-rhythm-day {
  flex: 1;
  height: 0.45rem;
  min-width: 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--landing-border, #e2e8f0) 80%, #fff);
}

.dash-rhythm-day.is-active {
  background: var(--landing-accent, var(--gals-color-accent));
}

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

.progress-stats-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.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-stat-body {
  margin: 0;
  font-size: 1rem;
}

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

.mastery-topic-first-try {
  margin-left: 0.35rem;
  white-space: nowrap;
}

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

@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 {
    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;
  --landing-faint: #8a9691;
  --landing-border: #e4eae7;
  --landing-border-strong: #d2dcd7;
  --landing-accent: #0e9f6e;
  --landing-accent-ink: #0a7d57;
  --landing-accent-soft: #e8f6ef;
  --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(14, 159, 110, 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);

  margin: 0;
  font-family: "DM Sans", var(--gals-font-sans);
  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: "Fraunces", 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;
}

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

.landing-logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--landing-accent);
  color: #fff;
  font-family: "Fraunces", var(--gals-font-display);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 12px -4px rgba(14, 159, 110, 0.6);
}

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

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

.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-hero {
  padding: 72px 0 56px;
}

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

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--landing-accent-ink);
  background: var(--landing-accent-soft);
  padding: 6px 12px;
  border-radius: 100px;
}

.landing-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--landing-accent);
}

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: 30ch;
  margin: 20px 0 0;
  white-space: pre-line;
}

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

.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 {
  background: var(--landing-accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(14, 159, 110, 0.65);
}

.landing-btn-primary:hover {
  background: var(--landing-accent-ink);
  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-device {
  position: relative;
}

.landing-device::before {
  content: "";
  position: absolute;
  inset: -8% -6% -14%;
  background: radial-gradient(60% 60% at 70% 30%, rgba(14, 159, 110, 0.14), transparent 70%);
  filter: blur(6px);
  z-index: 0;
}

.landing-app {
  position: relative;
  z-index: 1;
  background: var(--landing-surface);
  border: 1px solid var(--landing-border);
  border-radius: 20px;
  box-shadow: var(--landing-shadow-lg);
  overflow: hidden;
}

.landing-app-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--landing-border);
  background: #fff;
}

.landing-app-bar-dots {
  display: flex;
  gap: 6px;
}

.landing-app-bar-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--landing-border-strong);
  font-style: normal;
}

.landing-app-addr {
  margin-left: 8px;
  font-size: 12px;
  color: var(--landing-faint);
  background: var(--landing-ground);
  border: 1px solid var(--landing-border);
  border-radius: 7px;
  padding: 4px 12px;
}

.landing-app-body {
  padding: 22px 22px 24px;
}

.landing-app-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.landing-app-hi {
  font-size: 13px;
  color: var(--landing-faint);
  font-weight: 600;
}

.landing-app-date {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 3px 0 0;
  font-family: "Fraunces", var(--gals-font-display);
}

.landing-app-count {
  font-size: 13px;
  font-weight: 650;
  color: var(--landing-accent-ink);
  background: var(--landing-accent-soft);
  padding: 5px 11px;
  border-radius: 100px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.landing-progress {
  height: 7px;
  border-radius: 100px;
  background: var(--landing-border);
  margin: 16px 0 20px;
  overflow: hidden;
}

.landing-progress > i {
  display: block;
  height: 100%;
  background: var(--landing-accent);
  border-radius: 100px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-style: normal;
}

.landing-tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-task {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid var(--landing-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.landing-task:hover {
  border-color: var(--landing-border-strong);
  background: #fcfefd;
}

.landing-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.75px solid var(--landing-border-strong);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.landing-check svg {
  width: 13px;
  height: 13px;
  color: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.landing-task-main {
  flex: 1;
  min-width: 0;
}

.landing-task-title {
  font-size: 14.5px;
  font-weight: 560;
  letter-spacing: -0.005em;
}

.landing-task-meta {
  font-size: 12.5px;
  color: var(--landing-faint);
  margin-top: 2px;
}

.landing-chip {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--landing-muted);
  background: var(--landing-ground);
  border: 1px solid var(--landing-border);
  white-space: nowrap;
}

.landing-task.done .landing-check {
  background: var(--landing-accent);
  border-color: var(--landing-accent);
}

.landing-task.done .landing-check svg {
  opacity: 1;
  transform: scale(1);
}

.landing-task.done .landing-task-title {
  color: var(--landing-faint);
  text-decoration: line-through;
  text-decoration-color: var(--landing-border-strong);
}

.landing-app-foot {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--landing-faint);
  display: flex;
  align-items: center;
  gap: 7px;
}

.landing-app-foot b {
  color: var(--landing-muted);
  font-weight: 600;
}

.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: "Fraunces", var(--gals-font-display);
}

.landing-pains-cta {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.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(3, 1fr);
  gap: 20px;
}

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

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

.landing-pricing-offer {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
}

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

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

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

.landing-pricing-amount--dual {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.28em 0.35em;
  font-size: clamp(32px, 5vw, 44px);
}

body.app-page .landing-pricing-amount--dual {
  justify-content: flex-start;
}

.landing-pricing-amount--dual .landing-pricing-amount-main {
  font-family: inherit;
  font-size: 1em;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
  font-variant-numeric: tabular-nums;
}

.landing-pricing-currency {
  font-family: var(--gals-font-body, inherit);
  font-weight: 650;
  letter-spacing: 0;
}

.landing-pricing-amount--dual .landing-pricing-amount-sep {
  font-family: var(--gals-font-body, inherit);
  font-size: 0.42em;
  font-weight: 500;
  color: var(--landing-faint);
  letter-spacing: 0;
  text-transform: lowercase;
}

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

.landing-pricing-currency-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--landing-faint);
}

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

.landing-pricing-meta {
  font-size: 13.5px;
  color: var(--landing-faint);
  margin: 8px 0 0;
}

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

.landing-pricing-footnote {
  margin: 18px 0 0;
  font-size: 13.5px;
  color: var(--landing-muted);
  line-height: 1.45;
}

.landing-pricing-upsell {
  margin: 22px 0 0;
  font-size: 14px;
  color: var(--landing-muted);
  line-height: 1.45;
}

.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-offer {
  text-align: left;
  margin: 0;
}

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

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

.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-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 {
  font-size: 15px;
  border-width: 1.5px;
  border-color: #cbd5e1;
  border-radius: 11px;
  padding: 13px 14px;
}

body.auth-page .auth-card .input:focus {
  border-color: var(--landing-accent);
  box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.15);
}

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

body.auth-page .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-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: Fraunces, Georgia, serif;
  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);
}

body.app-page h1 {
  font-family: "Fraunces", 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: "Fraunces", 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-form {
  display: inline;
}

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) {
  body.app-page .landing-wrap {
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }

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

  body.app-page .landing-nav-end {
    justify-content: flex-end;
    gap: 6px 10px;
    flex-wrap: wrap;
  }

  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(14, 159, 110, 0.15);
}

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

@media (max-width: 860px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .landing-lead {
    max-width: 42ch;
  }

  .landing-steps-grid {
    grid-template-columns: 1fr;
  }

  .landing-device {
    order: 2;
  }

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

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

.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-nav-group + .docs-nav-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.docs-nav-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 0.35rem;
}

.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-article {
  padding: 1.5rem 1.75rem;
  min-width: 0;
}

.docs-index-section {
  margin-top: 1.5rem;
}

.docs-index-section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}

.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-desc {
  color: #64748b;
  font-size: 0.9rem;
}

.docs-index-note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

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

/* 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: flex;
  align-items: center;
  justify-content: space-between;
  gap: 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;
}

.assignment-nav-meta {
  font-size: 0.85rem;
  color: var(--gals-color-text-muted);
  flex-shrink: 1;
  text-align: right;
  line-height: 1.25;
}

.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-report-input {
  margin-bottom: 0.65rem;
  min-height: 5.5rem;
  font-size: 0.9rem;
  resize: vertical;
}

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

/* Marked for rework: stripe + badge instead of the check status.
   Grey (secondary) = process pending, same kind as the draft badge. */
.task-item--to-regenerate {
  border-left: 3px solid var(--gals-color-secondary-text);
}

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

.task-item--to-regenerate .task-summary-badge--regen {
  display: inline;
}

.task-item--to-regenerate .task-summary-badge:not(.task-summary-badge--regen) {
  display: none;
}

.task-revision {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--gals-color-border-subtle);
}

.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-plans {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  border: none;
  padding: 0;
}
.subscription-plan-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  cursor: pointer;
}
.subscription-plan-option input {
  margin-top: 0.25rem;
}
.subscription-plan-option span {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.subscription-billing {
  border: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.subscription-confirm {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 1rem 0;
}

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

.section-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

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

.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,
.strategy-refine-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: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.learner-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
}

.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-stepper-sep {
  width: 1.25rem;
  height: 1px;
  background: var(--gals-color-border);
  list-style: none;
}

.onboarding-stepper-compact {
  display: none;
  width: 100%;
}

.onboarding-stepper-compact-label {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.onboarding-stepper-progress {
  height: 0.35rem;
  background: var(--gals-color-border);
  border-radius: 999px;
  overflow: hidden;
}

.onboarding-stepper-progress-bar {
  height: 100%;
  background: var(--gals-color-accent);
}

.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-stepper-compact {
    display: block;
  }
}

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

.draft-markdown {
  margin-bottom: 0.75rem;
}

.draft-actions {
  margin-top: 1rem;
}

.draft-actions--top {
  margin-top: 0;
  margin-bottom: 1rem;
}

.draft-actions--bottom {
  margin-top: 1rem;
  margin-bottom: 0;
}

.diagnostic-part {
  margin-bottom: 1rem;
}

.diagnostic-part:last-child {
  margin-bottom: 0;
}

.diagnostic-part-title {
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.diagnostic-part--complete {
  border-left: 3px solid #16a34a;
}

.diagnostic-part-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #166534;
  background: #dcfce7;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
}

.diagnostic-results--inline {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e5e7eb);
}

.task-feedback {
  margin: 0.5rem 0 0 1.75rem;
  font-size: 0.9rem;
  color: #374151;
}

.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: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--gals-color-border-subtle);
}

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

.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;
  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);
}
/* Цвет = действие: зелёный — принято, красный — требует внимания (см. ui.md). */
.task-check--correct,
.task-check--minor_errors { border-left-color: var(--gals-color-success-text); }
.task-check--major_gaps,
.task-check--not_done { border-left-color: var(--gals-color-danger); }
.task-check--needs_parent { border-left-color: var(--gals-color-text-subtle); }
.task-check-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.task-check-badge {
  font-weight: 600;
  color: var(--gals-color-text-strong);
}
.task-check-by {
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}
.task-check-analysis { font-size: 0.925rem; }
.task-check-count {
  margin: 0.5rem 0 0 2rem;
  font-size: 0.875rem;
  color: var(--gals-color-text-muted);
}
.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-recognized-answer {
  margin-top: 0.75rem;
  margin-bottom: 0;
  margin-left: 2rem;
  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-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;
}
.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: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-weight: 500;
  cursor: pointer;
}
.task-parent-verified-checkbox { margin-top: 0.2rem; 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; }
.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-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: 2px solid var(--gals-color-surface, #fff);
  border-radius: 50%;
  background: var(--gals-color-danger, #dc2626);
  color: #fff;
  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 3px rgba(0, 0, 0, 0.2);
}
.photo-stack-remove:hover {
  background: var(--gals-color-danger-hover, #b91c1c);
}
.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-review-root { margin-top: 0.25rem; }
.topic-theory {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--gals-color-border-subtle, rgba(0, 0, 0, 0.08));
}
.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 {
  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));
}
.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;
  }

  .task-report-panel,
  .task-report-panel--recheck,
  .task-review-in-progress {
    margin-left: 0.5rem;
  }

  .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;
}
.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-success-bg);
}
.task-check-child--major_gaps,
.task-check-child--not_done { background: var(--gals-color-status-gap-bg); }
.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);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}
.control-work-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.control-work-modal__form {
  padding: 1.25rem 1.5rem 1.5rem;
}
.control-work-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.control-work-modal__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.control-work-modal__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.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;
}
.control-work-topic-list {
  max-height: 18rem;
  overflow: auto;
  border: 1px solid var(--gals-color-border, #e5e7eb);
  border-radius: 10px;
  padding: 0.5rem;
  margin-bottom: 1rem;
}
.control-work-topic-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--gals-color-border, #e5e7eb);
}
.control-work-topic-row:last-child {
  border-bottom: none;
}
.control-work-topic-row__title {
  font-weight: 600;
}
.control-work-topic-row__tag {
  font-size: 0.8rem;
  color: var(--gals-color-text-muted);
}
.control-work-map-preview .mastery-topic-downgrade {
  border-left: 3px solid var(--gals-color-status-gap-text, #b45309);
  padding-left: 0.75rem;
}
.assignment--control-work {
  margin-top: 1rem;
}
