/* Цвета — только здесь. Смена акцента = правка трёх строк. */
:root {
  --bg: #F5F7FA;
  --text: #1F2A37;
  --muted: #6B7280;
  --accent: #3A4A8F;
  --accent-pressed: #2C3970;
  --on-accent: #FFFFFF;
  --field: #FFFFFF;
  --line: #D9DEE7;
  --audio-bg: #0B0F1A;
  --audio-text: #E6E9F2;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* На десктопе — тот же экран по центру, 430 px. */
.phone {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

.screen {
  min-height: 100dvh;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.screen[hidden] { display: none; }

h1 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  margin: 8px 0 10px;
}
.hint { color: var(--muted); margin: 0 0 16px; }

textarea, input[type="text"], input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 18px;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  resize: none;
  outline: none;
}
textarea:focus, input:focus { border-color: var(--accent); }
input[type="number"] { width: 84px; text-align: center; }

.row { display: flex; gap: 10px; align-items: center; margin: 10px 0 16px; }
.row input[type="text"] { flex: 1; }
.minutes { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--muted); white-space: nowrap; }

button { font: inherit; cursor: pointer; }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 19px;
  font-weight: 600;
}
.btn-primary:active { background: var(--accent-pressed); }
.btn-small { width: auto; padding: 12px 18px; font-size: 17px; }

.btn-big {
  flex: 1;
  padding: 30px 8px;
  font-size: 24px;
  border-radius: 22px;
}
.big-buttons { display: flex; gap: 12px; margin: 14px 0 26px; }

.btn-outline {
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 19px;
  font-weight: 600;
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 8px 4px;
  font-size: 17px;
}
.btn-ghost.listening { color: var(--accent-pressed); text-decoration: underline; }
.btn-ghost[hidden] { display: none; }

.link {
  background: none; border: 0; color: var(--muted); padding: 8px 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.link.small { font-size: 15px; align-self: flex-start; }
#ob-skip { margin-top: auto; }

.ob-step { display: flex; flex-direction: column; }
.ob-step[hidden] { display: none; }
.hint.small { font-size: 14px; margin-top: 14px; }

/* A — обещание */
.promise { flex: 1; justify-content: center; text-align: center; padding-bottom: 60px; }
.promise-brand { font-size: 44px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 18px; }
.promise-text { font-size: 21px; line-height: 1.4; margin: 0 0 32px; }

/* B — плитки сфер */
.tiles { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.tile {
  background: var(--field);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 21px;
  font-weight: 500;
  text-align: left;
}
.tile:active, .tile.selected { border-color: var(--accent); background: rgba(58, 74, 143, 0.08); }

/* C, D — готовые варианты */
.chips { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.chips:empty { display: none; }
.chip {
  background: var(--field);
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 17px;
  text-align: left;
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
}
.chip .min { color: var(--muted); font-size: 14px; white-space: nowrap; }
.chip.selected { border-color: var(--accent); background: rgba(58, 74, 143, 0.08); }
.link.inline { font-size: 15px; padding: 2px 0 6px; align-self: flex-start; }

.brand { font-size: 15px; letter-spacing: 0.08em; color: var(--muted); user-select: none; -webkit-user-select: none; }

/* Шаг на сегодня */
.step-block { margin-bottom: 18px; }
.step-label { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.step-row { display: flex; align-items: center; gap: 14px; }
.step-text { flex: 1; font-size: 21px; font-weight: 500; line-height: 1.3; min-height: 28px; }
.step-block.highlight .step-text { animation: glow 2s ease-out; }
@keyframes glow {
  0% { background: rgba(58, 74, 143, 0.18); border-radius: 10px; }
  100% { background: transparent; }
}
.check {
  width: 60px; height: 60px; flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.check[hidden] { display: none; }
.check svg { opacity: 0; transition: opacity 0.15s; }
.check[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.check[aria-pressed="true"] svg { opacity: 1; }
.step-done-phrase { margin-top: 8px; color: var(--accent); font-size: 17px; }
.inline-form { margin-top: 10px; }
#name-step[hidden], .inline-form[hidden], .step-done-phrase[hidden], .step-row[hidden] { display: none; }

.counter { font-size: 18px; margin: 4px 0 2px; }

/* Вечер */
.evening { margin-top: 12px; }
.evening[hidden] { display: none; }
.evening label { display: block; font-size: 16px; color: var(--muted); margin-top: 8px; }
.evening .row { margin: 6px 0 4px; }
.saved-note { color: var(--accent); font-size: 15px; margin-top: 4px; }
.saved-note[hidden] { display: none; }

.footer { margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--muted); }

/* Экран 2 — аудио */
.audio {
  background: var(--audio-bg);
  color: var(--audio-text);
  align-items: center;
  justify-content: center;
  position: fixed; inset: 0; z-index: 10;
  max-width: 430px; margin: 0 auto;
  transition: background 1.2s ease;
}
.audio.light { background: var(--bg); color: var(--text); }
.pulse {
  width: 180px; height: 180px; border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: pulse 6s ease-in-out infinite;
  margin-bottom: 40px;
}
.audio.light .pulse { display: none; }
@keyframes pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.25; }
  50% { transform: scale(1.1); opacity: 0.45; }
}
.remaining { font-size: 56px; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; margin-bottom: 8px; }
.stub-note { font-size: 14px; opacity: 0.6; margin-bottom: 40px; }
.audio.light .remaining, .audio.light .stub-note, .audio.light button { display: none; }
.btn-outline-light {
  background: transparent; color: var(--audio-text);
  border: 2px solid rgba(230, 233, 242, 0.5);
  border-radius: var(--radius);
  padding: 14px 32px; font-size: 19px;
  margin-top: 8px;
}
.btn-outline-light[hidden] { display: none; }
.finish { font-size: 30px; font-weight: 500; text-align: center; padding: 0 24px; }
.finish[hidden] { display: none; }
