/* Executive Quest — Anna Standard.
   Стиль — светлый модуль Фигмы «Джарвис» дизайнера (как SolBx 12.1, значения из skins.css там):
   фон #f9f8f7, белые плашки r24, внутри строки #f9f8f7 r16, текст #0c0c10 / #66666f, панель #efeff1 с белыми пилюлями,
   зелёный #15be74, синий #6092ff, красный #ef3838, шрифт TikTok Sans (крупные цифры — Expanded Bold).
   Игра — приёмы Duolingo: объёмные кнопки с «подошвой», дорожка из кругов, празднование очков. Без серии дней и мультяшности. */

:root {
  --bg: #f9f8f7;
  --card: #ffffff;
  --row: #f9f8f7;
  --panel: #efeff1;
  --sep: #e0e0e4;
  --text: #0c0c10;
  --text2: #66666f;
  --text3: #9a9aa3;

  --green: #15be74;          /* фирменный зелёный дизайнера: заливки, галочки, полосы */
  --green-btn: #12a866;      /* кнопка с белым текстом: 3:1 для крупного жирного текста */
  --green-lip: #0b8a52;
  --green-ink: #087a48;      /* зелёный текст на белом: 5,4:1 */
  --green-soft: #e4f7ee;
  --blue: #6092ff;
  --blue-soft: #eaf0ff;
  --blue-ink: #2f5bd3;
  --gold: #f5b400;
  --gold-soft: #fff4d6;
  --gold-ink: #8a5a00;
  --red: #ef3838;
  --red-ink: #d12f2f;
  --purple: #8b5cf6;
  --purple-soft: #f1ebff;

  --sans: "TikTok Sans", -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --r-card: 24px;
  --r-row: 16px;
  --tabbar-h: 66px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.23, 1, 0.32, 1); /* как в SolBx 12.1 (Arlo UI) */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- каркас ---------- */
.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 44px);
  animation: enter 0.3s var(--ease);
}
.screen > * + * { margin-top: 12px; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 4px; }
.eyebrow { margin: 0; font: 600 13px/18px var(--sans); color: var(--text2); }
.caps { font: 700 12px/16px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text2); }
.h1 { margin: 2px 0 0; font: 700 30px/38px var(--sans); letter-spacing: -0.01em; }
.h2 { margin: 0; font: 700 24px/32px var(--sans); letter-spacing: -0.005em; }
.h3 { margin: 0; font: 700 20px/28px var(--sans); }
.muted { color: var(--text2); }
.small { font-size: 14px; line-height: 20px; }

.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.icon-fill { fill: currentColor; stroke: none; }
.circle-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--card); color: var(--text); text-decoration: none;
}
.circle-btn:active { scale: 0.95; transition: scale 0.13s var(--ease); }

/* ---------- плашки, строки, пилюли ---------- */
.card { background: var(--card); border-radius: var(--r-card); padding: 20px; }
.card > * + * { margin-top: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 0; border-radius: 100px;
  background: var(--card); color: var(--text);
  font: 600 14px/1 var(--sans); white-space: nowrap;
}
.pill .icon { width: 18px; height: 18px; }
.pill-green { background: var(--green-soft); color: var(--green-ink); }
.pill-gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill-gold .icon { color: var(--gold); }

