/* Пинок — отрывной календарь: серая газетная бумага, типографская краска,
   календарный красный для выходных и пропусков, синие чернила печати для сделанного. */

@font-face {
  font-family: 'Alumni Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/alumni-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Alumni Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/alumni-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Alumni Sans';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/alumni-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/golos-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/golos-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/golos-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ——— Токены ——— */

:root {
  color-scheme: light;
  --paper: #EFF1EC;
  --sheet: #FFFFFF;
  --ink: #1C2230;
  --ink-2: #4A5060;
  --muted: #737985;
  --rule: #D5D8D0;
  --field: #F6F7F3;
  --red: #CC2A1F;
  --red-soft: #F6DCD9;
  --stamp: #3A3FB3;
  --stamp-soft: #C8CAF0;
  --on-accent: #FFFFFF;
  --scrim: rgb(28 34 48 / 0.45);
  --stamp-blend: multiply;

  --font-display: 'Alumni Sans', 'Arial Narrow', sans-serif;
  --font-ui: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #15171C;
    --sheet: #1F222A;
    --ink: #ECEDE8;
    --ink-2: #BCC0C9;
    --muted: #8F949F;
    --rule: #333844;
    --field: #262A33;
    --red: #FF6457;
    --red-soft: #4A2522;
    --stamp: #A3A7FF;
    --stamp-soft: #3A3D78;
    --on-accent: #15171C;
    --scrim: rgb(0 0 0 / 0.6);
    --stamp-blend: normal;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15171C;
  --sheet: #1F222A;
  --ink: #ECEDE8;
  --ink-2: #BCC0C9;
  --muted: #8F949F;
  --rule: #333844;
  --field: #262A33;
  --red: #FF6457;
  --red-soft: #4A2522;
  --stamp: #A3A7FF;
  --stamp-soft: #3A3D78;
  --on-accent: #15171C;
  --scrim: rgb(0 0 0 / 0.6);
  --stamp-blend: normal;
}

/* ——— Основа ——— */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.has-modal { overflow: hidden; }

h1, h2, h3, p, ul, ol, dl, dd, blockquote, fieldset { margin: 0; }
ul, ol { padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) calc(env(safe-area-inset-bottom) + 96px);
}

/* ——— Лист календаря ——— */

.sheet {
  position: relative;
  margin-bottom: 36px;
  padding: 30px 20px 22px;
  background: var(--sheet);
  border-radius: 4px 4px 3px 3px;
  box-shadow: 0 0 0 1px var(--rule);
}

/* Под листом — ещё два листа блока. Отрицательный z-index прячет их
   за фон .sheet: у .sheet нет собственного контекста наложения. */
.sheet::before,
.sheet::after {
  content: '';
  position: absolute;
  z-index: -1;
  height: 24px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 0 0 4px 4px;
}
.sheet::after { left: 5px; right: 5px; bottom: -6px; }
.sheet::before { left: 11px; right: 11px; bottom: -12px; }

/* Перфорация, по которой лист отрывают. */
.sheet__holes {
  position: absolute;
  top: 10px;
  left: 18px;
  right: 18px;
  height: 8px;
  background: radial-gradient(circle at 4px 4px, var(--paper) 2.6px, transparent 3.2px) 0 0 / 16px 8px space no-repeat;
}

.sheet__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}

.sheet__num {
  margin: 6px 0 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(132px, 42vw, 188px);
  line-height: 0.8;
  letter-spacing: -0.03em;
  text-align: center;
  font-variant-numeric: lining-nums;
}

.sheet--red .sheet__num,
.sheet--red .sheet__head { color: var(--red); }

.sheet__streak {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
  font-size: 14px;
  color: var(--ink-2);
}

.sheet__streak b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  margin: 0 2px;
}

.sheet__cut {
  margin: 18px -20px 22px;
  border-top: 1.5px dashed var(--rule);
}

/* Неделя под датой */

