:root {
  --bg: #f6f7fb; --panel: #ffffff; --panel-2: #f1f3f9; --line: #e4e7f0; --line-2: #d5dae6;
  --text: #0f172a; --text-2: #475569; --muted: #8590a6;
  --accent: #4f46e5; --accent-2: #eef0ff; --accent-text: #3730a3;
  --good: #059669; --good-bg: #e7f8f1; --bad: #dc2626; --bad-bg: #fdecec; --warn: #b45309; --warn-bg: #fdf3e2; --info-bg: #eaf2ff; --info: #1d4ed8;
  --c0: #64748b; --c1: #4f46e5; --c2: #0891b2; --c3: #d97706; --c4: #db2777;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e17; --panel: #121725; --panel-2: #182032; --line: #232c40; --line-2: #2f3a52;
    --text: #e8ecf5; --text-2: #aab3c7; --muted: #6f7a91;
    --accent: #818cf8; --accent-2: #1e2142; --accent-text: #c7cbff;
    --good: #34d399; --good-bg: #0f2a22; --bad: #f87171; --bad-bg: #2f1517; --warn: #fbbf24; --warn-bg: #2d2412; --info-bg: #13213d; --info: #93b4ff;
    --c0: #94a3b8; --c1: #818cf8; --c2: #22d3ee; --c3: #fbbf24; --c4: #f472b6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e17; --panel: #121725; --panel-2: #182032; --line: #232c40; --line-2: #2f3a52;
  --text: #e8ecf5; --text-2: #aab3c7; --muted: #6f7a91;
  --accent: #818cf8; --accent-2: #1e2142; --accent-text: #c7cbff;
  --good: #34d399; --good-bg: #0f2a22; --bad: #f87171; --bad-bg: #2f1517; --warn: #fbbf24; --warn-bg: #2d2412; --info-bg: #13213d; --info: #93b4ff;
  --c0: #94a3b8; --c1: #818cf8; --c2: #22d3ee; --c3: #fbbf24; --c4: #f472b6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; padding: 0 6px; color: var(--text); }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #06b6d4); display: grid; place-items: center; color: #fff; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 520; }
.nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--text); }
.nav a.on { background: var(--accent-2); color: var(--accent-text); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 6px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.top .grow { flex: 1; }
.page { padding: 24px 28px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.sub { color: var(--text-2); margin-top: 4px; }
.btn.menu-btn { display: none; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); padding: 7px 13px; border-radius: 10px; font: inherit; font-weight: 560; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.pr { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pr:hover { filter: brightness(1.08); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
label.ck { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 5px 11px; border-radius: 8px; font: inherit; font-weight: 560; cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h .grow { flex: 1; }
.card-b { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.tile { padding: 14px 16px; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 560; }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 2px; letter-spacing: -.02em; }
.tile .d { font-size: 12.5px; color: var(--text-2); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.running { background: var(--info-bg); color: var(--info); }
.chip.completed, .chip.winner { background: var(--good-bg); color: var(--good); }
.chip.paused, .chip.review, .chip.guardrail, .chip.inconclusive { background: var(--warn-bg); color: var(--warn); }
.chip.loser, .chip.invalid { background: var(--bad-bg); color: var(--bad); }
.chip.ai { background: linear-gradient(90deg, var(--accent-2), var(--info-bg)); color: var(--accent-text); }
.up { color: var(--good); font-weight: 650; }
.down { color: var(--bad); font-weight: 650; }

/* tables */
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--panel-2); }
.t td.r, .t th.r { text-align: right; }
.table-wrap { overflow-x: auto; }

.bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 580; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-color: var(--accent); }

/* verdict */
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); }
.verdict .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--panel-2); }
.verdict.winner { background: var(--good-bg); border-color: transparent; } .verdict.winner .ic { background: var(--good); color: #fff; }
.verdict.loser, .verdict.invalid { background: var(--bad-bg); border-color: transparent; } .verdict.loser .ic, .verdict.invalid .ic { background: var(--bad); color: #fff; }
.verdict.guardrail { background: var(--warn-bg); border-color: transparent; } .verdict.guardrail .ic { background: var(--warn); color: #fff; }
.verdict.running, .verdict.collecting { background: var(--info-bg); border-color: transparent; } .verdict.running .ic, .verdict.collecting .ic { background: var(--info); color: #fff; }
.verdict h2 { font-size: 18px; }
.verdict ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }

.ai-box { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: linear-gradient(180deg, var(--accent-2), var(--panel) 70%); }
.ai-box .lbl { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 8px; }
.ai-box p { margin: 6px 0; color: var(--text-2); }
.ai-box ol { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); }

.vcard { padding: 14px 16px; border-left: 4px solid var(--c0); }
.vcard .name { font-weight: 650; display: flex; gap: 8px; align-items: center; }
.vcard .big { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 6px 0 2px; }
.ci { position: relative; height: 22px; margin: 10px 0 4px; }
.ci .axis { position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line); }
.ci .zero { position: absolute; top: 3px; width: 1px; height: 16px; background: var(--muted); }
.ci .rng { position: absolute; top: 7px; height: 8px; border-radius: 4px; opacity: .35; }
.ci .pt { position: absolute; top: 4px; width: 14px; height: 14px; border-radius: 50%; margin-left: -7px; border: 2px solid var(--panel); }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .lg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.chart .lg i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .gl { stroke: var(--line); }
.tip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 7px 9px; border-radius: 8px; z-index: 50; white-space: nowrap; }

