/* Spark Chat — chat.kidion.ru
   Geist font, oklch colors, per-character tints.
   Namespace: .sc-* (spark chat) */

/* ============ Design tokens ============ */
:root {
  /* Surfaces */
  --bg:           oklch(0.985 0.003 255);
  --surface:      #ffffff;
  --surface-2:    oklch(0.972 0.004 255);
  --surface-3:    oklch(0.955 0.005 255);

  /* Borders */
  --border:        oklch(0.92 0.006 255);
  --border-strong: oklch(0.86 0.010 255);

  /* Ink */
  --text:    oklch(0.22 0.015 260);
  --text-2:  oklch(0.46 0.012 260);
  --text-3:  oklch(0.62 0.010 260);
  --text-4:  oklch(0.74 0.008 260);

  /* Font */
  --font: "Geist", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", monospace;

  /* Spark accent — violet & ember */
  --spark-violet:        oklch(0.50 0.21 295);
  --spark-violet-ink:    oklch(0.34 0.17 295);
  --spark-violet-soft:   oklch(0.96 0.030 295);
  --spark-violet-softer: oklch(0.985 0.014 295);
  --spark-violet-border: oklch(0.88 0.050 295);
  --spark-grad: linear-gradient(135deg, oklch(0.50 0.21 295) 0%, oklch(0.55 0.20 318) 45%, oklch(0.68 0.18 38) 100%);

  /* Owl — wise, amber */
  --owl-accent:  oklch(0.62 0.14 70);
  --owl-ink:     oklch(0.42 0.13 60);
  --owl-soft:    oklch(0.965 0.030 75);
  --owl-border:  oklch(0.88 0.060 70);
  --owl-grad: linear-gradient(135deg, oklch(0.60 0.14 70) 0%, oklch(0.55 0.15 45) 100%);

  /* Captain — navy */
  --cap-accent:  oklch(0.50 0.14 245);
  --cap-ink:     oklch(0.34 0.13 245);
  --cap-soft:    oklch(0.965 0.028 240);
  --cap-border:  oklch(0.87 0.055 245);
  --cap-grad: linear-gradient(135deg, oklch(0.50 0.14 245) 0%, oklch(0.55 0.14 200) 100%);

  /* Pixie — coral pink */
  --pix-accent:  oklch(0.65 0.18 0);
  --pix-ink:     oklch(0.46 0.17 0);
  --pix-soft:    oklch(0.965 0.030 5);
  --pix-border:  oklch(0.88 0.060 0);
  --pix-grad: linear-gradient(135deg, oklch(0.65 0.18 0) 0%, oklch(0.70 0.17 20) 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ============ Character tint application ============ */
.sc[data-char="spark"]   { --c-accent: var(--spark-violet);    --c-ink: var(--spark-violet-ink);
                           --c-soft:   var(--spark-violet-soft); --c-border: var(--spark-violet-border);
                           --c-grad:   var(--spark-grad); }
.sc[data-char="owl"]     { --c-accent: var(--owl-accent);  --c-ink: var(--owl-ink);
                           --c-soft:   var(--owl-soft);    --c-border: var(--owl-border);
                           --c-grad:   var(--owl-grad); }
.sc[data-char="captain"] { --c-accent: var(--cap-accent);  --c-ink: var(--cap-ink);
                           --c-soft:   var(--cap-soft);    --c-border: var(--cap-border);
                           --c-grad:   var(--cap-grad); }
.sc[data-char="pixie"]   { --c-accent: var(--pix-accent);  --c-ink: var(--pix-ink);
                           --c-soft:   var(--pix-soft);    --c-border: var(--pix-border);
                           --c-grad:   var(--pix-grad); }

/* ============ Shell ============ */
html, body { margin: 0; padding: 0; background: var(--bg); }
html.chat-page, html.chat-page body { height: 100vh; height: 100dvh; overflow: hidden; }

.sc {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.sc * { box-sizing: border-box; }
.sc button { font-family: inherit; cursor: pointer; }

/* ============ Top nav ============ */
.sc-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}
.sc-nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px;
  letter-spacing: -0.022em;
  text-decoration: none;
  color: var(--text);
}
.sc-nav-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--spark-grad);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 16px;
  box-shadow: inset 0 -3px 8px rgba(0,0,0,0.15), 0 1px 2px rgba(70,40,110,0.20);
  position: relative; overflow: hidden;
}
.sc-nav-mark::after {
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 4px; height: 4px; background: white; border-radius: 50%;
  opacity: 0.85; box-shadow: 0 0 6px rgba(255,255,255,0.6);
}
.sc-nav-right { display: flex; align-items: center; gap: 10px; }
.sc-nav-quota {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2);
  padding: 5px 10px 5px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sc-nav-quota-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-accent, var(--spark-violet));
}
.sc-nav-quota strong { color: var(--text); font-weight: 600; }
.sc-nav-pro {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: var(--spark-grad);
  color: white;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  border: 0;
  box-shadow: 0 1px 2px rgba(70,40,110,0.25);
}
.sc-nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 13px; color: var(--text-2);
}

