/* Spell — дизайн-токены и компоненты. Цвета — только через токены. */
/* Палитра и шрифты — по образцу lab.cirspb.com: морская бирюза, «бумага», янтарный акцент для главных действий. */
:root {
  --bg: #f2f9fa; --surface: #ffffff; --surface-2: #e7f3f5; --surface-3: #d8eff1; --line: #cfe4e8;
  --ink: #0c2e37; --ink-2: #3f6270; --ink-3: #6e8d97;
  --accent: #0e4b5a; --accent-ink: #ffffff; --accent-soft: #d8eff1;
  --cta: #e59a45; --cta-ink: #04242d; --cta-deep: #c97e2a;
  --deep: #04242d; --deep-2: #073743; --aqua: #a9dde2;
  --rec: #d64545; --ok: #1d7a55; --ok-soft: #e1f3ea; --warn: #9a5a12; --warn-soft: #fdf1e1; --bad: #c4322a; --bad-soft: #fbe9e7;
  --shadow: 0 1px 2px rgba(4, 36, 45, .06), 0 8px 24px rgba(4, 36, 45, .06);
  --r: 10px; --r-s: 6px; --tap: 44px; --side: 248px;
  --f-sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-hand: "Caveat", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #04242d; --surface: #073743; --surface-2: #0a4150; --surface-3: #0e4b5a; --line: #145564;
    --ink: #e9f6f7; --ink-2: #a8cbd1; --ink-3: #6f98a1;
    --accent: #a9dde2; --accent-ink: #04242d; --accent-soft: #0e4b5a;
    --deep: #021a21; --deep-2: #04242d;
    --rec: #ff6b6b; --ok: #5fd3a0; --ok-soft: #0f3a33; --warn: #f2b56b; --warn-soft: #3a2d17; --bad: #ff7a70; --bad-soft: #3d1c1c;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #04242d; --surface: #073743; --surface-2: #0a4150; --surface-3: #0e4b5a; --line: #145564;
  --ink: #e9f6f7; --ink-2: #a8cbd1; --ink-3: #6f98a1;
  --accent: #a9dde2; --accent-ink: #04242d; --accent-soft: #0e4b5a;
  --deep: #021a21; --deep-2: #04242d;
  --rec: #ff6b6b; --ok: #5fd3a0; --ok-soft: #0f3a33; --warn: #f2b56b; --warn-soft: #3a2d17; --bad: #ff7a70; --bad-soft: #3d1c1c;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---- каркас: боковое меню + основная область ---- */
.shell { display: flex; min-height: 100vh; }
.sidenav {
  width: var(--side); flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto;
}
body.guest .only-user, body:not(.guest) .only-guest { display: none !important; }
.sn-brand { display: flex; align-items: center; gap: 8px; padding: 6px 8px 14px; font-weight: 900; letter-spacing: -.02em; font-size: 19px; text-decoration: none; color: var(--ink); }
.logo-mark { display: block; width: 17px; height: 30px; flex: none; }
.sn-new { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-s); text-decoration: none; color: var(--cta-ink); background: var(--cta); font-weight: 700; margin-bottom: 8px; }
.sn-new span { font-size: 16px; }
.sn-nav a, .sn-folders a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); text-decoration: none; color: var(--ink-2); font-size: 14.5px; }
.sn-nav a:hover, .sn-folders a:hover { background: var(--surface-2); color: var(--ink); }
.sn-nav a.on, .sn-folders a.on { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.sn-nav .ic, .sn-folders .ic { width: 18px; text-align: center; color: var(--ink-3); }
.sn-folders .cnt { margin-left: auto; }
.sn-sec { display: flex; align-items: center; justify-content: space-between; padding: 16px 10px 4px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sn-add { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.sn-add:hover { background: var(--surface-2); color: var(--ink); }
.sn-fill { flex: 1; min-height: 16px; }
.sn-plan { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px; font-size: 14px; margin-bottom: 8px; }
.sn-up { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 3px 9px; border-radius: 99px; }
.sn-user { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px; border-radius: var(--r-s); cursor: pointer; text-align: left; color: var(--ink); width: 100%; }
.sn-user:hover { background: var(--surface-2); }
.sn-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sn-who b, .sn-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mtop { display: none; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.mtop .sp { flex: 1; }
.burger { border: 0; background: none; font-size: 20px; color: var(--ink); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.logo { font-weight: 750; font-size: 18px; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
#bal { text-decoration: none; }
.scrim { display: none; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 28px 96px; }
.wrap.wide { max-width: none; padding: 0; }
.narrow { max-width: 440px; }

/* ---- карточки и кнопки ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
h1 { font-size: 30px; line-height: 1.12; margin: 0 0 8px; letter-spacing: -.025em; font-weight: 850; }
h2 { font-size: 20px; margin: 0 0 10px; letter-spacing: -.015em; font-weight: 800; }
h3 { font-size: 16px; margin: 0 0 6px; }
.btn {
  min-height: var(--tap); padding: 0 16px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--cta); color: var(--cta-ink); border-color: transparent; font-weight: 700; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--cta) 70%, transparent); }
.btn.primary:hover { background: var(--cta-deep); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: block; width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); }
.field:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.field { min-height: 120px; resize: vertical; line-height: 1.55; }
label.lbl { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 6px; font-weight: 600; }

.note { padding: 10px 12px; border-radius: var(--r-s); font-size: 14px; }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-block; font: 500 11.5px/1.6 var(--f-mono); letter-spacing: .02em; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }

/* ---- вход ---- */
/* Главная: светлый герой — текст сверху, широкая картинка-миниатюра растворяется в фоне страницы. */
.hero { position: relative; padding: 36px 0 0; }
.hero-txt { max-width: 760px; }
.hero h1 { font-size: 56px; line-height: 1.02; letter-spacing: -.035em; font-weight: 900; margin: 14px 0 18px; }
.hero p { color: var(--ink-2); max-width: 580px; margin: 0; font-size: 18px; }
.hero .hero-acts { justify-content: flex-start; margin-top: 26px; }
.hero .hand { position: absolute; right: 8px; top: 64px; max-width: 230px; text-align: right; color: var(--cta-deep); font-size: 26px; transform: rotate(-4deg); }
.hero-txt { position: relative; z-index: 1; }
.hero-art { position: relative; }
.hero-art { display: block; margin: -150px -28px 0; pointer-events: none; }
.hero-art img { display: block; width: 100%; height: auto;
  -webkit-mask: linear-gradient(to bottom, transparent 0, #000 38%, #000 82%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask: linear-gradient(to bottom, transparent 0, #000 38%, #000 82%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 88%, transparent 100%);
          mask-composite: intersect; }
.squig { position: relative; white-space: nowrap; }
.squig::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: -.14em; height: .26em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2, 80 11, 120 6 S 180 3, 198 7' fill='none' stroke='%23e59a45' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.eyebrow { font: 500 11.5px/1.4 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.hand { font-family: var(--f-hand); font-weight: 600; line-height: 1.1; }
.sec-h { margin: 44px 0 14px; }
.sec-h h2 { font-size: 30px; font-weight: 900; letter-spacing: -.03em; margin: 6px 0 0; }
.feat .num { font: 600 13px var(--f-mono); color: var(--accent); display: block; margin-bottom: 10px; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 28px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; font-size: 14px; color: var(--ink-2); }
.hero-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.feat b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- модальное окно (вместо alert/confirm) ---- */
.ov { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 100; padding: 16px; }
.ov .box { background: var(--surface); border-radius: var(--r); padding: 20px; width: min(440px, 100%); box-shadow: var(--shadow); border: 1px solid var(--line); }
.ov .box h3 { font-size: 18px; margin-bottom: 8px; }
.ov .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 120; max-width: calc(100% - 32px); }

/* ---- телефон и планшет: меню выезжает, снизу панель ---- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .mtop { display: flex; }
  .sidenav { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidenav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .wrap { padding: 16px 16px 96px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; text-align: center; text-decoration: none; color: var(--ink-3); font-size: 11px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .tabbar a span { font-size: 19px; line-height: 1; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  .feats { grid-template-columns: 1fr; }
  .hero { padding-top: 12px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 16px; }
  .hero .hand { position: static; display: block; text-align: left; margin-top: 20px; transform: rotate(-2deg); font-size: 23px; max-width: none; }
  .hero-art { margin: 4px -16px 0; }
  .hero-txt { position: static; }
  .sec-h h2 { font-size: 24px; }
  h1 { font-size: 24px; }
  .card { padding: 16px; }
}

/* ---- новая запись ---- */
.new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.new-grid .card + .card { margin-top: 0; }
.dim { opacity: .45; pointer-events: none; }
.rec-ui { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 4px; text-align: center; }
.rec-btn {
  width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition: transform .15s;
}
.rec-btn span { width: 44px; height: 44px; border-radius: 50%; background: var(--rec); transition: all .2s; }
.rec-btn:hover { transform: scale(1.04); }
.rec-btn.live { border-color: color-mix(in srgb, var(--rec) 35%, transparent); animation: pulse 1.6s infinite; }
.rec-btn.live span { width: 34px; height: 34px; border-radius: 8px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rec) 35%, transparent); } 50% { box-shadow: 0 0 0 12px transparent; } }
.rec-time { font-size: 34px; font-weight: 700; letter-spacing: .02em; }
.level { width: 70%; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.level i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .1s; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 190px;
  border: 2px dashed var(--line); border-radius: var(--r); cursor: pointer; text-align: center; padding: 16px;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ic { font-size: 28px; color: var(--accent); }
.pbar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.pbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* ---- список ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.item:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.item-h { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.item-h b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-snip { color: var(--ink-2); font-size: 14px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; padding: 40px 20px; }
.empty-ic { font-size: 40px; }

/* ---- карточка записи ---- */
.rec-head { margin: 8px 0 14px; }
.rec-head h1 { margin-bottom: 4px; }
.editable { cursor: text; }
.editable:hover { text-decoration: underline dotted var(--ink-3); }
.rec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.rec-layout .card + .card { margin-top: 14px; }
.side { position: sticky; top: 72px; }
.tr { font-size: 16px; line-height: 1.65; }
.seg { margin: 0 0 12px; padding: 2px 6px; margin-left: -6px; border-radius: 8px; }
.seg.on { background: var(--accent-soft); }
.tc { border: 0; background: var(--surface-2); color: var(--ink-2); border-radius: 6px; font-size: 12px; padding: 2px 6px; margin-right: 8px; cursor: pointer; vertical-align: 1px; }
.tc:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.tc:disabled { cursor: default; }
.tr-plain { white-space: pre-wrap; }

@media (max-width: 720px) {
  .new-grid { grid-template-columns: 1fr; }
  .rec-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .rec-time { font-size: 30px; }
}

/* ---- вкладки, итоги, чат ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: var(--tap); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:disabled { opacity: .4; cursor: default; }
.cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; text-align: center; }
.tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tpl { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 10px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; min-height: 64px; text-align: center; }
.tpl span { font-size: 20px; }
.tpl:hover { border-color: var(--accent); background: var(--accent-soft); }
.sum { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.sum-h { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.md { line-height: 1.6; }
.md h2, .md h3, .md h4 { margin: 14px 0 6px; font-size: 16px; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 8px; }
.md ul { margin: 0 0 8px; padding-left: 20px; }
.md li { margin-bottom: 4px; }
.chk { color: var(--accent); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }
.chat { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.msg { padding: 10px 14px; border-radius: 14px; max-width: 88%; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-form { display: flex; gap: 8px; }
.ask-form .field { flex: 1; }
.acts-col { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.acts-col .btn { justify-content: flex-start; }
.fmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.fmt-grid .btn { flex-direction: column; min-height: 64px; gap: 0; }
.sh-row { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; margin-bottom: 8px; }
.sh-url { word-break: break-all; margin-bottom: 6px; }
.search { margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 14px; cursor: pointer; min-height: 34px; color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .cnt { background: transparent; color: inherit; }
.chip.ghost { border-style: dashed; color: var(--ink-2); }
mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.tr .tc, .md .tc { cursor: pointer; }
button.badge { border: 0; cursor: pointer; }
@media (max-width: 720px) {
  .tpl-grid { grid-template-columns: repeat(2, 1fr); }
  .msg { max-width: 94%; }
}

/* ---- тарифы ---- */
.big { font-size: 26px; font-weight: 700; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plans .card + .card { margin-top: 0; }
.plan.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.plan-buy { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.price { font-size: 20px; font-weight: 700; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp > div { border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; font-size: 14px; color: var(--ink); }
/* ---- экран владельца ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--ink-2); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--ink-2); font-weight: 600; font-size: 12px; }
.tbl td.num, .tbl th.num { text-align: right; }
.bad-txt { color: var(--bad); font-weight: 600; }
@media (max-width: 720px) {
  .plans, .cmp { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
.legal h2 { font-size: 17px; margin: 18px 0 8px; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { line-height: 1.6; }
.oauth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.oauth { justify-content: flex-start; gap: 10px; }
.oi { width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex: none; }
.oauth.google .oi { background: #4285f4; }
.oauth.yandex .oi { background: #fc3f1d; }
.oauth.telegram .oi { background: #2aabee; }
.oauth.vk .oi { background: #0077ff; font-size: 10px; }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 15px; }
.diar { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.diar input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.spk { font-weight: 700; }
.spk0 { color: var(--accent); } .spk1 { color: #c2410c; } .spk2 { color: var(--ok); } .spk3 { color: #9333ea; } .spk4 { color: #0e7490; } .spk5 { color: #be185d; }
:root[data-theme="dark"] .spk1 { color: #fb923c; } :root[data-theme="dark"] .spk3 { color: #c084fc; } :root[data-theme="dark"] .spk4 { color: #22d3ee; } :root[data-theme="dark"] .spk5 { color: #f472b6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .spk1 { color: #fb923c; } :root:not([data-theme="light"]) .spk3 { color: #c084fc; } :root:not([data-theme="light"]) .spk4 { color: #22d3ee; } :root:not([data-theme="light"]) .spk5 { color: #f472b6; } }

/* ---- карточка записи: две колонки ---- */
.rec2 { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(420px, 1.1fr); min-height: 100vh; }
.rc-left { padding: 20px 24px 80px; border-right: 1px solid var(--line); min-width: 0; }
.rc-right { padding: 18px 24px 40px; min-width: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rc-head { display: flex; align-items: center; gap: 10px; }
.rc-head h1 { flex: 1; min-width: 0; font-size: 20px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-acts { flex: none; }
.icon-btn { border: 1px solid transparent; background: none; color: var(--ink-2); min-width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; font-size: 15px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 8px; }
.chip-s { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }
.chip-s.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; cursor: pointer; }
button.chip-s { font: inherit; font-size: 12.5px; }
.rc-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.rc-meta .sp { flex: 1; }
.seg-tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg-tabs button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.seg-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-tabs button:disabled { opacity: .45; cursor: default; }
.tr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; position: sticky; top: -18px; background: var(--bg); padding: 4px 0 8px; z-index: 2; }
.tr-head .sp { flex: 1; }
.tr-search { width: 220px; min-height: 34px; padding: 6px 10px; font-size: 14px; }
.tr-summary { font-size: 14.5px; line-height: 1.6; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; }
.tr2 { display: flex; flex-direction: column; gap: 10px; }
.tseg { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: start; }
.tseg .tc { margin: 10px 0 0; justify-self: start; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14.5px; line-height: 1.6; }
.tseg.on .tcard { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tcard .spk { display: block; border: 0; background: none; padding: 0; margin-bottom: 2px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.tcard .spk:not([class*="spk"]) { color: var(--accent); }
.tr-foot { margin-top: 18px; }
.linkish { border: 0; background: none; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }
.linkish.danger { color: var(--bad); }
.tpl-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl2 { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--ink); min-height: 64px; }
.tpl2 b { font-size: 14px; }
.tpl2 span { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; width: 100%; }
.tpl2 .x { margin-left: auto; font-style: normal; color: var(--ink-3); padding: 0 4px; }
.tpl2 .x:hover { color: var(--bad); }
.tpl2:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tpl2.dashed { border-style: dashed; background: transparent; }
.chat2 { display: flex; flex-direction: column; gap: 10px; min-height: 300px; max-height: calc(100vh - 330px); overflow-y: auto; margin-bottom: 12px; }
.chat-empty { margin: auto; text-align: center; padding: 30px 10px; }
.chat-empty h2 { font-size: 24px; margin-bottom: 4px; }
.chat-empty .sugg { justify-content: center; margin-top: 16px; flex-direction: column; align-items: center; }
.chip-q { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 14px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.chip-q:hover { color: var(--ink); border-color: var(--accent); }
.empty-box { border: 1px dashed var(--line); border-radius: var(--r); padding: 32px 20px; text-align: center; }
.empty-box h3 { margin-top: 14px; }
.empty-ill { display: inline-flex; flex-direction: column; gap: 6px; }
.empty-ill i { display: block; width: 180px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); position: relative; }
.empty-ill i::before { content: ""; position: absolute; left: 8px; top: 6px; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-3); }
.empty-ill i.on::before { border-color: var(--accent); background: var(--accent-soft); }
.empty-ill i::after { content: ""; position: absolute; left: 30px; right: 30px; top: 11px; height: 3px; border-radius: 2px; background: var(--surface-3); }
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.task.done .ttext > div:first-child { text-decoration: line-through; color: var(--ink-3); }
.tchk { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: none; color: var(--accent-ink); cursor: pointer; flex: none; margin-top: 1px; font-size: 12px; display: grid; place-items: center; }
.task.done .tchk { background: var(--accent); border-color: var(--accent); }
.ttext { flex: 1; min-width: 0; }
.ttext .small { margin-top: 3px; }
@media (max-width: 900px) {
  .rec2 { display: block; min-height: 0; }
  .rc-left { padding: 14px 16px 96px; border-right: 0; }
  .rc-right { display: none; }
  .tr-head { position: static; flex-wrap: wrap; }
  .tr-search { width: 100%; order: 3; }
  .tseg { grid-template-columns: 1fr; gap: 4px; }
  .tseg .tc { margin: 0; }
  .tpl-grid2 { grid-template-columns: 1fr 1fr; }
  .rc-head { flex-wrap: wrap; }
  .rc-head .rc-acts { margin-left: auto; }
  .rc-head h1 { order: 3; flex-basis: 100%; font-size: 19px; white-space: normal; margin-top: 8px; }
  .seg-tabs button { padding: 8px 4px; font-size: 13px; white-space: nowrap; }
  .chat2 { max-height: none; }
}

/* ---- тарифы v2 ---- */
.plans-head { text-align: center; margin-bottom: 20px; }
.plans-head h1 { font-size: 28px; }
.term-sw { display: flex; width: max-content; max-width: 100%; margin-left: auto; margin-right: auto; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-top: 16px; }
.term-sw button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.term-sw button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.pcard.rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 140px); }
.pcard.cur { outline: 2px solid var(--ok); outline-offset: -1px; }
.pc-flag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--cta); color: var(--cta-ink); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.pc-top h3 { font-size: 18px; margin-bottom: 4px; }
.pc-sum { font-size: 30px; font-weight: 750; letter-spacing: -.01em; }
.pc-feat { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; flex: 1; }
.pc-feat li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 8px; }
.cmp-tbl td, .cmp-tbl th { text-align: center; white-space: normal; padding: 12px 14px; }
.cmp-tbl td:first-child, .cmp-tbl th:first-child { text-align: left; color: var(--ink-2); }
.cmp-tbl th { font-size: 14px; color: var(--ink); }
@media (max-width: 900px) {
  .plans-head h1 { font-size: 22px; }
  .term-sw button { padding: 8px 9px; font-size: 13px; }
  .cmp-tbl { font-size: 13px; }
  .cmp-tbl td, .cmp-tbl th { padding: 9px 8px; }
}
.call-box { margin-top: 10px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; }
.link-row2 { display: flex; gap: 8px; margin-top: 10px; }
.link-row2 .field { flex: 1; min-width: 0; }

.empty-art { display: block; margin: 0 auto 6px; width: min(240px, 70%); height: auto;
  -webkit-mask: radial-gradient(closest-side, #000 72%, transparent 100%); mask: radial-gradient(closest-side, #000 72%, transparent 100%); }

/* Картинки-миниатюры: в светлой теме растворяются в фоне, в тёмной — в светлой рамке. */
.art-img, .art img { display: block; width: 100%; height: auto;
  -webkit-mask: radial-gradient(closest-side, #000 70%, transparent 100%); mask: radial-gradient(closest-side, #000 70%, transparent 100%); }
.art img { -webkit-mask: linear-gradient(to right, transparent 0, #000 30%, #000 85%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(to right, transparent 0, #000 30%, #000 85%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%); mask-composite: intersect; }
.start { position: relative; margin-top: 8px; min-height: 520px; display: flex; align-items: center; }
.start-art { position: absolute; left: 22%; right: -28px; top: 0; bottom: 0; margin: auto 0; height: fit-content; display: block; pointer-events: none; }
.start #login-card { position: relative; margin: 0; }
.chat-art { max-width: 340px; margin: 0 auto 6px; }
.login-art { display: block; width: 72px; height: 72px; border-radius: 16px; object-fit: cover; margin-bottom: 12px; }
.two-docs { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; margin-top: 36px; }
.two-docs h2 { font-size: 28px; font-weight: 900; letter-spacing: -.03em; margin: 6px 0 10px; }
.two-docs p { margin: 0 0 10px; }
@media (max-width: 900px) {
  .start { display: block; min-height: 0; }
  .start-art { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 0 -16px 8px; }
  .art img { -webkit-mask: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%); mask: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%); -webkit-mask-composite: source-over; mask-composite: add; }
  .two-docs { grid-template-columns: 1fr; gap: 8px; }
}

/* Тёмная тема: светлые миниатюры растворяются в бирюзе — мягкий эллипс по краям, тонировка поверх,
   чтобы белый фон картинки не слепил, и лёгкий янтарный отсвет. Правила дублируются: системная тёмная и ручная. */
:root[data-theme="dark"] .hero-art, :root[data-theme="dark"] .art { isolation: isolate;
  -webkit-mask: linear-gradient(to bottom, transparent 0, #000 40%, #000 66%, transparent 100%), linear-gradient(to right, transparent 0, #000 22%, #000 80%, transparent 100%); -webkit-mask-composite: source-in;
  mask: linear-gradient(to bottom, transparent 0, #000 40%, #000 66%, transparent 100%), linear-gradient(to right, transparent 0, #000 22%, #000 80%, transparent 100%); mask-composite: intersect; }
:root[data-theme="dark"] .hero-art img, :root[data-theme="dark"] .art img { -webkit-mask: none; mask: none; filter: saturate(1.08) brightness(.94); }
:root[data-theme="dark"] .hero-art::after, :root[data-theme="dark"] .art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(4,36,45,.62) 0%, rgba(14,75,90,.30) 45%, rgba(229,154,69,.12) 100%); }
:root[data-theme="dark"] .art-img, :root[data-theme="dark"] .empty-art { filter: brightness(.8) saturate(1.1);
  -webkit-mask: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.85) 35%, rgba(0,0,0,.4) 70%, transparent 100%); mask: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.85) 35%, rgba(0,0,0,.4) 70%, transparent 100%); }
:root[data-theme="dark"] .login-art { filter: brightness(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-art, :root:not([data-theme="light"]) .art { isolation: isolate;
    -webkit-mask: linear-gradient(to bottom, transparent 0, #000 40%, #000 66%, transparent 100%), linear-gradient(to right, transparent 0, #000 22%, #000 80%, transparent 100%); -webkit-mask-composite: source-in;
  mask: linear-gradient(to bottom, transparent 0, #000 40%, #000 66%, transparent 100%), linear-gradient(to right, transparent 0, #000 22%, #000 80%, transparent 100%); mask-composite: intersect; }
  :root:not([data-theme="light"]) .hero-art img, :root:not([data-theme="light"]) .art img { -webkit-mask: none; mask: none; filter: saturate(1.08) brightness(.94); }
  :root:not([data-theme="light"]) .hero-art::after, :root:not([data-theme="light"]) .art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, rgba(4,36,45,.62) 0%, rgba(14,75,90,.30) 45%, rgba(229,154,69,.12) 100%); }
  :root:not([data-theme="light"]) .art-img, :root:not([data-theme="light"]) .empty-art { filter: brightness(.8) saturate(1.1);
    -webkit-mask: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.85) 35%, rgba(0,0,0,.4) 70%, transparent 100%); mask: radial-gradient(closest-side, #000 0%, rgba(0,0,0,.85) 35%, rgba(0,0,0,.4) 70%, transparent 100%); }
  :root:not([data-theme="light"]) .login-art { filter: brightness(.9); }
}

/* Публичные страницы (оферта, политика, тарифы, «поделиться»): шапка с логотипом. */
header.top { border-bottom: 1px solid var(--line); background: var(--surface); }
header.top .top-in { max-width: 820px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
header.top .sp { flex: 1; }
.legal p, .legal li { line-height: 1.6; }

/* ---- меню (06.10.2026): блок «Записать» + задача голосом, подписи разделов моноширинным, тариф — счётчиком ---- */
.sn-acts { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 6px; }
.sn-rec { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); text-decoration: none;
  color: var(--cta-ink); background: var(--cta); box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--cta) 80%, transparent); }
.sn-rec:hover { background: var(--cta-deep); }
.sn-rec b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.sn-rec small { display: block; font-size: 11.5px; color: rgba(4,36,45,.72); }
.sn-rec .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--rec); flex: none; box-shadow: 0 0 0 3px #fff; }
.sn-voice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.sn-voice svg { color: var(--cta-deep); width: 18px; height: 18px; }
.sn-voice:hover { border-color: var(--cta); }
.sn-sec { font: 500 10.5px/1.4 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 4px; }
.sn-nav a.on { box-shadow: inset 2px 0 0 var(--cta); border-radius: 0 var(--r-s) var(--r-s) 0; }
.sn-meter { display: block; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); padding: 14px 8px 12px; margin-bottom: 4px; }
.sn-meter:hover .sn-more { color: var(--ink); }
.sn-meter .eyebrow { display: block; font-size: 10.5px; letter-spacing: .16em; }
.sn-big { display: block; margin: 6px 0 8px; font-size: 13px; color: var(--ink-2); }
.sn-big b { font: 600 22px/1 var(--f-mono); color: var(--ink); letter-spacing: -.02em; margin-right: 4px; }
.sn-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.sn-bar i { display: block; height: 100%; width: 0; background: var(--cta); border-radius: 2px; transition: width .3s; }
.sn-more { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); }

/* ---- быстрая задача ---- */
.qt { margin-bottom: 4px; }
.qt-row { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 8px; }
.qt-mic { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; font-size: 17px; background: var(--cta); color: var(--cta-ink); display: grid; place-items: center; }
.qt-mic.on { background: var(--rec); color: #fff; animation: qt-pulse 1.2s infinite; }
@keyframes qt-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(214,69,69,.45); } 50% { box-shadow: 0 0 0 8px rgba(214,69,69,0); } }
textarea.field.qt-x { flex: 1; height: 46px; min-height: 46px; resize: none; line-height: 1.45; padding-top: 11px; }
.qt-row .btn { min-height: 46px; }
.qt-d { display: grid; grid-template-columns: 22px 1fr 160px 150px; gap: 8px; align-items: center; margin-bottom: 6px; }
.qt-d .field { min-height: 38px; padding: 6px 10px; }
.qt-on { width: 18px; height: 18px; accent-color: var(--cta); }
.due.late { color: var(--bad); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }
@media (max-width: 720px) {
  .qt-row { flex-wrap: wrap; }
  .qt-x { flex-basis: calc(100% - 54px); }
  .qt-row .btn { width: 100%; }
  .qt-d { grid-template-columns: 22px 1fr; }
  .qt-d .qt-a, .qt-d .qt-due { grid-column: 2; }
}

.howto { margin: 10px 0 0; padding-left: 20px; }
.howto li { margin-bottom: 8px; line-height: 1.5; }
.howto-mic { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); font-size: 14px; line-height: 1.45; cursor: pointer; }
.howto-mic input { margin-top: 3px; accent-color: var(--cta); }