.list-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-check li { display: flex; gap: 9px; align-items: flex-start; }
.list-check .ok { color: var(--good); } .list-check .no { color: var(--bad); } .list-check .wn { color: var(--warn); }

/* wizard */
.wizard { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 18px; align-items: start; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 520px; position: sticky; top: 76px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.typing { color: var(--muted); }
.chat-in { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-in textarea { min-height: 64px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.sugg button { border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.sugg button:hover { border-color: var(--accent); color: var(--accent); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.change { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.change:last-child { border-bottom: 0; }
.change .ty { font-weight: 600; color: var(--text-2); }
.change .val { color: var(--text-2); word-break: break-word; }
.frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

.edit-row { display: grid; grid-template-columns: 120px 1fr 1fr 100px 32px; gap: 8px; align-items: start; margin-bottom: 8px; }
.goal-row { display: grid; grid-template-columns: 1.2fr 110px 1.3fr 120px 76px 76px 76px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px; border-radius: 6px; }
.icon-btn:hover { background: var(--panel-2); color: var(--bad); }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--panel); border-radius: 18px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal .card-b { display: flex; flex-direction: column; gap: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }

pre.code { background: #0b1020; color: #dbe3ff; padding: 14px 16px; border-radius: 12px; overflow-x: auto; margin: 0; font-size: 12.5px; line-height: 1.6; }
.plan { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.plan.cur { outline: 2px solid var(--accent); }
.plan .price { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.plan ul { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .wizard { grid-template-columns: 1fr; }
  .chat { position: static; height: 560px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .top, .page { padding-left: 16px; padding-right: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile .v { font-size: 20px; }
  .edit-row, .goal-row { grid-template-columns: 1fr 1fr; }
  .top .who-label { display: none; }
}

.editor-frame { position: absolute; inset: 12px; background: var(--panel); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.editor-frame iframe { flex: 1; border: 0; width: 100%; background: #fff; }

/* колокольчик */
.bell { position: relative; }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 17px; text-align: center; }
.bell-pop { position: fixed; top: 58px; right: 16px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; z-index: 45; }
.bell-list { display: flex; flex-direction: column; }
.bell-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.bell-item:hover { background: var(--panel-2); text-decoration: none; }
.bell-item.unread { box-shadow: inset 3px 0 0 var(--accent); }

/* ICE */
.ice .bar { margin-top: 4px; }

/* календарь */
.cal-row { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: center; min-height: 30px; }
.cal-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.cal-track { position: relative; height: 22px; background: linear-gradient(90deg, var(--panel-2), var(--panel-2)) center/100% 1px no-repeat; }
.cal-bar { position: absolute; top: 4px; height: 14px; border-radius: 7px; }
.cal-bar.eta { background: repeating-linear-gradient(45deg, var(--info) 0 4px, transparent 4px 8px); opacity: .55; }
.cal-bar.ro { background: repeating-linear-gradient(45deg, var(--good) 0 4px, transparent 4px 8px); opacity: .6; }
.cal-head .cal-track { background: none; height: 26px; }
.cal-tick { position: absolute; top: 4px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-now { position: absolute; top: -2px; bottom: -2000px; border-left: 2px solid var(--bad); padding-left: 4px; font-size: 11px; color: var(--bad); pointer-events: none; }
.card-b:has(.cal-now) { overflow: hidden; position: relative; }
.cal-group { padding: 10px 0; border-top: 1px solid var(--line); }
.cal-page { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
i.lg { display: inline-block; width: 18px; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
i.lg.eta { background: repeating-linear-gradient(45deg, var(--info) 0 4px, transparent 4px 8px); }
@media (max-width: 820px) { .cal-row { grid-template-columns: 110px 1fr; } }

/* онбординг, подсказки, библиотека идей */
.nav-n { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; }
.note-banner { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; background: var(--accent-2); border-color: transparent; }
.note-banner .grow { flex: 1; min-width: 240px; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.idea { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.idea:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.idea b { font-size: 13.5px; }
#lib .ideas { grid-template-columns: 1fr 1fr; }
#lib .idea .small { display: none; }
.ob-step .card-h { gap: 12px; }
.ob-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--panel-2); color: var(--text-2); flex: none; }
.ob-step.done .ob-n { background: var(--good); color: #fff; }
.ob-step.done .card-b { opacity: .75; }
.ob-live { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); font-size: 13.5px; }
.ob-live.ok { background: var(--good-bg); color: var(--good); }
.ob-live.warn { background: var(--warn-bg); color: var(--warn); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.advice { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--text); font-size: 13px; }
.advice ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
abbr.term { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

/* подсказки по разделам */
.tour-spot { position: fixed; z-index: 80; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); pointer-events: none; transition: all .2s ease; outline: 2px solid var(--accent); }
.tour-tip { position: fixed; z-index: 81; width: min(360px, calc(100vw - 20px)); background: var(--panel); color: var(--text); border-radius: 14px; padding: 14px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
#tour-btn { font-weight: 700; min-width: 30px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
@media (max-width: 820px) { #who { max-width: 130px; } .top { gap: 6px; } }

/* плашка «Обучение» у заголовка раздела */
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.learn-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; border: 1px solid transparent; background: var(--accent-2); color: var(--accent-text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.learn-chip:hover { border-color: var(--accent); }
.learn-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#lib { max-height: 42%; overflow: auto; }
.msgs { min-height: 90px; }

/* профиль внизу слева */
.side-foot { padding: 0; display: flex; flex-direction: column; gap: 8px; }
#ai-status { padding: 0 6px; }
.profile { position: relative; }
#profile-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
#profile-btn:hover, #profile-btn.on, #profile-btn[aria-expanded="true"] { background: var(--panel-2); }
#profile-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-2); color: var(--accent-text); font-weight: 700; font-size: 13px; }
.pb-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-name small { font-weight: 400; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.pb-plan { flex: none; font-size: 11px; padding: 1px 8px; }
.pb-chev { flex: none; color: var(--muted); font-size: 12px; }
.profile-menu { position: absolute; left: 0; bottom: calc(100% + 8px); width: 296px; max-width: calc(100vw - 28px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(15, 23, 42, .22); padding: 6px; z-index: 60; font-size: 14px; }
.pm-head { padding: 8px 10px 6px; }
.pm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; }
.pm-item:hover { background: var(--panel-2); text-decoration: none; }
.pm-item.on { background: var(--accent-2); color: var(--accent-text); }
.pm-item svg, .pm-ico svg { width: 18px; height: 18px; flex: none; }
.pm-ico { display: inline-flex; color: var(--text-2); }
.pm-ext { margin-left: auto; color: var(--muted); display: inline-flex; }
.pm-ext svg { width: 14px; height: 14px; }
.pm-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pm-theme { display: flex; align-items: center; gap: 10px; padding: 6px 10px; flex-wrap: wrap; }
.pm-theme .seg { margin-left: auto; }
.pm-theme .seg button { padding: 3px 8px; font-size: 12.5px; }

/* вход и первичная настройка */
body.auth-on .shell { display: none; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-logo { padding: 0; }
.auth-note { background: var(--accent-2); color: var(--accent-text); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.auth-err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.auth-foot { text-align: center; }
.pm-item { background: none; border: 0; width: 100%; font: inherit; text-align: left; cursor: pointer; }
button.pm-item { color: var(--bad); }
[hidden] { display: none !important; }

/* живая полоса над результатами идущего теста */
.live-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 9px 14px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; font-size: 13px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(5,150,105,.5); animation: live-pulse 1.8s infinite; }
.live-dot.off { background: var(--bad); animation: none; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(5,150,105,0); } 100% { box-shadow: 0 0 0 0 rgba(5,150,105,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