/* Hide some nav elements on mobile */
@media (max-width: 768px) {
  .sc-nav-quota { display: none; }
}

/* ============ Layout ============ */
.sc-body {
  flex: 1 1 0;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ============ Sidebar (desktop) ============ */
.sc-side {
  width: 304px;
  flex: 0 0 304px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 0;
}
@media (max-width: 768px) {
  .sc-side { display: none; }
}

.sc-side-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.sc-side-title {
  margin: 0 0 2px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
.sc-side-h {
  margin: 0;
  font-size: 19px; font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.sc-side-list {
  flex: 1;
  overflow: auto;
  padding: 8px 8px 16px;
  list-style: none;
  margin: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.sc-side-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.sc-side-item:hover { background: var(--surface-2); }
.sc-side-item.is-active {
  background: var(--c-soft);
  border-color: var(--c-border);
}
.sc-side-item.is-active::before {
  content: "";
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 28px;
  border-radius: 3px;
  background: var(--c-accent);
}
.sc-side-av-wrap {
  position: relative;
  flex: 0 0 40px;
}
.sc-side-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.sc-side-av img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transform: scale(1.08); }
.sc-side-av svg { width: 100%; height: 100%; }
.sc-side-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: oklch(0.65 0.16 158);
  border: 2px solid var(--surface);
}
.sc-side-item.is-active .sc-side-dot { border-color: var(--c-soft); }
.sc-side-info {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.sc-side-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.sc-side-name {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-side-msg {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-side-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.sc-side-tag {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.sc-side-tag.is-free { background: oklch(0.96 0.04 158); color: oklch(0.42 0.11 158); }
.sc-side-tag.is-pro  { background: var(--spark-violet-soft); color: var(--spark-violet-ink); }

/* Sidebar footer */
.sc-side-foot {
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text-2);
}
.sc-side-foot-av {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 12px;
}
.sc-side-foot-name { font-weight: 600; color: var(--text); font-size: 13px; line-height: 1.2; }
.sc-side-foot-sub { font-size: 11.5px; color: var(--text-3); }

/* ============ Main chat column ============ */
.sc-main {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Conversation header */
.sc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
  position: relative;
}
.sc-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--c-grad);
  opacity: 0.95;
}
@media (min-width: 769px) {
  .sc-head { padding: 14px 22px; }
}
.sc-head-back {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  padding: 0;
}
@media (min-width: 769px) {
  .sc-head-back { display: none; }
}
.sc-head-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  flex: 0 0 40px;
}
.sc-head-av img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transform: scale(1.08); }
.sc-head-av svg { width: 100%; height: 100%; }
.sc-head-info { flex: 1; min-width: 0; }
.sc-head-name {
  margin: 0;
  font-size: 15.5px; font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.2;
  display: inline-flex; align-items: center; gap: 6px;
}
.sc-head-role {
  font-size: 11px;
  color: var(--c-ink);
  background: var(--c-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 500;
}
.sc-head-status {
  margin: 1px 0 0;
  font-size: 12px;
  color: oklch(0.52 0.12 158);
  display: inline-flex; align-items: center; gap: 6px;
}
.sc-head-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: oklch(0.62 0.14 158);
  box-shadow: 0 0 0 2px oklch(0.96 0.05 158);
}
.sc-head-actions { display: flex; gap: 6px; }
.sc-head-action {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: inline-grid; place-items: center;
  padding: 0;
}
.sc-head-action:hover { background: var(--surface-2); color: var(--text); }

/* ============ Messages area ============ */
.sc-msgs {
  flex: 1;
  overflow: auto;
  padding: 22px 18px 16px;
  display: flex; flex-direction: column;
  gap: 4px;
  min-height: 0;
}
@media (min-width: 769px) {
  .sc-msgs { padding: 26px 28px 18px; max-width: 820px; width: 100%; margin: 0 auto; }
}

.sc-day {
  align-self: center;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  margin: 6px 0 14px;
  letter-spacing: 0.02em;
}

/* Bubble row */
.sc-row {
  display: flex; align-items: flex-end; gap: 8px;
  max-width: 100%;
  margin-bottom: 4px;
}
.sc-row.is-user { justify-content: flex-end; }
.sc-row-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: 0 0 30px;
  visibility: hidden;
}
.sc-row-av.is-show { visibility: visible; }
.sc-row-av img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transform: scale(1.08); }
.sc-row-av svg { width: 100%; height: 100%; }

