:root {
  --acid-lime: #d9f51f; --dark-forest: #0d1b1e; --soft-white: #f7f7f2; --bright-sky: #4cc7d9;
  --bg: #f2f4ee; --surface: #ffffff; --surface-alt: #f7f8f4; --text: #0d1b1e;
  --muted: #596568; --border: rgba(13, 27, 30, .16); --accent-text: #526900; --danger: #b4232b;
  color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
html[data-theme="dark"] {
  --bg: #071113; --surface: #102326; --surface-alt: #0b1b1e; --text: #f7f7f2;
  --muted: #adbbbb; --border: rgba(247, 247, 242, .18); --accent-text: #d9f51f; --danger: #ff777d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.hidden { display: none !important; }
.shell { width: min(100%, 680px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px calc(88px + env(safe-area-inset-bottom)); }
.page-top { display: block; height: 0; scroll-margin-top: 0; }
.topbar, .progress-meta, .actions, .bottom-nav, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar { min-width: 0; }
.brand { font-weight: 900; letter-spacing: .08em; font-size: 15px; }
.brand-dot { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 2px; background: var(--acid-lime); transform: rotate(12deg); }
select { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 9px 13px; }
.progress-wrap { margin: 22px 0 20px; }
.progress-meta { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
#progress-percent { color: var(--text); font-size: 14px; }
.progress { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
#progress-bar { width: 4%; height: 100%; background: linear-gradient(90deg, var(--acid-lime), var(--bright-sky)); transition: width .3s ease; }
.question-card, .result-actions { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 14px 38px rgba(13, 27, 30, .07); }
.question-card { padding: clamp(20px, 5vw, 32px); }
.eyebrow { margin: 0 0 12px; color: var(--accent-text); font-size: 12px; font-weight: 850; letter-spacing: .12em; }
h1 { margin: 0 0 12px; font-size: clamp(20px, 4.8vw, 23px); line-height: 1.32; font-weight: 760; letter-spacing: -.012em; overflow-wrap: anywhere; }
.question-helper { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.question-examples { margin: -4px 0 18px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.45; }
.question-examples-label { color: var(--muted); font-weight: 500; }
.question-examples ul { margin: 6px 0 0; padding-left: 19px; }
.question-examples li + li { margin-top: 4px; }
.question-card.result-mode h1 { font-size: clamp(20px, 4.8vw, 23px); line-height: 1.3; font-weight: 820; letter-spacing: -.01em; }
.question-card.result-mode .question-helper { font-size: 16px; line-height: 1.55; white-space: pre-line; }
.question-card.automation-mode h1 { font-size: clamp(20px, 4.8vw, 23px); line-height: 1.3; }
.recommendation { margin: 16px 0; padding: 14px 16px; border-left: 4px solid var(--acid-lime); border-radius: 12px; background: var(--surface-alt); color: var(--text); font-size: 15px; line-height: 1.5; }
.options { display: grid; gap: 12px; margin: 20px 0; }
.option { position: relative; width: 100%; min-width: 0; height: auto; text-align: left; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); padding: 16px 46px 16px 16px; border-radius: 16px; font-weight: 680; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.option::after { content: ""; position: absolute; right: 16px; top: 18px; width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 50%; }
.option:hover, .option:focus-visible { border-color: var(--bright-sky); outline: 3px solid color-mix(in srgb, var(--bright-sky) 25%, transparent); }
.option.selected { border: 2px solid var(--accent-text); background: color-mix(in srgb, var(--acid-lime) 16%, var(--surface)); padding: 15px 45px 15px 15px; }
.option.selected::after { content: "✓"; display: grid; place-items: center; border-color: var(--accent-text); background: var(--acid-lime); color: var(--dark-forest); font-size: 13px; font-weight: 900; }
.option-card-index { color: var(--accent-text); margin-right: 6px; }
.option-card-content { display: block; min-width: 0; max-width: 100%; overflow: visible; }
.option-card-title { display: block; max-height: none; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; font-size: 18px; line-height: 1.3; font-weight: 820; }
.option-card-effect { display: block; max-height: none; overflow: visible; text-overflow: clip; white-space: normal; margin-top: 7px; color: var(--muted); font-size: 15px; line-height: 1.45; font-weight: 500; }
.option-card-summary { display: block; max-height: none; overflow: visible; text-overflow: clip; white-space: normal; margin-top: 9px; color: var(--text); font-size: 14px; line-height: 1.45; font-weight: 400; }
.option-card-type { display: block; width: fit-content; margin-bottom: 8px; color: var(--accent-text); font-size: 11px; line-height: 1.3; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.option-card-expected, .option-card-evidence, .option-card-boundary { display: block; margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.45; font-weight: 400; }
.option-card-expected { color: var(--text); }
.option-card-boundary { color: var(--danger); }
.diagnosis-section { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-alt); }
.diagnosis-section h2 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.diagnosis-section p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.result-recommendation { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-alt); }
.result-recommendation.primary { border: 2px solid var(--acid-lime); background: color-mix(in srgb, var(--acid-lime) 10%, var(--surface)); }
.result-recommendation.secondary { padding: 14px 16px; }
.result-recommendation.secondary .option-card-title { font-size: 16px; }
.recommendation-marketing, .recommendation-analytics, .recommendation-process_change, .recommendation-technical_review, .recommendation-no_action_yet { padding-right: 16px; }
.recommendation-marketing::after, .recommendation-analytics::after, .recommendation-process_change::after, .recommendation-technical_review::after, .recommendation-no_action_yet::after { display: none; }
.option.selected .option-card-effect { color: var(--text); }
.option.recommended { border-color: var(--acid-lime); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acid-lime) 22%, transparent); }
.option.recommended::before { content: "Рекомендуем"; display: block; width: fit-content; margin-bottom: 8px; color: var(--accent-text); font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.input-label { display: block; margin: 4px 0 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
textarea, input { width: 100%; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 14px; padding: 14px; resize: vertical; font-size: 16px; line-height: 1.45; }
textarea:focus, input:focus { outline: 3px solid color-mix(in srgb, var(--bright-sky) 30%, transparent); border-color: var(--bright-sky); }
.other-wrap { max-height: 0; opacity: 0; overflow: hidden; transform: translateY(-5px); transition: max-height .2s ease, opacity .18s ease, transform .2s ease; }
.other-wrap.is-visible { max-height: 90px; opacity: 1; transform: translateY(0); }
#other-answer { margin-top: 10px; }
.actions { margin-top: 12px; }
.actions button, .bottom-nav button, .voice-actions button, .dialog-actions button, #retry, .result-actions button, .finish-brief { border: 0; border-radius: 13px; padding: 13px 17px; font-weight: 780; }
.primary { background: var(--acid-lime); color: var(--dark-forest); flex: 1; }
.voice { background: var(--dark-forest); color: var(--soft-white); }
html[data-theme="dark"] .voice { background: #243b3f; }
.voice.recording { background: #d64045; }
.voice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border) !important; }
.danger-link { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent) !important; }
.finish-brief { width: 100%; margin-top: 12px; }
.result-actions { display: grid; gap: 12px; margin: 14px 0; padding: 20px; }
.result-actions h2 { margin: 10px 0 0; font-size: 21px; }
.result-actions label { display: grid; gap: 6px; color: var(--muted); }
.completion-step { display: grid; gap: 12px; }
.completion-step p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.completion-step button, .change-option { width: 100%; }
.change-option { margin-top: 4px; }
.consultation { background: var(--bright-sky); color: var(--dark-forest); }
.consent { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.delivery-status { margin: -4px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.bottom-nav { margin-top: 18px; }
.bottom-nav button { background: transparent; color: var(--muted); }
.build-version { display: block; margin-top: 14px; color: var(--muted); font-size: 10px; text-align: center; opacity: .7; }
.connection { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); margin-top: 14px; padding: 14px; background: var(--dark-forest); color: var(--soft-white); border-radius: 14px; z-index: 5; }
.connection button { margin-left: 8px; }
dialog { width: min(90vw, 430px); border: 0; border-radius: 22px; padding: 24px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.55); }
.welcome-dialog h2 { margin: 0 0 14px; font-size: 23px; line-height: 1.25; }
.welcome-dialog p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.5; }
.welcome-dialog .primary { width: 100%; margin-top: 8px; }
.danger { background: #d64045; color: white; }
@media (max-width: 420px) {
  .shell { padding-left: 12px; padding-right: 12px; }
  .question-card { border-radius: 18px; padding: 20px 16px; }
  .actions { align-items: stretch; flex-direction: column; }
  .actions button { width: 100%; }
  .option { padding-left: 14px; }
  .option-card-title { font-size: 17px; }
  .brand { font-size: 13px; white-space: nowrap; }
  .topbar select { min-width: 0; max-width: 112px; }
}
