/* Экранное оформление: базовая палитра → компоненты → адаптивность → декоративные уточнения.
   При одинаковой специфичности более позднее правило CSS побеждает более раннее.
   Логические свойства inline/block помогают корректно разместить смешанный RTL-текст. */
/* Дизайн-токены: общие цвета, шрифт и тени. var(--имя) использует эти значения по всему интерфейсу. */
:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --surface: #fffdf8;
  --ink: #16181d;
  --muted: #62615d;
  --line: #d4d0c6;
  --accent: #ff5a1f;
  --accent-ink: #a72c05;
  --teal: #0f766e;
  --soft: #e9e5db;
  --danger: #a02c24;
  --shadow: 0 8px 24px #16181d07;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
}
/* Тёмная тема переопределяет общую палитру; разметка экранов при этом остаётся прежней. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0e1116;
  --surface: #181d24;
  --ink: #ece8df;
  --muted: #b1b5bb;
  --line: #424955;
  --accent-ink: #ff976e;
  --teal: #68d4c6;
  --soft: #252c35;
  --danger: #ff9c91;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    color-scheme: dark;
    --paper: #0e1116;
    --surface: #181d24;
    --ink: #ece8df;
    --muted: #b1b5bb;
    --line: #424955;
    --accent-ink: #ff976e;
    --teal: #68d4c6;
    --soft: #252c35;
    --danger: #ff9c91;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
.button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
button:hover,
.button:hover {
  border-color: var(--ink);
  background: var(--soft);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #16181d;
}
.primary:hover {
  background: #ff7c4c;
}
.dark-button {
  background: var(--ink);
  color: var(--paper);
}
.danger {
  color: var(--danger);
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
a:hover {
  color: var(--accent-ink);
}
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px 12px;
  min-height: 44px;
  max-width: 100%;
}
textarea {
  width: 100%;
  line-height: 1.7;
  resize: vertical;
  min-height: 160px;
}
input[type='checkbox'] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--teal);
}
input[type='range'] {
  padding: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 500;
}
h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  letter-spacing: -0.045em;
  line-height: 1.07;
}
h2 {
  font-size: 1.9rem;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 1.45rem;
}
p {
  line-height: 1.6;
}
.muted,
.lede {
  color: var(--muted);
}
.lede {
  font-size: 1.05rem;
  max-width: 650px;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 750;
  color: var(--teal);
}
.page-title {
  display: grid;
  gap: 15px;
  margin-block: 34px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 20px;
}
.small-stack {
  display: grid;
  gap: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 20px;
}
.panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel > * + * {
  margin-block-start: 18px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
}
.field > span {
  color: var(--muted);
}
.field input:not([type='checkbox']):not([type='range']) {
  width: 100%;
}
.field.grow {
  flex: 1;
}
.badge {
  font-size: 0.75rem;
  padding: 5px 9px;
  background: var(--soft);
  border-radius: 5px;
  font-weight: 650;
}
.demo {
  border: 1px dashed var(--muted);
  background: transparent;
}
.time {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}
.hero-time {
  font-size: clamp(2rem, 4vw, 3.9rem);
}
.meter {
  height: 9px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--soft);
  margin-block: 18px 10px;
}
/* Заполненная часть шкалы. Ширину в процентах задаёт ui.budget, цвет зависит от состояния лимита. */
.meter > span {
  display: block;
  height: 100%;
  background: var(--teal);
}
.over .meter > span {
  background: var(--accent);
}
.budget-label {
  color: var(--teal);
  font-weight: 650;
  font-size: 0.9rem;
}
.over .budget-label {
  color: var(--accent-ink);
}
.budget .row {
  align-items: baseline;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  border-block-end: 1px solid var(--line);
  padding-block-end: 10px;
  margin-block-end: 26px;
}
.tabs a {
  padding: 11px 13px;
  min-height: 44px;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 7px;
  color: var(--muted);
}
.tabs a.active {
  background: var(--ink);
  color: var(--paper);
}
#header {
  max-width: 1240px;
  margin: auto;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-block-end: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #16181d;
  font-size: 27px;
  line-height: 1;
}
#header nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
}
#header nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: none;
}
#main {
  max-width: 1176px;
  margin: auto;
  padding: 0 0 60px;
  outline: none;
}
#footer {
  max-width: 1176px;
  margin: auto;
  border-block-start: 1px solid var(--line);
  padding: 24px 0 32px;
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
#notice:empty {
  display: none;
}
.notice {
  max-width: 1176px;
  margin: 18px auto 0;
  padding: 14px 18px;
  border-inline-start: 4px solid var(--teal);
  background: var(--surface);
  font-size: 0.9rem;
}
.notice.error {
  border-color: var(--danger);
}
.skip {
  position: absolute;
  inset-block-start: -100px;
  background: var(--surface);
  z-index: 20;
  padding: 12px;
}
.skip:focus {
  inset-block-start: 4px;
}
.home-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}
.home-heading .row {
  margin-block-end: 34px;
}
.intro-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
  margin-block: 30px;
}
.intro-feature {
  background: var(--ink);
  color: var(--paper);
  padding: 36px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.intro-feature h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 560px;
  margin-block: 16px 26px;
}
.intro-feature p {
  max-width: 490px;
}
.intro-feature .eyebrow {
  color: #8bddcf;
}
.intro-feature .row {
  margin-block-start: 25px;
}
.steps {
  display: grid;
  gap: 22px;
}
.step {
  display: flex;
  gap: 18px;
}
.step-number {
  color: var(--accent-ink);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding-block-start: 5px;
}
.step h3 {
  font-size: 1.3rem;
}
.step p {
  font-size: 0.9rem;
  margin-block-start: 6px;
  color: var(--muted);
}
.talk-card {
  display: grid;
  gap: 20px;
}
.talk-card h2 {
  font-size: 1.65rem;
  overflow-wrap: anywhere;
}
.talk-card .row:last-child {
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line);
}
.card-meta {
  color: var(--muted);
  font-size: 0.85rem;
}
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: start;
}
.sidebar {
  position: sticky;
  inset-block-start: 20px;
}
.block {
  border-inline-start: 4px solid var(--teal);
}
.block[data-priority='important'] {
  border-inline-start-color: var(--accent);
}
.block[data-priority='optional'] {
  border-inline-start-color: var(--muted);
}
.block textarea {
  border: 0;
  border-block: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding-inline: 0;
  min-height: 140px;
}
.block-title {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  border: 0 !important;
  background: transparent;
  padding-inline: 0 !important;
}
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chips button {
  font-size: 0.78rem;
  min-height: 44px;
  padding: 8px 11px;
  background: transparent;
}
.chips button[aria-pressed='true'] {
  background: var(--soft);
  border-color: var(--ink);
}
.block-number {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mini {
  font-size: 0.8rem;
}
.hint {
  border-block-start: 1px solid var(--line);
  padding-block: 15px;
  display: grid;
  gap: 10px;
}
.hint q {
  font-size: 0.95rem;
}
.word-button {
  display: inline;
  padding: 2px 5px;
  min-height: 44px;
  min-width: 44px;
  border-color: transparent;
  font-weight: 400;
}
.word-button.hard {
  text-decoration: underline wavy var(--accent-ink);
}
.word-button.selected {
  background: var(--soft);
  font-weight: 700;
}
.word-tools {
  line-height: 2.8;
}
.toolbar {
  position: sticky;
  inset-block-end: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 4;
}
.rehearsal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 265px;
  gap: 30px;
}
/* Суфлёр прокручивается внутри собственного контейнера, поэтому нижние кнопки не перекрывают текст. */
.teleprompter {
  height: 58dvh;
  overflow: auto;
  scroll-padding-block: 20vh;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.sentence {
  line-height: 1.65;
  margin-block: 18px;
  padding: 10px 14px;
  border-inline-start: 3px solid transparent;
  opacity: 0.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sentence.past {
  opacity: 0.45;
}
.sentence.current {
  opacity: 1;
  border-color: var(--accent);
  background: var(--soft);
  border-radius: 0 7px 7px 0;
}
.note-chip {
  display: inline-block;
  color: var(--teal);
  font: 600 0.8rem system-ui;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  vertical-align: middle;
  margin-inline: 4px;
}
ruby rt {
  font-size: 0.48em;
  color: var(--teal);
}
.clock {
  font-size: clamp(3rem, 6vw, 5rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1.1;
}
.checkpoint {
  padding: 12px 0;
  border-block-end: 1px solid var(--line);
  font-size: 0.85rem;
}
.checkpoint.skipped {
  opacity: 0.5;
  text-decoration: line-through;
}
.heat {
  display: block;
  width: 100%;
  text-align: start;
  margin-block: 8px;
  font-weight: 400;
  line-height: 1.7;
}
.heat-1 {
  border-inline-start: 4px solid #bf7710;
}
.heat-2 {
  border-inline-start: 7px solid #c34825;
  text-decoration: underline dotted;
}
.heat-3 {
  border-inline-start: 10px solid #a52e25;
  text-decoration: underline double;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px minmax(40px, 1fr) 90px;
  gap: 12px;
  align-items: center;
  font-size: 0.85rem;
}
.chart-bar {
  height: 16px;
  background: var(--teal);
  min-width: 2px;
}
.chart-bar.stumbles {
  background: var(--accent);
}
.chart {
  display: grid;
  gap: 16px;
}
.comparison {
  display: grid;
  gap: 14px;
}
.comparison-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding-block: 14px;
  border-block-end: 1px solid var(--line);
}
details {
  border-block-start: 1px solid var(--line);
  padding-block: 16px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 650;
}
.copy-area {
  min-height: 110px;
  font-size: 0.85rem;
}
.cuecard {
  width: 105mm;
  min-height: 148mm;
  background: white;
  color: #16181d;
  padding: 8mm;
  font-size: 10pt;
  box-shadow: 0 10px 35px #0002;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.cuecard h1 {
  font-size: 21pt;
}
.cuecard h2 {
  font-size: 12pt;
}
.cuecard-block {
  margin-block: 4mm;
  border-block-start: 1px solid #777;
  padding-block-start: 2mm;
}
.cuecard p {
  font-size: 9pt;
  line-height: 1.45;
}
.countdown {
  font-size: 6rem;
  line-height: 1;
  font-weight: 800;
  color: var(--accent-ink);
  text-align: center;
}
.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.full {
  width: 100%;
}
.spacer {
  margin-block: 26px;
}
.prose {
  max-width: 780px;
}
.prose p,
.prose ul {
  margin-block: 16px;
  line-height: 1.75;
}
.help {
  font-size: 0.85rem;
  color: var(--muted);
}
.warning {
  color: var(--danger);
  font-weight: 650;
}
.count {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.calibration-text {
  font-size: 1.25rem;
  line-height: 1.9;
  max-width: 760px;
}
.radio-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.print-warning {
  display: none;
}
@media (max-width: 1240px) {
  #main,
  #footer {
    margin-inline: 28px;
  }
  .notice {
    margin-inline: 28px;
  }
}
/* Мобильный вариант сетки: при ширине до 850 px раскладка перестраивается без изменения данных. */
@media (max-width: 850px) {
  .editor-layout,
  .rehearsal-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .intro-grid {
    grid-template-columns: 1fr;
  }
  .rehearsal-side {
    order: -1;
  }
  .rehearsal-side .clock {
    font-size: 3rem;
  }
  .rehearsal-side .panel {
    padding: 16px;
  }
  .teleprompter {
    height: 48dvh;
  }
  .home-heading {
    align-items: start;
    flex-direction: column;
    gap: 0;
  }
  .home-heading .row {
    margin-block: 0 20px;
  }
}
@media (max-width: 600px) {
  #header {
    padding: 16px 18px;
    align-items: start;
    flex-wrap: wrap;
    gap: 12px;
  }
  #header nav {
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.8rem;
  }
  #main,
  #footer {
    margin-inline: 16px;
  }
  .notice {
    margin-inline: 16px;
  }
  .page-title {
    margin-block: 26px;
  }
  .panel {
    padding: 18px;
  }
  .intro-feature {
    padding: 26px;
  }
  .intro-feature h2 {
    font-size: 2.4rem;
  }
  .tabs {
    gap: 0;
  }
  .tabs a {
    padding: 10px;
  }
  .teleprompter {
    padding: 12px 8px;
  }
  .toolbar {
    padding-block-end: calc(12px + env(safe-area-inset-bottom));
    border-radius: 10px 10px 0 0;
    margin-inline: -16px;
  }
  .toolbar button {
    flex: 1;
  }
  .hero-time {
    font-size: 2.1rem;
  }
  .cuecard {
    padding: 6mm;
  }
  .bar-row {
    grid-template-columns: 70px minmax(20px, 1fr) 80px;
  }
}
/* Учитываем системное пожелание уменьшить движение; анимация не нужна для понимания смысла экрана. */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.reduce-motion * {
  scroll-behavior: auto !important;
  animation: none !important;
  transition: none !important;
}
.intro-feature {
  background: #16181d;
  color: #ece8df;
}
.sidebar .hero-time {
  font-size: 2.2rem;
  white-space: nowrap;
}
.sentence {
  opacity: 1;
  color: var(--muted);
}
.sentence.past {
  opacity: 1;
  color: var(--muted);
}
.sentence.current {
  color: var(--ink);
}
.teleprompter h2.current {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 12px;
  background: var(--soft);
}
.cuecard[contenteditable]:focus {
  outline: 2px solid var(--teal);
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}
.comparison-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.sidebar .hero-time {
  font-size: 1.9rem;
}
#main > .panel {
  margin-block-start: 22px;
}