.sc-stack { display: flex; flex-direction: column; gap: 3px; max-width: 76%; }
@media (min-width: 769px) {
  .sc-stack { max-width: 64%; }
}
.sc-row.is-user .sc-stack { align-items: flex-end; }

.sc-bub {
  font-size: 14.5px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(15,18,35,0.02);
  animation: sc-bub-in .28s cubic-bezier(.2,.7,.3,1) backwards;
  word-wrap: break-word;
}
.sc-bub strong { font-weight: 600; }
.sc-bub em { font-style: italic; color: var(--text-2); }
.sc-bub-bot { border-bottom-left-radius: 6px; }
.sc-bub-user {
  background: var(--c-grad);
  color: white;
  border-color: transparent;
  border-bottom-right-radius: 6px;
  box-shadow: 0 2px 6px -2px color-mix(in oklch, var(--c-accent) 40%, transparent);
}
.sc-bub-user strong { color: white; }

.sc-bub-img {
  padding: 4px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}
.sc-bub-img img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 14px;
  display: block;
}
.sc-bub-cap {
  padding: 8px 14px 10px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.4;
}

.sc-time {
  font-size: 10.5px;
  color: var(--text-3);
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}

/* Typing indicator */
.sc-typing {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  padding: 13px 16px;
}
.sc-typing-dots { display: inline-flex; gap: 3px; }
.sc-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-accent);
  opacity: 0.4;
  animation: sc-dot 1.2s ease-in-out infinite;
}
.sc-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.sc-typing-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes sc-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

@keyframes sc-bub-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Followup chips */
.sc-followups {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px;
  margin-left: 38px;
  margin-bottom: 6px;
}
.sc-followup {
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-soft);
  color: var(--c-ink);
  font-weight: 500;
  transition: background .12s;
}
.sc-followup:hover { background: color-mix(in oklch, var(--c-soft) 65%, var(--c-accent) 12%); }

/* ============ Empty state ============ */
.sc-empty {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 60px;
  text-align: center;
  gap: 18px;
  position: relative;
}
.sc-empty::before {
  content: "";
  position: absolute;
  top: 30px; left: 50%;
  transform: translateX(-50%);
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-soft) 0%, transparent 65%);
  z-index: 0;
  opacity: 0.9;
}
.sc-empty > * { position: relative; z-index: 1; }
.sc-empty-av {
  width: 100px; height: 100px;
  flex: 0 0 100px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--c-border);
  box-shadow:
    0 8px 24px -8px color-mix(in oklch, var(--c-accent) 50%, transparent),
    inset 0 0 0 4px var(--surface);
}
.sc-empty-av img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transform: scale(1.10); }
.sc-empty-av svg { width: 100%; height: 100%; display: block; }
.sc-empty-greet {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  max-width: 22ch;
}
@media (min-width: 769px) {
  .sc-empty-greet { font-size: 26px; }
}
.sc-empty-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 32ch;
}
.sc-empty-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
  max-width: 380px;
}
@media (min-width: 769px) {
  .sc-empty-chips { grid-template-columns: repeat(2, minmax(140px, 200px)); max-width: 460px; }
}
.sc-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  font-weight: 500;
  transition: border-color .12s, transform .08s, box-shadow .12s;
  cursor: pointer;
}
.sc-chip:hover {
  border-color: var(--c-border);
  box-shadow: 0 4px 14px -6px color-mix(in oklch, var(--c-accent) 35%, transparent);
  transform: translateY(-1px);
}
.sc-chip-ico {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--c-soft);
  color: var(--c-ink);
  display: grid; place-items: center;
  flex: 0 0 28px;
  font-size: 14px;
}