/* ---------- кнопки: объёмные, как в Duolingo ---------- */
.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 0 18px; margin-bottom: 4px;
  border: 0; border-radius: 16px;
  font: 800 17px/1.2 var(--sans); letter-spacing: 0.03em; text-transform: uppercase;
  box-shadow: 0 4px 0 var(--lip, transparent);
  transition: transform 0.1s var(--ease), box-shadow 0.1s var(--ease);
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--lip, transparent); }
.btn-green { background: var(--green-btn); color: #fff; --lip: var(--green-lip); font-size: 19px; }
.btn-white { background: var(--card); color: var(--text); --lip: var(--sep); box-shadow: inset 0 0 0 2px var(--sep), 0 4px 0 var(--lip); }
.btn-white:active { box-shadow: inset 0 0 0 2px var(--sep), 0 0 0 var(--lip); }
.btn-purple { background: #7c3aed; color: #fff; --lip: #5b21b6; } /* белый на #7c3aed — 5,7:1 */
.btn-text { background: transparent; color: var(--text2); min-height: 44px; text-transform: none; letter-spacing: 0; font: 600 16px/1.2 var(--sans); margin: 0; }
.btn-danger { background: var(--card); color: var(--red-ink); text-transform: none; letter-spacing: 0; font: 600 16px/1.2 var(--sans); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn { padding: 0 8px; font-size: 14px; letter-spacing: 0.02em; }

/* ---------- Сегодня ---------- */
.stats-bar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 0 2px; }
.stats-bar::-webkit-scrollbar { display: none; }
.stats-bar .pill { height: 40px; font-size: 15px; }

.coach-say { display: flex; gap: 10px; align-items: flex-end; }
.coach-ava {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: #fff;
}
.bubble { flex: 1; background: var(--card); border-radius: 20px 20px 20px 6px; padding: 14px 16px; }
.bubble .caps { display: block; margin-bottom: 4px; }

.quest-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.story { color: var(--text2); }
.mission { background: var(--green-soft); border-radius: var(--r-row); padding: 14px 16px; }
.mission .caps { color: var(--green-ink); display: block; margin-bottom: 4px; }
.mission p { font-weight: 600; }

.secret { background: var(--row); border-radius: var(--r-row); }
.secret summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 14px; list-style: none; cursor: pointer;
  font-weight: 600;
}
.secret summary::-webkit-details-marker { display: none; }
.secret .key { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); }
.secret .open { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--blue-ink); }
.secret[open] .open { display: none; }
.secret p { padding: 0 14px 14px 56px; font-size: 17px; line-height: 26px; }

.facts { margin: 0; display: grid; gap: 8px; }
.card > .facts { margin-top: 16px; }
.facts > div { background: var(--row); border-radius: var(--r-row); padding: 12px 14px; display: grid; gap: 2px; }
.facts dt { font: 700 12px/16px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text2); }
.facts dt.dont { color: var(--red-ink); }
.facts dd { margin: 0; }
.level { display: inline-flex; align-items: flex-end; gap: 3px; margin-right: 8px; height: 16px; vertical-align: -2px; }
.level i { width: 6px; height: 8px; border-radius: 3px; background: var(--sep); }
.level i:nth-child(2) { height: 12px; }
.level i:nth-child(3) { height: 16px; }
.level i.on { background: var(--green); }

.card.bonus { box-shadow: inset 0 0 0 2px var(--gold); }
.card.bonus .caps { color: var(--gold-ink); }

.ask-row { display: flex; gap: 10px; align-items: flex-end; }
.ask-row textarea {
  flex: 1; width: 100%; resize: none;
  border: 0; border-radius: 22px;
  background: var(--row); padding: 12px 16px;
  font-size: 16px; line-height: 22px;
}
.send {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 3px; border: 0; border-radius: 50%;
  background: var(--green-btn); color: #fff;
  box-shadow: 0 3px 0 var(--green-lip);
}
.send:active { transform: translateY(3px); box-shadow: none; }

/* ---------- Коуч ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 160px; }
.msg { max-width: 84%; padding: 12px 16px; border-radius: 20px; white-space: pre-line; }
.msg-coach { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.msg-me { align-self: flex-end; background: var(--green-soft); border-bottom-right-radius: 6px; }
.msg-time { align-self: center; font-size: 13px; color: var(--text2); }
.msg-xp {
  align-self: center; display: flex; align-items: center; gap: 12px;
  background: var(--gold-soft); border-radius: 20px; padding: 12px 18px 12px 12px;
  animation: pop 0.45s var(--ease);
}
.burst { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: #fff; }
.msg-xp b { display: block; font: 800 22px/1.1 var(--sans); font-stretch: 150%; color: var(--gold-ink); }
.msg-xp span { font-size: 14px; color: var(--gold-ink); }
@keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }

.composer {
  position: fixed; left: 0; right: 0; z-index: 9;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(249, 248, 247, 0) 0%, var(--bg) 24%);
}
.composer-inner { max-width: 560px; margin: 0 auto; padding: 0 16px; display: grid; gap: 8px; }
.commands {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 0 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
}
.commands::-webkit-scrollbar { display: none; }
.composer .ask-row textarea { background: var(--card); box-shadow: inset 0 0 0 1px var(--sep); }

/* ---------- Прогресс ---------- */
.xp-hero { display: flex; align-items: center; gap: 14px; }
.xp-hero .burst { width: 56px; height: 56px; }
.xp-hero .burst .icon { width: 28px; height: 28px; }
.xp-big { font: 800 40px/1 var(--sans); font-stretch: 150%; }
.xp-big span { font-size: 18px; color: var(--gold-ink); margin-left: 6px; font-stretch: 100%; }