.week {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.week__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.week__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  color: var(--on-accent);
}

.week__day.is-done .week__mark { background: var(--stamp); border-color: var(--stamp); }
.week__day.is-missed .week__mark { border-color: var(--red); color: var(--red); }
.week__day.is-rest .week__mark { border-style: dashed; }
.week__day:last-child .week__name { color: var(--red); }
.week__day.is-today .week__name { font-weight: 600; }
.week__day.is-today:not(:last-child) .week__name { color: var(--ink); }
.week__day.is-today:not(.is-done):not(.is-missed) .week__mark { border-color: var(--ink); border-width: 2px; }

/* Печать */

.stamp {
  position: absolute;
  top: 70px;
  right: 14px;
  padding: 7px 14px 6px;
  color: var(--stamp);
  border: 3px solid currentColor;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 4px currentColor;
  text-align: center;
  transform: rotate(-9deg);
  mix-blend-mode: var(--stamp-blend);
  opacity: 0.9;
  pointer-events: none;
}

.stamp--miss { color: var(--red); }

.stamp__main {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  line-height: 0.95;
}

.stamp__sub {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.stamp--in { animation: stamp-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }

@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-9deg) scale(1.8); }
  to { opacity: 0.9; transform: rotate(-9deg) scale(1); }
}

/* ——— Содержимое листа ——— */

.question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 0.98;
  margin-bottom: 18px;
}

.label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.label--red { color: var(--red); }

.task-text {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
}

.task-text--small { font-size: 24px; margin-bottom: 16px; }
.task-text--struck { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-2); }

.lead { color: var(--ink-2); margin-bottom: 16px; max-width: 60ch; }
.hint { font-size: 14px; color: var(--muted); max-width: 60ch; }
.muted { font-size: 13px; color: var(--muted); }
.empty { color: var(--ink-2); margin-bottom: 14px; }

.alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
}

.choices { display: grid; gap: 10px; }

.choice {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  background: var(--field);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}

.choice:hover { border-color: var(--ink); }
.choice__title { font-weight: 600; }
.choice__desc { font-size: 14px; color: var(--muted); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-2);
}

.tag--market { border-color: var(--stamp); color: var(--stamp); }

.figures {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 8px 12px;
  margin: 4px 0 16px;
}

.figures dt { font-size: 12px; color: var(--muted); }

.figures dd {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.figures .rub { font-family: var(--font-ui); font-size: 0.62em; font-weight: 600; margin-left: 2px; }

.insight {
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 3px solid var(--stamp);
  color: var(--ink-2);
}

.insight--miss { border-left-color: var(--red); }

/* ——— Кнопки ——— */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.btn--danger { border-color: var(--red); color: var(--red); }
.btn--small { width: auto; min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }

.btn--file { position: relative; overflow: hidden; }
.btn--file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn--file:focus-within { outline: 3px solid var(--stamp); outline-offset: 2px; }

.linkbtn {
  justify-self: center;
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover { background: var(--field); }

.stack { display: grid; gap: 10px; }
.stack > .section__title,
.stack > .lead { margin-bottom: 0; }
.settings { display: grid; gap: 32px; }
.stack-lg { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ——— Формы ——— */

.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; color: var(--ink-2); }

input[type="text"],
input[type="number"],
input[type="time"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  background: var(--field);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.4;
}

textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--stamp-soft);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chips-field { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }

/* Дни недели и сроки — ровная сетка в одну строку на любом телефоне. */
.chips--days,
.chips--row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.chips--days .chip span,
.chips--row .chip span { justify-content: center; width: 100%; padding: 6px 0; }

.chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span,
.chip-btn {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--sheet);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-btn { cursor: pointer; }
.chip input:checked + span,
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.chip input:focus-visible + span { outline: 3px solid var(--stamp); outline-offset: 2px; }

.cat-scroll {
  display: flex;
  gap: 8px;
  margin: 0 calc(var(--gutter) * -1) 16px;
  padding: 2px var(--gutter) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sheet .cat-scroll { margin: 4px -20px 18px; padding: 2px 20px 4px; }
.cat-scroll::-webkit-scrollbar { display: none; }

.radio-list { display: grid; gap: 8px; }

.radio-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
}

.radio-row:has(input:checked) { border-color: var(--ink); }
.radio-row input { margin-top: 4px; accent-color: var(--red); }

.check-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.check-inline input { width: 20px; height: 20px; accent-color: var(--red); }

/* ——— Разделы под листом и на других экранах ——— */

.page-head { margin: 4px 0 22px; }

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 60px;
  line-height: 0.85;
  margin-bottom: 10px;
}