/* Простой путь: одно главное действие на каждом из трёх шагов. */
.page-title h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
}
.page-title .eyebrow:empty {
  display: none;
}
.talk-context {
  margin-block: -18px 22px;
  color: var(--muted);
  font-size: 0.95rem;
}
.talk-context .badge {
  margin-inline-start: 10px;
}
.step-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-block: 20px 12px;
}
.step-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  min-height: 68px;
  font-weight: 650;
}
.step-circle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  background: var(--soft);
  border-radius: 50%;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 750;
  color: var(--ink);
}
.step-nav a.active {
  border: 2px solid var(--teal);
  padding: 15px;
}
.step-nav a.active .step-circle {
  background: var(--teal);
  color: var(--paper);
}
.extra-tools {
  border: 0;
  padding: 0;
  margin-block-end: 25px;
  font-size: 0.9rem;
}
.extra-tools summary {
  color: var(--muted);
  font-weight: 500;
  display: list-item;
  list-style-position: inside;
  padding-block: 12px;
}
.extra-tools .row {
  padding-block: 10px;
}
.simple-flow {
  max-width: 880px;
  margin-inline: auto;
  display: grid;
  gap: 20px;
}
.simple-flow .panel {
  padding: 28px;
}
.step-instruction {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--ink);
}
.simple-text {
  min-height: 300px;
  font-size: 1.1rem;
  line-height: 1.85;
  padding: 18px;
}
.simple-flow .field {
  font-size: 1rem;
}
.simple-flow .field > span {
  color: var(--ink);
}
.simple-flow input:not([type='checkbox']) {
  font-size: 1.05rem;
}
.big-action {
  min-height: 56px;
  font-size: 1.05rem;
  padding: 15px 23px;
  border-radius: 10px;
}
.simple-estimate {
  font-size: 1.1rem;
  padding: 16px;
  border-radius: 10px;
  background: var(--soft);
  line-height: 1.6;
}
.quiet {
  background: transparent;
  font-weight: 500;
}
.optional-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 20px;
  background: var(--surface);
}
.optional-panel summary,
.custom-time summary {
  display: list-item;
  list-style-position: inside;
  line-height: 1.5;
  padding-block: 12px;
  min-height: 48px;
}
.optional-panel[open] {
  padding-block-end: 20px;
}
.optional-panel[open] > * + * {
  margin-block-start: 16px;
}
.time-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.time-choice {
  font-size: 1.25rem;
  min-height: 72px;
  border: 2px solid var(--line);
  font-weight: 650;
}
.time-choice[aria-pressed='true'] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--paper);
}
.custom-time {
  border: 0;
  padding: 0;
}
.custom-time .row {
  padding-block: 10px;
}
.section-choice {
  display: flex;
  gap: 14px;
  align-items: start;
  padding-block: 18px;
  border-block-start: 1px solid var(--line);
  cursor: pointer;
}
.section-choice input {
  margin-block-start: 5px;
  flex: none;
}
.section-choice .help {
  margin-block: 6px 10px;
}
.selection-explanation {
  border-inline-start: 3px solid var(--teal);
  padding-inline-start: 14px;
}
.welcome-guide {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  margin-block: 25px 40px;
}
.welcome-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
}
.welcome-steps li {
  display: flex;
  align-items: start;
  gap: 14px;
}
.welcome-steps h2 {
  font-family: system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 650;
  margin-block: 4px 8px;
}
.welcome-steps p {
  font-size: 0.95rem;
  color: var(--muted);
}
.welcome-guide > .help {
  margin-block-start: 18px;
}
.saved-talks {
  display: grid;
  gap: 12px;
}
.saved-talks > h2 {
  font-size: 1.6rem;
  margin-block-end: 8px;
}
.saved-talk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.saved-talk h3 {
  font-family: system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
  margin-block-end: 8px;
}
.talk-actions {
  border: 0;
  padding: 0;
  position: relative;
}
.talk-actions summary {
  padding: 10px;
  min-width: 44px;
  font-weight: 400;
  color: var(--muted);
}
.talk-actions[open] > button {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 100%;
  z-index: 5;
  box-shadow: var(--shadow);
}
.header-more {
  padding: 0;
  border: 0;
  position: relative;
}
.header-more summary {
  font-size: 0.875rem;
  font-weight: 500;
  display: list-item;
  list-style-position: inside;
}
.header-menu {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 100%;
  z-index: 10;
  min-width: 210px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.reading-help {
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-block: 20px;
}
.reading-help p + p {
  margin-block-start: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}
.rehearsal-layout {
  grid-template-columns: minmax(0, 1fr) 220px;
}
.toolbar button {
  min-height: 54px;
  font-size: 1rem;
}
.toolbar .primary {
  min-width: 180px;
}
.teleprompter {
  height: 53dvh;
}
@media (max-width: 850px) {
  .rehearsal-layout {
    grid-template-columns: 1fr;
  }
  .rehearsal-side .panel {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
  }
  .rehearsal-side .panel > * {
    margin: 0;
  }
  .rehearsal-side .clock {
    font-size: 2.7rem;
  }
}
@media (max-width: 600px) {
  .step-nav {
    gap: 7px;
  }
  .step-nav a {
    flex-direction: column;
    align-items: start;
    gap: 8px;
    padding: 12px 8px;
    font-size: 0.8rem;
  }
  .step-nav a.active {
    padding: 11px 7px;
  }
  .step-circle {
    width: 30px;
    height: 30px;
  }
  .welcome-guide {
    padding: 22px;
  }
  .welcome-steps {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .welcome-guide .row > * {
    width: 100%;
  }
  .simple-flow .panel {
    padding: 20px;
  }
  .simple-text {
    min-height: 260px;
    padding: 12px;
  }
  .simple-flow .big-action {
    width: 100%;
  }
  .time-choices {
    grid-template-columns: repeat(2, 1fr);
  }
  .time-choice {
    min-height: 60px;
  }
  .saved-talk {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .saved-talk > div {
    grid-column: 1/-1;
  }
  .saved-talk .talk-actions {
    justify-self: end;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar button {
    font-size: 0.9rem;
    padding: 10px;
  }
  .toolbar .primary {
    min-width: 0;
  }
  .reading-help {
    padding: 16px;
  }
  .talk-context {
    font-size: 0.85rem;
  }
  #header nav {
    gap: 14px;
  }
}

/* Единая сетка и ритм: внешние края одинаковы на каждом экране. */
:root {
  --radius: 16px;
  --shadow: 0 2px 3px #16181d02, 0 12px 32px #16181d04;
}
#header,
#main,
#footer {
  width: calc(100% - 64px);
  max-width: 1040px;
  margin-inline: auto;
}
#header {
  padding: 24px 0;
  min-height: 88px;
}
#main {
  padding-block-end: 64px;
}
#footer {
  padding-block: 24px 32px;
}
.notice {
  width: calc(100% - 64px);
  max-width: 1040px;
  margin-inline: auto;
}
.page-title {
  margin-block: 44px 24px;
  gap: 12px;
}
.page-title h1 {
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 1.13;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.lede {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 64ch;
}
.talk-context {
  margin-block: -8px 24px;
}
.panel {
  border-radius: var(--radius);
  padding: 28px;
}
.simple-flow {
  max-width: none;
  width: 100%;
  gap: 16px;
}
button,
.button {
  min-width: 44px;
  border-radius: 10px;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
button:hover,
.button:hover {
  box-shadow: 0 2px 8px #16181d08;
}
a.button:hover {
  color: var(--ink);
}
.primary:hover {
  color: #16181d;
  border-color: #ff7c4c;
}
button:disabled {
  box-shadow: none;
}
input,
textarea,
select {
  border-radius: 10px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
}
.field {
  gap: 8px;
  line-height: 1.5;
}
.simple-text {
  min-height: 280px;
  line-height: 1.8;
  padding: 20px;
}
.step-nav {
  gap: 12px;
  margin-block: 24px 8px;
}
.step-nav a {
  padding: 18px 20px;
  min-height: 76px;
  line-height: 1.4;
  border-radius: 14px;
}
.step-nav a.active {
  padding: 17px 19px;
  background: color-mix(in srgb, var(--teal) 5%, var(--surface));
}
.step-nav a:hover {
  color: var(--ink);
  border-color: var(--teal);
}
.extra-tools {
  margin-block-end: 24px;
}
.extra-tools summary {
  padding-block: 8px;
  min-height: 44px;
}
.optional-panel {
  border-radius: 14px;
  padding-inline: 24px;
  box-shadow: var(--shadow);
}
.optional-panel summary,
.custom-time summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding-block: 12px;
  font-size: 0.95rem;
}
.optional-panel summary::after,
.custom-time summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  flex: none;
  color: var(--muted);
}
.optional-panel[open] > summary::after,
.custom-time[open] > summary::after {
  content: '−';
}
.optional-panel summary::-webkit-details-marker,
.custom-time summary::-webkit-details-marker {
  display: none;
}
.simple-estimate {
  background: color-mix(in srgb, var(--teal) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--teal) 20%, var(--line));
  padding: 16px 20px;
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
.big-action {
  min-height: 56px;
  padding-inline: 24px;
  font-size: 1rem;
}
.welcome-guide {
  position: relative;
  padding: 32px;
  border-radius: var(--radius);
  margin-block: 32px 40px;
  box-shadow: var(--shadow);
  border-block-start: 3px solid var(--teal);
}
.welcome-steps {
  gap: 24px;
  margin-block-end: 28px;
}
.welcome-steps li {
  gap: 12px;
  min-width: 0;
}
.welcome-steps li + li {
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 24px;
}
.welcome-steps h2 {
  font-size: 1rem;
  margin-block: 5px 6px;
  line-height: 1.4;
}
.welcome-steps p {
  font-size: 0.9rem;
  line-height: 1.6;
}
.welcome-guide .row {
  gap: 12px;
}
.welcome-guide .row > .button,
.welcome-guide .row > button {
  min-height: 56px;
}
.welcome-guide > .help {
  margin-block-start: 16px;
}
.saved-talks {
  gap: 12px;
}
.saved-talks > h2 {
  font-size: 1.6rem;
  margin-block-end: 4px;
}
.saved-talk {
  grid-template-columns: minmax(0, 1fr) 152px 56px;
  gap: 24px;
  padding: 24px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.saved-talk h3 {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}
.saved-talk > div > .row {
  gap: 12px;
  margin-block-end: 10px;
}
.saved-talk > .button {
  width: 100%;
  min-height: 48px;
}
.talk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.65;
}
.talk-meta span {
  white-space: nowrap;
}
.talk-meta strong {
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.talk-actions summary {
  justify-content: center;
  padding: 10px 8px;
  border-radius: 8px;
}
.talk-actions summary:hover {
  background: var(--soft);
}
.header-more summary {
  min-height: 44px;
}
.header-menu {
  padding: 12px;
  box-shadow: 0 12px 32px #0002;
}
.header-menu a {
  padding-inline: 12px;
  border-radius: 8px;
}
.header-menu a:hover {
  background: var(--soft);
}
.time-choices {
  gap: 12px;
}
.time-choice {
  min-height: 80px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.time-choice[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px var(--surface);
}
.comparison-row:last-child {
  border-block-end: 0;
  padding-block-end: 4px;
}
.reading-help {
  padding: 24px 28px;
  margin-block: 0 24px;
  border-radius: 14px;
}
.rehearsal-layout {
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 224px;
}
.rehearsal-side .panel {
  padding: 24px;
}
.rehearsal-side .clock {
  font-size: 3.5rem;
}
.teleprompter {
  border-radius: 16px;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.teleprompter h2 {
  font-size: 1.45rem;
  padding-inline: 14px;
  margin-block: 8px 16px;
}
.sentence {
  border-radius: 8px;
  line-height: 1.75;
}
.toolbar {
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 -8px 24px #16181d06;
}
.toolbar button {
  flex: 1;
  min-height: 56px;
}
#main > .toolbar {
  margin-block: 20px;
}
#main > .grid,
#main > .editor-layout {
  gap: 24px;
}
@media (max-width: 850px) {
  .rehearsal-layout {
    grid-template-columns: 1fr;
  }
  .rehearsal-side .panel {
    padding: 18px 24px;
  }
  .rehearsal-side .clock {
    font-size: 2.8rem;
  }
  .welcome-steps {
    gap: 16px;
  }
  .welcome-steps li + li {
    padding-inline-start: 16px;
  }
  .saved-talk {
    gap: 16px;
  }
}
@media (max-width: 600px) {
  #header,
  #main,
  #footer,
  .notice {
    width: calc(100% - 32px);
    margin-inline: auto;
  }
  #header {
    padding: 16px 0;
    gap: 8px;
    align-items: center;
    min-height: 76px;
  }
  .brand {
    font-size: 1.5rem;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 24px;
  }
  #header nav {
    gap: 8px;
    font-size: 0.75rem;
  }
  .header-more summary {
    font-size: 0.75rem;
  }
  .page-title {
    margin-block: 28px 20px;
    gap: 10px;
  }
  .page-title h1 {
    font-size: 2.1rem;
    line-height: 1.15;
  }
  .lede {
    font-size: 0.95rem;
  }
  .talk-context {
    margin-block: -8px 20px;
    font-size: 0.85rem;
  }
  .step-nav {
    gap: 8px;
    margin-block: 20px 8px;
  }
  .step-nav a {
    padding: 12px 10px;
    min-height: 96px;
    font-size: 0.78rem;
    gap: 8px;
  }
  .step-nav a.active {
    padding: 11px 9px;
  }
  .extra-tools {
    margin-block-end: 16px;
  }
  .panel,
  .simple-flow .panel {
    padding: 20px;
  }
  .simple-text {
    padding: 14px;
    font-size: 1rem;
    min-height: 240px;
  }
  .step-instruction {
    font-size: 1.05rem;
  }
  .optional-panel {
    padding-inline: 18px;
  }
  .optional-panel summary,
  .custom-time summary {
    font-size: 0.9rem;
  }
  .simple-estimate {
    padding: 14px 16px;
    font-size: 1rem;
  }
  .welcome-guide {
    padding: 24px 20px;
    margin-block: 24px 32px;
  }
  .welcome-steps {
    gap: 20px;
    margin-block-end: 24px;
  }
  .welcome-steps li + li {
    border-inline-start: 0;
    padding-inline-start: 0;
  }
  .welcome-guide .row {
    gap: 10px;
  }
  .saved-talk {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 16px;
    padding: 20px;
  }
  .saved-talk > div {
    grid-column: 1/-1;
  }
  .saved-talk > .button {
    width: auto;
    justify-self: start;
    padding-inline: 20px;
  }
  .talk-meta {
    gap: 4px 14px;
  }
  .time-choice {
    min-height: 68px;
  }
  .reading-help {
    padding: 20px;
    margin-block-end: 16px;
  }
  .rehearsal-layout {
    gap: 16px;
  }
  .teleprompter {
    padding: 12px 8px;
  }
  .toolbar {
    margin-inline: 0;
    border-radius: 14px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
  }
  .toolbar button {
    padding-inline: 8px;
    font-size: 0.85rem;
    min-height: 52px;
  }
  .toolbar .primary {
    min-width: 0;
  }
  .rehearsal-side .panel {
    padding: 16px;
  }
}
/* Меню выравнивается с соседней ссылкой по центру, включая узкие экраны. */
.header-more summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  line-height: 1.4;
}
.header-more summary::after {
  content: '⌄';
  font-size: 1rem;
  line-height: 1;
}
.header-more[open] summary::after {
  content: '⌃';
}
.header-more summary::-webkit-details-marker {
  display: none;
}
@media (max-width: 360px) {
  #header {
    gap: 4px;
  }
  .brand {
    font-size: 1.35rem;
  }
  #header nav {
    gap: 6px;
  }
  .header-more summary {
    font-size: 0.7rem;
  }
  #header nav > a {
    font-size: 0.7rem;
  }
}
.menu-label-small {
  display: none;
}
@media (max-width: 600px) {
  .menu-label-wide {
    display: none;
  }
  .menu-label-small {
    display: inline;
  }
  #header nav {
    gap: 16px;
    font-size: 0.85rem;
  }
  .header-more summary {
    font-size: 0.85rem;
  }
  #header nav > a {
    font-size: 0.85rem;
  }
}

