:root {
  --green: #1f5a3d; --green-dark: #174730; --green-light: #c9e0d2; --beige: #f4efe6; --beige-2: #fbf6ee;
  --dark: #2b2b2b; --muted: #6f6a62; --accent: #c98a4b; --red: #9b3d2e; --red-bg: #f6e3df; --white: #fff; --line: #e6dfd2;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: var(--beige); color: var(--dark);
  line-height: 1.5; font-size: 15px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
.top { background: var(--green); color: var(--white); padding: 14px 16px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.brand { font-weight: 700; font-size: 1.05rem; }
.brand span { font-weight: 400; opacity: .8; }
.who { font-size: .85rem; opacity: .9; text-align: right; }
main { max-width: 820px; margin: 0 auto; padding: 12px 14px; }
h1 { font-size: 1.3rem; margin: 6px 0 12px; color: var(--green); }
h2 { font-size: 1.1rem; margin: 0 0 8px; color: var(--green); }
h3 { font-size: 1rem; margin: 14px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.card { background: var(--white); border-radius: 14px; padding: 14px 16px; margin: 10px 0; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }

/* окна приложения — вкладки сверху */
nav.tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 12px;
  background: var(--beige); border-bottom: 1px solid var(--line); }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a { flex: none; white-space: nowrap; text-decoration: none; color: var(--green); background: var(--white); border: 1px solid var(--line);
  padding: 7px 13px; border-radius: 20px; font-size: .9rem; }
nav.tabs a.on { background: var(--green); border-color: var(--green); color: var(--white); font-weight: 600; }
nav.tabs a.on .badge { background: var(--white); color: var(--red); }

/* чат с Эко */
body.chat-on { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.bubble { max-width: 86%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.bubble.bot { background: var(--white); align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble.me { background: var(--green); color: var(--white); align-self: flex-end; border-bottom-right-radius: 5px; }
.bubble.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: .2s; }
.bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--beige); border-top: 1px solid var(--line); z-index: 20; }
.composer textarea.input { min-height: 42px; max-height: 140px; resize: none; border-radius: 20px; padding: 10px 14px; }
.composer .btn { border-radius: 50%; width: 42px; height: 42px; padding: 0; flex: none; font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip-btn { border: 2px solid var(--green); background: var(--white); color: var(--green); padding: 6px 11px; border-radius: 20px; font-size: .85rem; cursor: pointer; }
.chip-btn.on { background: var(--green); color: var(--white); }
.chip-btn.seen:not(.on) { border-color: var(--green-light); }

/* формы */
label.f { display: block; margin: 8px 0; }
label.f > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 3px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--white); }
textarea.input { min-height: 92px; resize: vertical; }
.input:focus { outline: 2px solid var(--green-light); border-color: var(--green); }
.btn { background: var(--green); color: var(--white); border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--green-dark); }
.btn.ghost { background: var(--white); color: var(--green); border: 1px solid var(--green); }
.btn.danger { background: var(--white); color: var(--red); border: 1px solid #e3b9b0; }
.btn.small { padding: 6px 11px; font-size: .85rem; font-weight: 500; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 1px solid var(--line); background: var(--white); border-radius: 10px; padding: 9px 6px; cursor: pointer; font-size: .9rem; }
.seg button.on { border-color: var(--green); background: var(--green-light); font-weight: 700; }
.pill { display: inline-block; border-radius: 12px; padding: 2px 9px; font-size: .78rem; background: var(--beige); }
.pill.ok { background: var(--green-light); color: var(--green); }
.pill.warn { background: #fff1b8; }
.pill.bad { background: var(--red-bg); color: var(--red); }
.answer { background: var(--green-light); border-radius: 10px; padding: 8px 12px; margin-top: 8px; white-space: pre-wrap; }
.pre { white-space: pre-wrap; }
.link { word-break: break-all; font-size: .85rem; background: var(--beige); border-radius: 8px; padding: 6px 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t td, table.t th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--dark); color: var(--white);
  padding: 9px 16px; border-radius: 12px; font-size: .9rem; z-index: 50; max-width: 90vw; }
.menu a { display: flex; gap: 12px; align-items: center; background: var(--white); border-radius: 14px; padding: 13px 14px; margin: 8px 0; text-decoration: none; color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.menu a .ic { font-size: 1.4rem; }
.menu a b { display: block; }
.badge { background: var(--red); color: var(--white); border-radius: 10px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }

/* обучение — стили страницы Юлии */
.progress-bar { height: 9px; background: var(--green-light); border-radius: 6px; overflow: hidden; margin: 4px 0 10px; }
.progress-fill { height: 100%; background: var(--green); transition: width .3s; }
.big-quote { border-left: 5px solid var(--accent); padding: 10px 14px; background: var(--beige-2); border-radius: 8px; font-size: 1.03rem; font-weight: 600; margin: 10px 0; }
.say { background: var(--green-light); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.say .label, .dont .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.say .label { color: var(--green); }
.dont { background: var(--red-bg); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.dont .label { color: var(--red); }
ul.checks { list-style: none; padding: 0; margin: 8px 0; }
ul.checks li { margin: 6px 0; padding-left: 22px; position: relative; }
ul.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 10px 12px 10px 54px; margin: 8px 0; background: var(--beige); border-radius: 10px; }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 9px; width: 30px; height: 30px; border-radius: 50%; background: var(--green);
  color: var(--white); text-align: center; line-height: 30px; font-weight: 700; }
.hl { background: #fff1b8; padding: 0 3px; border-radius: 3px; }
h2.sub-h { font-size: 1.05rem; margin: 0; }
.quiz-q { margin: 14px 0; }
.quiz-q p { font-weight: 600; margin: 0 0 6px; }
.quiz-q label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; margin: 4px 0; border-radius: 8px; background: var(--beige); cursor: pointer; }
.quiz-q label.right { background: var(--green-light); }
.quiz-q label.wrong { background: var(--red-bg); }
.quiz-q input { margin-top: 4px; accent-color: var(--green); }
.feedback { margin: 6px 0 0; font-size: .9rem; min-height: 1.1em; }
.feedback.ok { color: var(--green); font-weight: 600; }
.feedback.bad { color: var(--red); font-weight: 600; }
.result { font-size: 1.05rem; font-weight: 700; margin-top: 10px; }
[hidden] { display: none !important; }
a.btn, a.chip-btn { text-decoration: none; display: inline-block; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip-btn { flex: none; white-space: nowrap; }