.page-sub { color: var(--ink-2); margin-bottom: 14px; }

.section { margin-top: 36px; }

.section__title {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}

.focus {
  margin-bottom: 8px;
  padding: 14px 16px;
  border: 1.5px dashed var(--stamp);
  border-radius: var(--radius);
}

.focus__label { font-size: 13px; font-weight: 600; color: var(--stamp); }
.focus__text { font-weight: 500; }

.notice {
  margin-top: 28px;
  padding: 18px 16px;
  background: var(--sheet);
  border-top: 4px solid var(--red);
  border-radius: 0 0 var(--radius) var(--radius);
}

.notice p { margin-bottom: 14px; color: var(--ink-2); }

.checklist { list-style: none; display: grid; gap: 8px; }

.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 12px 14px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}

.check-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ink-2);
  border-radius: 4px;
  color: transparent;
}

.check-row[aria-pressed="true"] .check-box { background: var(--stamp); border-color: var(--stamp); color: var(--on-accent); }
.check-row[aria-pressed="true"] .check-row__title { text-decoration: line-through; color: var(--muted); }
.check-row__text { display: grid; gap: 2px; }
.check-row__title { font-weight: 500; }
.check-row__meta { font-size: 13px; color: var(--muted); }

.hyp-mini { list-style: none; display: grid; gap: 14px; }

.hyp-mini__link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  text-decoration: none;
}

.hyp-mini__idea { font-weight: 500; }