.chapter-head { display: flex; align-items: center; gap: 14px; }
.chapter-badge {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--green-btn); color: #fff; box-shadow: 0 4px 0 var(--green-lip); /* 3:1 — крупный жирный текст */
  font: 800 20px/1 var(--sans); font-stretch: 150%;
}
.bar { height: 12px; border-radius: 6px; background: var(--panel); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 6px; transition: width 0.8s var(--ease); }
.bar-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text2); }
.bar-line .bar { flex: 1; }

/* дорожка практик главы — круги «змейкой», как уроки в Duolingo */
.path { list-style: none; margin: 4px 0 0; padding: 4px 0 0; display: grid; gap: 18px; }
.path li { display: flex; align-items: center; gap: 14px; }
.path li:nth-child(4n + 2) { padding-left: 32px; }
.path li:nth-child(4n + 3) { padding-left: 64px; }
.path li:nth-child(4n + 4) { padding-left: 32px; }
.node {
  flex: none; display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--panel); color: var(--text3);
  box-shadow: 0 5px 0 var(--sep);
}
.node .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.path li.done .node { background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-lip); }
.path li.part .node { background: var(--gold); color: #fff; box-shadow: 0 5px 0 #c99400; }
.path li.goal .node { border-radius: 18px; background: var(--purple-soft); color: var(--purple); box-shadow: 0 5px 0 #dccfff; }
.path .txt { min-width: 0; font-weight: 600; line-height: 22px; }
.path .note { display: block; font-weight: 400; font-size: 14px; line-height: 20px; color: var(--text2); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 14px 12px; }
.stat b { display: block; font: 800 28px/1.1 var(--sans); font-stretch: 150%; }
.stat span { display: block; font-size: 13px; line-height: 18px; color: var(--text2); margin-top: 2px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-top: 24px; padding: 0 4px; }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.badge { padding: 18px 14px 16px; text-align: center; }
.badge .seal { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; color: #fff; }
.badge .seal .icon { width: 26px; height: 26px; }
.badge:nth-child(3n + 1) .seal { background: var(--gold); box-shadow: 0 4px 0 #c99400; }
.badge:nth-child(3n + 2) .seal { background: var(--blue); box-shadow: 0 4px 0 #3f6fe0; }
.badge:nth-child(3n + 3) .seal { background: var(--green); box-shadow: 0 4px 0 var(--green-lip); }
.badge h3 { margin: 14px 0 2px; font: 700 15px/20px var(--sans); }
.badge p { font-size: 13px; line-height: 18px; color: var(--text2); }
.badge.locked .seal { background: var(--panel); color: var(--text3); box-shadow: 0 4px 0 var(--sep); }
.badge.locked h3 { color: var(--text2); }

.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.journal li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; background: var(--row); border-radius: var(--r-row); padding: 12px 14px; }
.journal .t { font-weight: 600; }
.journal .meta { font-size: 13px; color: var(--text2); }
.journal .xp { grid-row: span 2; align-self: center; font: 800 16px/1 var(--sans); font-stretch: 150%; color: var(--gold-ink); }

/* ---------- Вечер (светлый, сиреневый акцент) ---------- */
.moon-ava { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); }
.ev-head { display: flex; align-items: center; gap: 14px; padding: 0 4px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 6px; }
.steps i { height: 8px; border-radius: 4px; background: var(--panel); }
.steps i.on { background: var(--purple); }
.question { font: 700 22px/30px var(--sans); }
.ev-input {
  width: 100%; min-height: 120px; resize: none;
  border: 0; border-radius: var(--r-row);
  background: var(--row); padding: 14px 16px;
  font-size: 16px; line-height: 24px;
}
.closing { text-align: center; padding: 48px 8px 8px; }
.closing .moon-ava { width: 88px; height: 88px; margin: 0 auto 18px; }
.closing .moon-ava .icon { width: 40px; height: 40px; }
.closing .muted { margin-top: 8px; text-wrap: balance; }

/* ---------- Настройки ---------- */
.group > * + * { margin-top: 8px; }
.group > .caps { display: block; padding: 0 4px; }
.list { list-style: none; margin: 0; padding: 8px; background: var(--card); border-radius: var(--r-card); display: grid; gap: 8px; }
.list .item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 6px 6px 14px; background: var(--row); border-radius: var(--r-row); }
.list input[type="time"] { border: 0; background: var(--card); border-radius: 100px; padding: 8px 14px; min-height: 40px; font-weight: 600; }
.status { font-size: 14px; color: var(--text2); padding-right: 8px; }
.hint { display: flex; gap: 10px; padding: 14px 16px; border-radius: var(--r-row); background: var(--blue-soft); font-size: 14px; line-height: 20px; }
.hint .icon { color: var(--blue-ink); margin-top: 1px; }
.memory .item { align-items: flex-start; }
.memory .item span { padding: 8px 0; }
.memory .circle-btn { width: 40px; height: 40px; color: var(--text2); }

/* ---------- Вход ---------- */
.login { min-height: 100dvh; display: grid; align-content: center; justify-items: center; text-align: center; padding: calc(var(--safe-top) + 24px) 24px calc(var(--safe-bottom) + 24px); }
.login > * + * { margin-top: 14px; }
.login .muted { text-wrap: balance; }
.monogram { width: 96px; height: 96px; border-radius: 24px; }
.login form { width: 100%; max-width: 340px; display: grid; gap: 14px; }
.code-input {
  width: 100%; height: 64px;
  border: 0; border-radius: var(--r-row); background: var(--card); box-shadow: inset 0 0 0 2px var(--sep);
  text-align: center; font: 800 28px/1 var(--sans); font-stretch: 150%; letter-spacing: 0.35em; padding-left: 0.35em;
}

/* ---------- нижняя панель — пилюля, как в SolBx 12.1 ---------- */
.tabbar {
  position: fixed; z-index: 10;
  left: 16px; right: 16px; bottom: calc(var(--safe-bottom) + 16px);
  max-width: 528px; margin: 0 auto;
  height: var(--tabbar-h); padding: 6px; border-radius: 33px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--sep), 0 8px 24px rgba(12, 12, 16, 0.08);
}
.tabbar nav { display: grid; grid-template-columns: repeat(4, 1fr); height: 100%; }
.tabbar a {
  display: grid; justify-items: center; align-content: center; gap: 3px;
  border-radius: 28px; text-decoration: none; color: var(--text2);
  font: 600 12px/1 var(--sans);
}
.tabbar a .icon { stroke: #383840; }
.tabbar a[aria-current="page"] { background: var(--card); color: var(--text); }
.tabbar a[aria-current="page"] .icon { stroke: var(--text); stroke-width: 2.1; }
body.no-tabbar .tabbar { display: none; }
body.typing .tabbar { display: none; }
body.typing .composer { bottom: 0; padding-bottom: calc(10px + var(--safe-bottom)); }

.toast {
  position: fixed; left: 50%; z-index: 20;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 30px);
  transform: translateX(-50%);
  max-width: calc(100% - 40px);
  padding: 12px 16px; border-radius: 16px;
  background: var(--text); color: #fff; font-size: 14px;
  animation: enter 0.2s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- мелкие общие ---------- */
.lead { padding: 0 4px; }
.settings-head { display: flex; align-items: center; gap: 12px; }