/* Режим чтения: панель действий занимает свою строку и не перекрывает текст. */
.badge {
  white-space: nowrap;
  flex-shrink: 0;
}
.time-dashboard {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.time-dashboard > .eyebrow {
  margin-block-end: 16px;
}
.time-dashboard .meter {
  height: 16px;
  border-radius: 5px;
}
.time-dashboard .hero-time {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}
.version-comparison h2 {
  font-size: 1.6rem;
}
.version-comparison .comparison-row {
  margin: 0;
}
.rehearsal-page .page-title {
  margin-block: 24px 12px;
}
.rehearsal-page .page-title h1 {
  font-size: 1.8rem;
}
.rehearsal-page .talk-context {
  margin-block: 0 16px;
}
.rehearsal-page .step-nav,
.rehearsal-page .extra-tools {
  display: none;
}
.rehearsal-page .reading-help {
  padding: 16px 24px;
  margin-block: 0 16px;
}
/* Область чтения: сетка удерживает текст, таймер и действия в пределах доступного экрана. */
.reading-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
  position: relative;
}
.reading-stage .rehearsal-layout {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.reading-stage .teleprompter {
  height: clamp(240px, calc(100dvh - 380px), 540px);
  min-height: 0;
}
.reading-stage .toolbar {
  position: static;
  margin: 0;
  box-shadow: none;
}
.reading-controls {
  margin: 0;
}
/* При старте репетиции убираем лишнюю вводную часть, освобождая экран для чтения. */
.reading-active #header {
  min-height: 64px;
  padding-block: 10px;
}
.reading-active #main {
  padding-block: 12px 16px;
}
.reading-active #main > *:not(.reading-stage) {
  display: none;
}
.reading-active #footer {
  display: none;
}
.reading-active .reading-stage {
  height: calc(100dvh - 92px - env(safe-area-inset-bottom));
}
.reading-active .teleprompter {
  height: 100%;
}
.reading-active .reading-controls[open] {
  /* Настройки занимают собственную строку сетки, а не накрывают «Паузу».
     Длинное содержимое прокручивается внутри; кнопки остаются снаружи. */
  max-height: min(36dvh, 320px);
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.reading-stage .rehearsal-side .panel {
  border-block-start: 3px solid var(--teal);
}
@media (max-width: 850px) {
  .reading-stage .rehearsal-layout {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }
  .reading-stage .rehearsal-side {
    min-height: 0;
  }
  .reading-stage .rehearsal-side .panel {
    padding: 10px 16px;
    gap: 8px 16px;
  }
  .reading-stage .rehearsal-side .eyebrow {
    font-size: 0.65rem;
  }
  .reading-stage .rehearsal-side .clock {
    font-size: 2.2rem;
  }
  .reading-stage .rehearsal-side .help {
    font-size: 0.75rem;
  }
}
@media (max-width: 600px) {
  .step-nav a {
    min-height: 72px;
    flex-direction: row;
    align-items: center;
    padding: 10px 8px;
    font-size: 0.72rem;
    gap: 6px;
  }
  .step-nav a.active {
    padding: 9px 7px;
  }
  .step-nav .step-circle {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
  .step-nav {
    gap: 6px;
  }
  .time-dashboard {
    padding: 16px;
  }
  .time-dashboard .budget .row {
    gap: 6px 12px;
  }
  .reading-stage .toolbar {
    padding: 8px;
  }
  .reading-stage .toolbar button {
    min-height: 48px;
    font-size: 0.8rem;
  }
  .reading-stage .reading-controls summary {
    min-height: 44px;
    font-size: 0.8rem;
  }
  .rehearsal-page .reading-help p + p {
    display: none;
  }
  .rehearsal-page .reading-help {
    padding: 12px 16px;
  }
  .rehearsal-page .reading-help .step-instruction {
    font-size: 0.9rem;
  }
  .rehearsal-page .reading-stage .teleprompter {
    height: clamp(240px, calc(100dvh - 390px), 500px);
  }
  .reading-active.rehearsal-page .reading-stage .teleprompter {
    height: 100%;
  }
}

/* Время как жидкость. Плотность стекла сохраняет читаемость над любым пятном. */
:root {
  --glass: rgba(255, 253, 248, 0.96);
  --lava-a: #0f766e;
  --lava-b: #ff5a1f;
  --lava-c: #ffd16b;
  --lava-speed: 38s;
  --lava-opacity: 0.22;
  --glass-edge: rgba(255, 255, 255, 0.7);
}
:root[data-theme='dark'] {
  --glass: rgba(24, 29, 36, 0.96);
  --lava-opacity: 0.34;
  --glass-edge: rgba(255, 255, 255, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    --glass: rgba(24, 29, 36, 0.96);
    --lava-opacity: 0.34;
    --glass-edge: rgba(255, 255, 255, 0.12);
  }
}
:root[data-time-mood='tight'] {
  --lava-a: #ff5a1f;
  --lava-b: #f3a746;
  --lava-speed: 28s;
}
:root[data-time-mood='over'] {
  --lava-a: #e64720;
  --lava-b: #dc492f;
  --lava-c: #ff9259;
  --lava-speed: 19s;
}
body {
  isolation: isolate;
}
/* Фон прикреплён к viewport через fixed: при обычной прокрутке он остаётся за карточками. */
.lava-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 40%,
    transparent 35%,
    #00000006 100%
  );
}
/* Отдельная капля: форма, размытие и анимация создают движение без изображений и сетевых запросов. */
.lava-drop {
  position: absolute;
  display: block;
  width: 46vw;
  height: 46vw;
  max-width: 650px;
  max-height: 650px;
  min-width: 280px;
  min-height: 280px;
  border-radius: 45% 55% 58% 42%;
  filter: blur(60px);
  opacity: var(--lava-opacity);
  mix-blend-mode: multiply;
  animation: lava-float var(--lava-speed) ease-in-out infinite alternate;
  will-change: transform;
  background: var(--lava-a);
}
.lava-drop-1 {
  inset-inline-start: -16%;
  inset-block-start: 10%;
}
.lava-drop-2 {
  inset-inline-end: -12%;
  inset-block-start: -15%;
  background: var(--lava-b);
  animation-delay: -11s;
}
.lava-drop-3 {
  inset-inline-start: 35%;
  inset-block-end: -30%;
  background: var(--lava-c);
  animation-delay: -23s;
}
.lava-drop-4 {
  inset-inline-end: 0;
  inset-block-start: 52%;
  width: 30vw;
  height: 30vw;
  background: var(--lava-a);
  animation-delay: -17s;
}
.lava-drop-5 {
  inset-inline-start: 18%;
  inset-block-start: -30%;
  width: 25vw;
  height: 25vw;
  background: var(--lava-b);
  animation-delay: -6s;
}
:root[data-theme='dark'] .lava-drop {
  mix-blend-mode: screen;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] .lava-drop {
    mix-blend-mode: screen;
  }
}
@keyframes lava-float {
  from {
    transform: translate3d(-5%, 8%, 0) rotate(-12deg) scale(0.88);
  }
  to {
    transform: translate3d(12%, -22%, 0) rotate(24deg) scale(1.12);
    border-radius: 60% 40% 45% 55%;
  }
}
.panel,
.welcome-guide,
.saved-talk,
.optional-panel,
.step-nav a,
.reading-help,
.toolbar,
.time-dashboard {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 var(--glass-edge),
    0 12px 36px #16181d06;
}
.teleprompter,
.header-menu {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.liquid-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  align-items: center;
  gap: 48px;
  padding-block: 40px 28px;
}
.liquid-hero .page-title {
  margin: 0;
  gap: 20px;
}
.liquid-hero h1 {
  font-size: clamp(2.8rem, 5.2vw, 4.5rem);
  line-height: 1.04;
  text-wrap: balance;
}
.watch-display {
  display: grid;
  place-items: center;
  gap: 24px;
  padding: 24px 0;
  perspective: 900px;
}
/* Декоративный секундомер: объём собирается тенями и transform; реальный таймер репетиции отдельный. */
.stopwatch {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  padding: 14px;
  background: linear-gradient(135deg, #fcf9f1, #bcb7ab);
  box-shadow:
    0 12px 0 #a39c8e,
    0 24px 0 -7px #837c70,
    0 32px 48px #0002;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) rotate(-8deg);
  transition: transform 0.25s ease;
}
.stopwatch::before {
  content: '';
  position: absolute;
  width: 38px;
  height: 24px;
  inset-block-start: -24px;
  inset-inline-start: calc(50% - 19px);
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(#ff8551, #ff5a1f);
  box-shadow: 0 5px 0 #b83e12;
}
.stopwatch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 28px;
  inset-inline-end: 14px;
  inset-block-start: -5px;
  border-radius: 5px;
  background: #9a9488;
  transform: rotate(35deg);
}
.watch-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid #cbc7bd;
  background: radial-gradient(circle at 40% 35%, #fffdf8, #e9e5db);
  box-shadow: inset 0 3px 14px #0002;
  color: #16181d;
}
.watch-face::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  inset: calc(50% - 8px);
  border-radius: 50%;
  background: #16181d;
  border: 4px solid #ff5a1f;
  box-shadow: 0 2px 4px #0003;
}
.watch-tick {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: calc(50% - 1px);
  width: 2px;
  height: 8px;
  background: #62615d;
  transform-origin: 1px 95px;
  transform: rotate(calc(var(--tick) * 30deg));
}
.watch-number {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.watch-top {
  top: 28px;
  left: calc(50% - 8px);
}
.watch-bottom {
  bottom: 28px;
  left: calc(50% - 8px);
}
.watch-left {
  left: 28px;
  top: calc(50% - 9px);
}
.watch-right {
  right: 28px;
  top: calc(50% - 9px);
}
.watch-hand {
  position: absolute;
  width: 3px;
  height: 70px;
  inset-inline-start: calc(50% - 1.5px);
  inset-block-start: calc(50% - 70px);
  border-radius: 3px;
  background: #ff5a1f;
  transform-origin: center bottom;
  animation: watch-seconds 60s linear infinite;
  box-shadow: 2px 2px 3px #0002;
}
@keyframes watch-seconds {
  to {
    transform: rotate(360deg);
  }
}
.home-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 20px;
  margin-block: 20px 40px;
}
.home-bento .welcome-guide {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}
.home-bento .welcome-steps {
  grid-template-columns: 1fr;
  gap: 24px;
}
.home-bento .welcome-steps li + li {
  border: 0;
  padding: 0;
}
.home-bento .welcome-guide > .row {
  margin-block-start: 4px;
}
.home-bento .welcome-guide .primary {
  width: 100%;
}
.bento-side {
  display: grid;
  gap: 20px;
}
.bento-tile {
  display: grid;
  gap: 12px;
  align-content: start;
}
.bento-tile > * + * {
  margin: 0;
}
.bento-tile h2 {
  font-size: 1.5rem;
}
.bento-tile > .button,
.bento-tile > button {
  margin-block-start: 4px;
  justify-self: start;
  text-align: start;
}
.primary {
  box-shadow:
    inset 0 1px 0 #ffffff66,
    0 4px 0 #bc3a0d,
    0 8px 16px #e44e1520;
  transform: translateY(-2px);
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    background-color 0.16s;
}
.primary:hover {
  box-shadow:
    inset 0 1px 0 #ffffff88,
    0 4px 0 #bc3a0d,
    0 10px 20px #e44e1528;
}
.primary:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 #ffffff44,
    0 0 0 #bc3a0d;
}
.primary:disabled {
  transform: none;
  box-shadow: none;
}
.time-dashboard .meter {
  height: 22px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px #0001;
}
.time-dashboard .meter > span {
  position: relative;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #51b9a2);
  transition: width 0.4s ease;
  box-shadow: inset 0 2px 0 #ffffff44;
}
.time-dashboard .over .meter > span {
  background: linear-gradient(90deg, #ff5a1f, #f6a852);
}
.time-dashboard .meter > span::after {
  content: '';
  position: absolute;
  inset-inline-end: -6px;
  inset-block-start: -25%;
  height: 150%;
  width: 22px;
  border-radius: 45%;
  background: #ffffff44;
  animation: liquid-edge 6s ease-in-out infinite alternate;
}
@keyframes liquid-edge {
  to {
    transform: rotate(25deg) translateY(3px);
  }
}
.chart-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #51b9a2);
}
.heat-1 {
  background: color-mix(in srgb, var(--surface) 95%, #f5a64f);
}
.heat-2 {
  background: color-mix(in srgb, var(--surface) 91%, #ef7144);
}
.heat-3 {
  background: color-mix(in srgb, var(--surface) 87%, #dc492f);
}
.section-choice {
  border-radius: 10px;
  transition:
    opacity 0.2s,
    transform 0.2s;
  padding-inline: 10px;
}
.section-choice:has(input:not(:checked)) {
  opacity: 0.65;
  transform: scale(0.98);
  background: var(--soft);
}
.rehearsal-page .lava-background {
  opacity: 0.3;
}
.rehearsal-page .lava-drop {
  animation-duration: 65s;
}
.reading-active .teleprompter {
  background: var(--surface);
  backdrop-filter: none;
}
.sentence.current {
  box-shadow: inset 0 0 28px #ff5a1f08;
}
.tab-hidden .lava-drop,
.tab-hidden .watch-hand,
.tab-hidden .meter > span::after {
  animation-play-state: paused;
}
@media (max-width: 700px) {
  .liquid-hero {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 16px;
    padding-block: 32px 16px;
  }
  .liquid-hero h1 {
    font-size: 2.5rem;
  }
  .stopwatch {
    width: 140px;
    height: 140px;
    padding: 9px;
    box-shadow:
      0 8px 0 #a39c8e,
      0 16px 0 -5px #837c70,
      0 24px 30px #0002;
  }
  .watch-tick {
    transform-origin: 1px 50px;
    height: 5px;
  }
  .watch-top {
    top: 18px;
  }
  .watch-bottom {
    bottom: 18px;
  }
  .watch-left {
    left: 18px;
  }
  .watch-right {
    right: 18px;
  }
  .watch-number {
    font-size: 0.6rem;
  }
  .watch-hand {
    height: 40px;
    inset-block-start: calc(50% - 40px);
  }
  .watch-display > .help {
    display: none;
  }
  .home-bento {
    grid-template-columns: 1fr;
  }
  .bento-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .bento-tile {
    padding: 20px;
  }
  .bento-tile h2 {
    font-size: 1.2rem;
  }
  .bento-tile .button,
  .bento-tile button {
    font-size: 0.8rem;
  }
  .lava-drop {
    filter: blur(40px);
    animation-duration: 48s;
  }
  .lava-drop-4,
  .lava-drop-5 {
    display: none;
  }
}
@media (max-width: 450px) {
  .liquid-hero {
    grid-template-columns: 1fr;
    position: relative;
  }
  .liquid-hero .page-title {
    padding-inline-end: 0;
  }
  .liquid-hero h1 {
    font-size: 2.7rem;
  }
  .watch-display {
    display: none;
  }
  .home-bento .welcome-guide {
    padding: 24px 20px;
  }
  .bento-side {
    grid-template-columns: 1fr;
  }
  .bento-tile {
    gap: 10px;
  }
  .bento-tile h2 {
    font-size: 1.4rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stopwatch {
    transform: none !important;
  }
  .lava-drop,
  .watch-hand,
  .meter > span::after {
    animation: none !important;
  }
  .primary {
    transform: none;
  }
  .section-choice {
    transition: none;
  }
}
.reduce-motion .stopwatch {
  transform: none !important;
}
.reduce-motion .lava-drop,
.reduce-motion .watch-hand,
.reduce-motion .meter > span::after {
  animation: none !important;
}
.reduce-motion .primary {
  transform: none;
}
/* Главное действие остаётся сверху bento-карточки, перед объяснением шагов. */
.home-bento .welcome-guide > .row {
  order: -1;
  margin-block: 0 28px;
}
.stopwatch::after {
  inset-inline-end: 0;
  inset-block-start: 30px;
}
@media print {
  .lava-background,
  .watch-display {
    display: none !important;
  }
}
.lava-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('./grain.svg');
  opacity: 0.12;
  pointer-events: none;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .bento-tile {
    transition: transform 0.25s;
  }
  .bento-tile:hover {
    transform: perspective(1000px) rotateX(1deg) translateY(-2px);
  }
}
.reduce-motion .bento-tile:hover {
  transform: none;
}

/* Капли проходят заметный путь по высоте окна, а не дрожат внутри размытия. */
:root {
  --lava-speed: 24s;
}
:root[data-time-mood='tight'] {
  --lava-speed: 18s;
}
:root[data-time-mood='over'] {
  --lava-speed: 13s;
}
.lava-drop {
  width: 34vw;
  height: 42vw;
  min-width: 270px;
  min-height: 330px;
  max-width: 480px;
  max-height: 560px;
  filter: blur(28px);
  border-radius: 46% 54% 62% 38%;
  animation-name: lava-rise;
}
.lava-drop-1 {
  inset-inline-start: -14%;
  inset-block-start: 30%;
}
.lava-drop-2 {
  inset-inline-end: -12%;
  inset-block-start: 35%;
  animation-direction: alternate-reverse;
  animation-delay: -9s;
}
.lava-drop-3 {
  inset-inline-start: 32%;
  inset-block-end: -22%;
  animation-delay: -16s;
}
.lava-drop-4 {
  inset-inline-end: 5%;
  inset-block-start: 38%;
  animation-delay: -5s;
}
.lava-drop-5 {
  inset-inline-start: 10%;
  inset-block-start: 5%;
  animation-direction: alternate-reverse;
  animation-delay: -19s;
}
@keyframes lava-rise {
  0% {
    transform: translate3d(-4vw, 24vh, 0) rotate(-18deg) scale(0.85);
    border-radius: 42% 58% 64% 36%;
  }
  50% {
    transform: translate3d(5vw, -6vh, 0) rotate(15deg) scale(1.06);
    border-radius: 60% 40% 36% 64%;
  }
  100% {
    transform: translate3d(-2vw, -42vh, 0) rotate(38deg) scale(0.9);
    border-radius: 35% 65% 56% 44%;
  }
}
.rehearsal-page .lava-drop {
  animation-name: lava-float;
  animation-duration: 65s;
  filter: blur(60px);
}
@media (max-width: 700px) {
  .lava-drop {
    width: 65vw;
    height: 80vw;
    min-width: 220px;
    min-height: 270px;
    filter: blur(24px);
    animation-duration: 30s;
  }
  .rehearsal-page .lava-drop {
    animation-duration: 65s;
    filter: blur(40px);
  }
}

/* Чистые цвета: холодная сторона слева, тёплая справа, без оливкового центра. */
:root {
  --glass: rgba(255, 253, 248, 0.76);
  --muted: #444844;
  --lava-a: #24b8ad;
  --lava-b: #ff743e;
  --lava-c: #65cbd3;
  --lava-opacity: 0.26;
}
:root[data-theme='dark'] {
  --glass: rgba(24, 29, 36, 0.76);
  --muted: #d0d3d7;
  --lava-a: #00d8cd;
  --lava-b: #ff542a;
  --lava-c: #4388ff;
  --lava-opacity: 0.3;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    --glass: rgba(24, 29, 36, 0.76);
    --muted: #d0d3d7;
    --lava-a: #00d8cd;
    --lava-b: #ff542a;
    --lava-c: #4388ff;
    --lava-opacity: 0.3;
  }
}
:root[data-time-mood='tight'] {
  --lava-a: #24b8ad;
  --lava-b: #ff743e;
  --lava-c: #ff9968;
}
:root[data-time-mood='over'] {
  --lava-a: #fb4164;
  --lava-b: #ff542a;
  --lava-c: #ff6688;
}
.lava-drop-1 {
  inset-inline-start: -18%;
  inset-block-start: 25%;
  background: var(--lava-a);
}
.lava-drop-2 {
  inset-inline-end: -20%;
  background: var(--lava-b);
}
.lava-drop-3 {
  inset-inline-start: -12%;
  inset-block-end: -28%;
  background: var(--lava-c);
}
.lava-drop-4 {
  inset-inline-end: -15%;
  background: var(--lava-b);
}
.lava-drop-5 {
  inset-inline-start: -16%;
  background: var(--lava-a);
}
.rehearsal-side {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
}
.rehearsal-plan {
  overflow: auto;
  min-height: 0;
}
.rehearsal-plan h2 {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 650;
}
.rehearsal-plan .checkpoint:first-child {
  padding-block-start: 0;
}
.rehearsal-plan .meter {
  margin-block: 8px 4px;
}
/* Сетка частей доклада. Перспектива и слои теней создают стопку, приоритет остаётся подписан текстом. */
.preview-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 24px;
  padding-block: 8px 16px;
  perspective: 1000px;
}
.preview-tile,
.part-stack .section-choice,
.block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  box-shadow:
    0 5px 0 -1px var(--surface),
    0 6px 0 -1px var(--line),
    0 11px 0 -3px var(--surface),
    0 12px 0 -3px var(--line),
    0 20px 28px #0000000a;
}
.preview-tile {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  min-width: 0;
  transform: perspective(900px) rotateX(3deg);
}
.preview-tile .badge {
  justify-self: start;
  font-size: 0.7rem;
}
.parts-preview h2 {
  font-size: 1.5rem;
}
.part-stack .section-choice {
  margin-block: 18px 26px;
  padding: 18px;
  transform: perspective(900px) translateZ(0);
}
.part-stack .section-choice:has(input:not(:checked)) {
  opacity: 0.7;
  transform: perspective(900px) translateZ(-45px) rotateX(5deg);
  box-shadow: 0 2px 0 var(--line);
  background: var(--soft);
}
@media (max-width: 850px) {
  .reading-stage .rehearsal-side .rehearsal-plan {
    display: none;
  }
  .rehearsal-side {
    grid-template-rows: auto;
  }
  .lava-drop-1,
  .lava-drop-3,
  .lava-drop-5 {
    inset-inline-start: -35%;
  }
  .lava-drop-2 {
    inset-inline-end: -35%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .preview-tile,
  .part-stack .section-choice {
    transform: none !important;
  }
}
.reduce-motion .preview-tile,
.reduce-motion .part-stack .section-choice {
  transform: none !important;
}
/* Важность доступна прямо в простом редакторе, до перехода к версиям. */
.simple-flow .panel .parts-preview {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.parts-preview .preview-deck {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
/* Большие кнопки важности доступны в простом редакторе; выбор отражается также через aria-pressed. */
.priority-choices {
  display: grid;
  gap: 6px;
  margin-block-start: 4px;
}
.priority-choices button {
  justify-content: flex-start;
  text-align: start;
  font-size: 0.8rem;
  min-height: 44px;
  padding: 8px 10px;
}
.priority-choices button::before {
  content: '';
  width: 16px;
  flex: none;
}
.priority-choices button[aria-pressed='true'] {
  border-color: var(--teal);
  background: var(--soft);
}
.priority-choices button[aria-pressed='true']::before {
  content: '✓';
  color: var(--teal);
}
/* Светлая кромка и насыщение подложки делают матовое стекло заметнее. */
.panel,
.welcome-guide,
.saved-talk,
.optional-panel,
.step-nav a,
.reading-help,
.toolbar,
.time-dashboard {
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  background-image: linear-gradient(125deg, #ffffff10, transparent 48%);
  border-block-start-color: color-mix(in srgb, var(--line) 60%, #fff);
}
.reading-active .teleprompter {
  backdrop-filter: none;
  background-image: none;
}

/* Последние 10% бюджета — предупреждение, даже пока лимит не превышен. */
:root {
  --warning-ink: #835400;
}
:root[data-theme='dark'] {
  --warning-ink: #ffd184;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme='system'] {
    --warning-ink: #ffd184;
  }
}
.tight .meter > span {
  background: #e8ab36;
}
.time-dashboard .tight .meter > span {
  background: linear-gradient(90deg, #d99420, #f4c361);
}
.tight .budget-label {
  color: var(--warning-ink);
}