.left { flex: none; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.left.is-urgent { color: var(--red); font-weight: 600; }

.bar {
  height: 6px;
  background: var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.bar span { display: block; height: 100%; background: var(--ink); }
.bar--urgent span { background: var(--red); }

/* Карточка гипотезы — как каталожная карточка: красная линия сверху. */
.hyp {
  display: grid;
  gap: 14px;
  padding: 18px 16px 16px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
}

.hyp__idea {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
}

.hyp__deadline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: -6px;
}

.hyp .btn--small { justify-self: start; }

.facts { display: grid; gap: 8px; }
.facts dt { font-size: 13px; color: var(--muted); }

.plain-list { list-style: none; display: grid; }
.plain-list > li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.plain-list > li:first-child { padding-top: 0; }

.routine {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.routine__title { font-weight: 500; }
.routine__meta { font-size: 14px; color: var(--muted); }

.archive { display: grid; gap: 4px; }
.archive__idea { font-weight: 500; }
.archive__text { color: var(--ink-2); }

.outcome { justify-self: start; font-size: 13px; font-weight: 600; }
.outcome--success { color: var(--stamp); }
.outcome--failed { color: var(--red); }

/* Задания */

.task { display: grid; gap: 8px; }
.task .tags { margin-bottom: 0; }
.task__text { font-weight: 500; }

.tasks-note { margin-bottom: 16px; }

.task__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.add-task {
  margin-bottom: 20px;
  border: 1.5px dashed var(--rule);
  border-radius: var(--radius);
}

.add-task summary {
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
}

.add-task form { padding: 0 14px 14px; }

/* Итоги */

.score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.score > div { padding: 14px 16px 12px; background: var(--sheet); }

.score b {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 56px;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.score span { font-size: 13px; color: var(--ink-2); }

.heat {
  display: grid;
  grid-template-columns: 24px repeat(12, 1fr);
  gap: 4px;
  align-items: center;
}

.heat__label { font-size: 11px; color: var(--muted); }

.heat__cell {
  display: block;
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

.heat__cell.is-market { background: var(--stamp); border-color: var(--stamp); }
.heat__cell.is-prep { background: var(--stamp-soft); border-color: var(--stamp-soft); }
.heat__cell.is-missed { background: var(--red-soft); border-color: var(--red); }
.heat__cell.is-rest { background: repeating-linear-gradient(45deg, var(--rule) 0 1.5px, transparent 1.5px 5px); }
.heat__cell.is-none,
.heat__cell.is-future { border-style: dotted; opacity: 0.6; }
.heat__cell.is-today { outline: 2px solid var(--ink); outline-offset: 1px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .heat__cell { width: 12px; }

.table {
  width: 100%;
  margin-bottom: 16px;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.table th, .table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font-weight: 400;
}

.table td { text-align: right; font-weight: 500; }
.table th[scope="row"] { color: var(--ink-2); }

.table-wrap { overflow-x: auto; }
.table--cols { font-size: 14px; }
.table--cols th, .table--cols td { padding: 8px 6px; white-space: nowrap; }
.table--cols th:first-child { padding-left: 0; }
.table--cols td:last-child { padding-right: 0; }
.table--cols thead th { font-size: 12px; color: var(--muted); text-align: right; }
.table--cols thead th:first-child { text-align: left; }

.review { border-bottom: 1px solid var(--rule); }
.review summary { padding: 12px 0; font-weight: 500; cursor: pointer; }
.review .facts { padding-bottom: 14px; }

.status-line { font-weight: 600; color: var(--stamp); }

/* ——— Первый запуск ——— */

.sheet--intro { margin-top: 8px; }

.intro__title {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(96px, 30vw, 136px);
  line-height: 0.8;
  color: var(--red);
}

.intro__lead { font-size: 18px; font-weight: 500; max-width: 30ch; }

.rules { list-style: none; display: grid; gap: 12px; }

.rules li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
}

.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 10px;
  height: 3px;
  background: var(--red);
}

.onboarding { margin-top: 8px; }

/* ——— Нижняя панель ——— */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--sheet);
  border-top: 1px solid var(--rule);
}

.tabbar[hidden] { display: none; }

.tabbar__inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  max-width: 520px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .icon { color: var(--red); }

/* ——— Окна и уведомления ——— */

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--scrim);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 26px 18px calc(env(safe-area-inset-bottom) + 22px);
  background: var(--sheet);
  border-radius: 14px 14px 0 0;
  display: grid;
  gap: 14px;
}

.modal__panel:focus { outline: none; }

.modal__close { position: absolute; top: 10px; right: 10px; }

.modal__title {
  padding-right: 40px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 38px;
  line-height: 0.95;
}

.modal__lead { color: var(--ink-2); }
.modal .table { margin-bottom: 0; }

.modal--enter .modal__panel { animation: panel-in 0.22s ease-out both; }

@keyframes panel-in {
  from { transform: translateY(24px); opacity: 0; }
}

@media (min-width: 600px) {
  .modal { align-items: center; padding: 24px; }
  .modal__panel { border-radius: 10px; padding-bottom: 24px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 76px);
  z-index: 40;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 16px;
  background: var(--ink);
  color: var(--sheet);
  border-radius: var(--radius);
  font-size: 15px;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Когда открыто окно, уведомление уезжает наверх, чтобы не закрывать кнопки. */
.has-modal .toast { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; transform: translate(-50%, -12px); }
.has-modal .toast.is-visible { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .stamp--in,
  .modal--enter .modal__panel { animation: none; }
  .toast { transition: none; }
}

@media (max-width: 360px) {
  .figures { grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .question { font-size: 34px; }
}
