/* Токены те же, что в приложении (ios/Sources/Design/Theme.swift).
   Шрифты системные: страница не тянет ничего со сторонних доменов. */
:root {
  --bg: #0B0C0F;
  --surface: #16181D;
  --raised: #0F1014;
  --text: #F5F6F8;
  --body: #D7D9DE;
  --secondary: #9299A6;
  --tertiary: #5B6270;
  --accent: #6C5CE7;
  --accent-soft: #A99BFF;
  --hairline: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px calc(40px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }

/* Состояния */

.state {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.state-icon {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  display: grid;
  place-items: center;
  background: rgba(108, 92, 231, 0.14);
  border: 1px solid rgba(108, 92, 231, 0.25);
  color: var(--accent);
}

.state-title { margin: 4px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.state-text { margin: 0; max-width: 330px; color: var(--secondary); font-size: 15px; }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

/* Шапка */

.head { margin-bottom: 20px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tertiary);
}

.title { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -0.015em; }

.meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--tertiary);
  font-size: 13.5px;
  font-weight: 600;
}

.topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--topic-soft, rgba(255, 255, 255, 0.06));
  color: var(--topic, var(--secondary));
}

.topic::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: currentColor;
}

/* Карточки */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tertiary);
}

/* Плеер */

.player { display: flex; align-items: center; gap: 12px; }

.play {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.play:disabled { opacity: 0.45; cursor: default; }

.track { flex: 1; min-width: 0; }

.scrub {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--progress, 0%) 100% no-repeat,
              rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background: #fff;
  border: none;
  cursor: pointer;
}

.scrub::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background: #fff;
  border: none;
  cursor: pointer;
}

.scrub:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 4px; }

.times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tertiary);
  font-variant-numeric: tabular-nums;
}

.homework {
  margin: 0;
  color: var(--body);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-line;
}

/* Тезисы */

.theses { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }

.theses li {
  display: grid;
  grid-template-columns: 5px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--body);
  font-size: 15px;
}

.theses li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: var(--accent);
  margin-top: 8px;
}

/* Расшифровка */

.transcript { display: grid; gap: 14px; }

.line { display: grid; gap: 3px; }

.speaker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line.therapist .speaker { color: var(--accent-soft); }
.line.client .speaker { color: var(--tertiary); }

.line p { margin: 0; color: var(--body); font-size: 15px; }

.more {
  margin-top: 14px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Подвал */

.foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--tertiary);
  font-size: 13px;
}

.foot p { margin: 0 0 6px; }

.foot .muted { color: var(--tertiary); opacity: 0.8; }

.download {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.download:hover { text-decoration: underline; }

/* Запись на встречу */

.zone-note {
  margin: 10px 0 0;
  color: var(--secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

.day { margin-bottom: 14px; }

.day-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.slot {
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.slot:hover { border-color: var(--accent); color: var(--accent-soft); }

.slot:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.form { display: grid; gap: 14px; }

.field { display: grid; gap: 7px; }

.field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--secondary);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }

.primary {
  padding: 15px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary:disabled { opacity: 0.55; cursor: default; }

.secondary {
  padding: 10px;
  border: none;
  background: none;
  color: var(--secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.form-error { margin: 0; color: #FB7185; font-size: 13.5px; }

.empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.55;
}