/* ============ Composer ============ */
.sc-comp {
  flex: 0 0 auto;
  padding: 8px 16px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
@media (min-width: 769px) {
  .sc-comp { padding: 10px 28px 18px; }
}
.sc-quota {
  font-size: 11.5px;
  color: var(--text-3);
  text-align: center;
  margin: 0 0 8px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.sc-quota strong { color: var(--text-2); font-weight: 600; }
.sc-quota-bar {
  width: 80px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.sc-quota-bar > i {
  display: block;
  height: 100%;
  background: var(--c-grad);
  border-radius: 999px;
}

.sc-attach {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 10px;
  border-radius: 12px;
  background: var(--c-soft);
  border: 1px solid var(--c-border);
  font-size: 12.5px;
  color: var(--c-ink);
  margin-bottom: 8px;
  max-width: max-content;
}
.sc-attach-name { font-weight: 500; }
.sc-attach-rm {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--c-border);
  color: var(--c-ink);
  display: inline-grid; place-items: center;
  padding: 0;
}

.sc-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color .12s, background .12s;
}
.sc-bar:focus-within {
  border-color: var(--c-border);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--c-soft);
}
.sc-bar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--text-2);
  display: inline-grid; place-items: center;
  flex: 0 0 36px;
  position: relative;
}
.sc-bar-btn:hover { background: var(--surface); color: var(--text); }
.sc-bar-btn.is-locked { color: var(--text-4); }
.sc-bar-btn.is-locked::after {
  content: "";
  position: absolute;
  top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--spark-violet);
  border: 1.5px solid var(--surface-2);
}
.sc-bar-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  letter-spacing: -0.005em;
  min-width: 0;
}
.sc-bar-input::placeholder { color: var(--text-3); }
.sc-bar-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--c-grad);
  color: white;
  border: 0;
  display: inline-grid; place-items: center;
  flex: 0 0 38px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 2px 6px -1px color-mix(in oklch, var(--c-accent) 45%, transparent);
}
.sc-bar-send.is-disabled {
  background: var(--surface-3);
  color: var(--text-4);
  box-shadow: none;
}
.sc-bar-send:hover:not(.is-disabled) { filter: brightness(1.05); }

.sc-comp-hint {
  margin: 8px 4px 0;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

/* ============ Mobile tab bar ============ */
.sc-tabs {
  display: none;
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 768px) {
  .sc-tabs { display: flex; }
}
.sc-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 6px 4px 4px;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px; font-weight: 500;
  color: var(--text-3);
  border-radius: 10px;
  text-decoration: none;
}
.sc-tab.is-active { color: var(--c-ink); }
.sc-tab-ico {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  color: inherit;
}
.sc-tab.is-active .sc-tab-ico {
  background: var(--c-soft);
  border-radius: 8px;
}

/* ============ Mobile drawer ============ */
.sc-drawer {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: none; flex-direction: column;
  z-index: 4;
}
.sc-drawer.is-open { display: flex; }
.sc-drawer-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
}
.sc-drawer-h {
  margin: 0;
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.022em;
}
.sc-drawer-close {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: inline-grid; place-items: center;
  padding: 0;
}
.sc-drawer-list {
  flex: 1;
  overflow: auto;
  padding: 12px 14px 18px;
  display: flex; flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
}
.sc-drawer-item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.sc-drawer-item.is-active {
  background: var(--c-soft);
  border-color: var(--c-border);
}
.sc-drawer-item.is-locked { opacity: 0.7; }
.sc-drawer-av {
  width: 54px; height: 54px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: 0 0 54px;
}
.sc-drawer-av img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; transform: scale(1.08); }
.sc-drawer-av svg { width: 100%; height: 100%; }
.sc-drawer-info { flex: 1; min-width: 0; }
.sc-drawer-name {
  margin: 0;
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.2;
}
.sc-drawer-role {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 500;
  margin: 2px 0 0;
}
.sc-drawer-quote {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.4;
}
.sc-drawer-check {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-accent);
  color: white;
  display: grid; place-items: center;
}
.sc-drawer-item:not(.is-active) .sc-drawer-check { display: none; }

/* ============ Voice overlay ============ */
.sc-voice {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
  z-index: 5;
}
.sc-voice.is-open { display: flex; }
.sc-voice-pulse {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: var(--c-grad);
  display: grid; place-items: center;
  color: white;
  position: relative;
  animation: sc-pulse 1.4s ease-in-out infinite;
}
@keyframes sc-pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.04); }
}
.sc-voice-h {
  margin: 0;
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.022em;
}
.sc-voice-sub { margin: 0; font-size: 13.5px; color: var(--text-2); }
.sc-voice-actions { display: flex; gap: 10px; }
.sc-voice-stop {
  height: 44px; padding: 0 22px;
  border-radius: 22px;
  background: var(--c-grad);
  color: white;
  border: 0;
  font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.sc-voice-cancel {
  height: 44px; padding: 0 18px;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}
