/* MeetMind — futuristic, glassy, mobile-first */
:root {
  --bg: #060913;
  --bg2: #0b1020;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --panel-solid: #0f1527;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e8ecf7;
  --muted: #8b95b1;
  --dim: #5b6582;
  --a1: #22d3ee;
  --a2: #8b5cf6;
  --a3: #f472b6;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a3));
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(139, 92, 246, 0.35), 0 8px 30px rgba(34, 211, 238, 0.18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5fb;
  --bg2: #e9edf7;
  --panel: rgba(255, 255, 255, 0.75);
  --panel-2: rgba(255, 255, 255, 0.95);
  --panel-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.09);
  --line-2: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --muted: #55607a;
  --dim: #8a93a8;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--a1); text-decoration: none; }
::selection { background: rgba(139, 92, 246, 0.4); }

svg.ico { width: 18px; height: 18px; flex-shrink: 0; }
h3 svg.ico { width: 15px; height: 15px; }
.blist .ico, .small .ico { width: 14px; height: 14px; }

/* Ambient background */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.22; animation: drift 26s ease-in-out infinite alternate;
}
.aurora::before { background: radial-gradient(circle, var(--a2), transparent 60%); top: -30vmax; left: -20vmax; }
.aurora::after { background: radial-gradient(circle, var(--a1), transparent 60%); bottom: -35vmax; right: -25vmax; animation-delay: -10s; }
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%);
}
:root[data-theme="light"] .aurora::before, :root[data-theme="light"] .aurora::after { opacity: 0.14; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.1); } }

/* Layout */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: 264px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; height: 100dvh;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  backdrop-filter: blur(20px);
}
.main { flex: 1; min-width: 0; padding: 26px clamp(16px, 4vw, 44px) 120px; max-width: 1180px; margin: 0 auto; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.logo {
  width: 34px; height: 34px; border-radius: 11px; background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.55); flex-shrink: 0;
}
.logo svg { width: 20px; height: 20px; color: #fff; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted);
  cursor: pointer; border: 1px solid transparent; transition: 0.15s; font-weight: 500; background: none; width: 100%; text-align: left;
}
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active { color: var(--text); background: var(--panel-2); border-color: var(--line); box-shadow: inset 3px 0 0 var(--a2); }
.nav-item .ico { width: 19px; height: 19px; }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--dim); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); padding: 16px 12px 6px; display: flex; align-items: center; justify-content: space-between; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sidebar .spacer { flex: 1; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(34,211,238,.25), rgba(139,92,246,.35)); border: 1px solid var(--line-2);
}
.me-card .meta { min-width: 0; flex: 1; }
.me-card .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .meta span { font-size: 12px; color: var(--muted); }

/* Mobile chrome */
.topbar, .tabbar { display: none; }
@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { padding: calc(72px + var(--safe-t)) 14px calc(110px + var(--safe-b)); }
  .topbar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 40; align-items: center; gap: 10px;
    padding: calc(10px + var(--safe-t)) 14px 10px; background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; font-size: 17px; flex: 1; }
  .topbar .logo { width: 30px; height: 30px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    padding: 8px 8px calc(8px + var(--safe-b)); background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); background: none; border: 0; padding: 6px 0; cursor: pointer; }
  .tab .ico { width: 22px; height: 22px; }
  .tab.active { color: var(--text); }
  .tab.active .ico { color: var(--a1); filter: drop-shadow(0 0 6px rgba(34,211,238,.6)); }
  .tab-rec { position: relative; top: -18px; }
  .tab-rec .orb {
    width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--grad);
    box-shadow: 0 0 0 5px var(--bg), 0 0 30px rgba(139, 92, 246, 0.7); color: #fff;
  }
  .tab-rec .orb .ico { width: 26px; height: 26px; color: #fff; filter: none; }
}

/* Typography */
h1 { font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { justify-content: space-between; }
.hide { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* Glass */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  backdrop-filter: blur(16px) saturate(1.2); box-shadow: var(--shadow);
}
.card.tight { padding: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: rgba(139,92,246,.6); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4); }
.btn.primary:hover { box-shadow: 0 8px 32px rgba(139, 92, 246, 0.6); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel); border-color: var(--line); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn.lg { height: 50px; font-size: 16px; border-radius: 14px; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.22); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
:root[data-theme="light"] .input { background: #fff; }
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--a2); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.search {
  position: relative; flex: 1; min-width: 200px; max-width: 520px;
}
.search .ico { position: absolute; left: 14px; top: 12px; width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 42px; border-radius: 14px; }
.search kbd { position: absolute; right: 10px; top: 10px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }

.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); cursor: pointer; transition: 0.2s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; top: 2px; left: 2px; border-radius: 50%; background: var(--muted); transition: 0.2s; }
.switch input:checked + span { background: var(--grad); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }

/* Chips / badges */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  cursor: pointer; white-space: nowrap; font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px;
}
.chip.active { color: var(--text); border-color: rgba(139, 92, 246, 0.7); background: rgba(139, 92, 246, 0.16); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; border-radius: 99px; background: rgba(34, 211, 238, 0.1); color: var(--a1); border: 1px solid rgba(34, 211, 238, 0.25); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.badge.bad { color: var(--bad); border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.08); }
.badge.live { color: var(--a1); border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.08); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { padding: 14px 16px; }
.stat b { font-size: 24px; letter-spacing: -0.02em; display: block; }
.stat span { font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Meeting list */
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin: 24px 4px 10px; font-weight: 600; }
.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .mlist { grid-template-columns: 1fr; gap: 10px; } }
.mcard {
  position: relative; cursor: pointer; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; overflow: hidden;
}
.mcard::before { content: ""; position: absolute; inset: 0; background: var(--grad); opacity: 0; transition: opacity 0.25s; z-index: -1; }
.mcard:hover { transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.5); box-shadow: var(--glow); }
.mcard .title { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard .overview { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.mcard .foot { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--dim); flex-wrap: wrap; }
.mcard .foot .ico { width: 14px; height: 14px; }
.mcard .pin { position: absolute; top: 12px; right: 12px; color: var(--warn); width: 16px; height: 16px; }
.mcard .match { font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.25); color: var(--text); }
.mcard .match mark { background: rgba(34, 211, 238, 0.3); color: inherit; border-radius: 3px; padding: 0 2px; }
.progress { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width 0.6s; position: relative; }
.progress i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big-ico { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 24px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); }
.empty .big-ico .ico { width: 34px; height: 34px; color: var(--a2); }
.empty h2 { color: var(--text); margin-bottom: 6px; }

/* Meeting detail */
.detail-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.detail-head .title-input {
  font-size: clamp(22px, 3.6vw, 30px); font-weight: 700; letter-spacing: -0.03em; border: 0; background: transparent; width: 100%;
  outline: none; padding: 2px 0; border-bottom: 1px dashed transparent; line-height: 1.2;
}
.detail-head .title-input:focus { border-bottom-color: var(--line-2); }
.detail-head .title-input[contenteditable="true"] { cursor: text; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13px; margin-top: 6px; align-items: center; }
.meta-row .ico { width: 15px; height: 15px; }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 8px; z-index: 20; backdrop-filter: blur(20px); }
@media (max-width: 899px) { .tabs { top: calc(64px + var(--safe-t)); } }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1; min-width: max-content; height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13.5px; }
.tabs button .ico { width: 16px; height: 16px; }
.tabs button.active { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset, 0 4px 14px rgba(0,0,0,.25); }
.tabs button .n { font-size: 11px; padding: 0 6px; border-radius: 99px; background: rgba(139,92,246,.25); color: var(--text); }

.sum-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 899px) { .sum-grid { grid-template-columns: 1fr; } }
.overview-card { background: linear-gradient(135deg, rgba(34,211,238,.08), rgba(139,92,246,.1)); border-color: rgba(139,92,246,.3); }
.overview-card p { margin: 0; font-size: 15.5px; line-height: 1.7; }
.blist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.blist li { position: relative; padding-left: 20px; font-size: 14.5px; }
.blist li::before { content: ""; position: absolute; left: 3px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--grad); transform: rotate(45deg); }
.blist.decisions li::before { background: var(--ok); border-radius: 50%; transform: none; }
.blist.risks li::before { background: var(--bad); }
.ts { font-family: var(--mono); font-size: 11.5px; color: var(--a1); background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.25); padding: 0 6px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ts:hover { background: rgba(34,211,238,.22); }
.topics { display: flex; flex-wrap: wrap; gap: 6px; }

/* Transcript */
.tx-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.speakers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.spk { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; cursor: pointer; }
.spk i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 700; color: #0b0f1a; }
.spk .sugg { font-size: 11px; color: var(--a1); }
.seg { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s; }
.seg:hover { background: var(--panel); }
.seg.now { background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.35); }
.seg .t { font-family: var(--mono); font-size: 12px; color: var(--dim); padding-top: 2px; cursor: pointer; }
.seg .t:hover { color: var(--a1); }
.seg .who { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.seg .txt { font-size: 14.8px; line-height: 1.65; outline: none; border-radius: 6px; }
.seg .txt[contenteditable="true"] { background: rgba(0,0,0,.2); padding: 4px 6px; box-shadow: 0 0 0 1px var(--a2); }
.seg mark { background: rgba(251, 191, 36, 0.35); color: inherit; border-radius: 3px; }
@media (max-width: 520px) { .seg { grid-template-columns: 1fr; gap: 2px; padding: 10px 8px; } }

/* Actions */
.act { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: 0; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); flex-shrink: 0; cursor: pointer; display: grid; place-items: center; background: transparent; margin-top: 1px; padding: 0; }
.check.on { background: var(--grad); border-color: transparent; }
.check .ico { width: 14px; height: 14px; color: #fff; display: none; }
.check.on .ico { display: block; }
.act .body { flex: 1; min-width: 0; }
.act .body .txt { font-size: 14.5px; }
.act.done .txt { text-decoration: line-through; color: var(--dim); }
.act .sub { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.act .sub span { display: inline-flex; align-items: center; gap: 4px; }
.act .sub .ico { width: 13px; height: 13px; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 300px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; }
.msg code { font-family: var(--mono); font-size: 12.5px; background: rgba(0,0,0,.25); padding: 1px 5px; border-radius: 5px; }
.msg h4 { margin: 8px 0 4px; font-size: 14px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-input { position: sticky; bottom: 92px; display: flex; gap: 8px; padding: 8px; border-radius: 18px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); margin-top: 14px; }
@media (max-width: 899px) { .chat-input { bottom: calc(160px + var(--safe-b)); } }
.chat-input textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; padding: 9px 8px; max-height: 140px; min-height: 40px; height: 40px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 50% { transform: translateY(-5px); opacity: .5; } }

/* Player (sticky bottom) */
.player {
  position: fixed; left: 264px; right: 0; bottom: 0; z-index: 30; padding: 10px clamp(14px, 3vw, 30px) calc(12px + var(--safe-b));
  background: color-mix(in srgb, var(--panel-solid) 85%, transparent); backdrop-filter: blur(22px) saturate(1.4); border-top: 1px solid var(--line-2);
}
@media (max-width: 899px) { .player { left: 0; bottom: calc(66px + var(--safe-b)); padding-bottom: 26px; } .meta-row { font-size: 12.5px; gap: 6px 12px; } }
.player .inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.player .play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 20px rgba(139,92,246,.55); flex-shrink: 0; }
.player .play .ico { width: 22px; height: 22px; }
.player .time { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 88px; text-align: center; }
.scrub { position: relative; flex: 1; height: 34px; cursor: pointer; display: flex; align-items: center; touch-action: none; }
.scrub .bar { position: absolute; left: 0; right: 0; height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.scrub .fill { height: 100%; background: var(--grad); width: 0; }
.scrub .knob { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px var(--a2); transform: translateX(-50%); left: 0; }
.scrub .mark { position: absolute; top: 5px; width: 2px; height: 8px; background: var(--warn); border-radius: 2px; }
.player .speed { font-family: var(--mono); font-size: 12px; min-width: 44px; }
@media (max-width: 520px) { .player .hide-sm { display: none; } .player .time { min-width: 0; font-size: 11px; } }

/* Recorder */
.rec-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding-top: 4px; }
@media (max-width: 899px) { .rec-wrap > div:first-child p { display: none; } .rec-wrap { gap: 12px; } }
.rec-stage { position: relative; width: min(64vw, 340px, 42vh); aspect-ratio: 1; display: grid; place-items: center; }
.rec-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rec-core {
  position: relative; width: 44%; aspect-ratio: 1; border-radius: 50%; background: var(--grad); display: grid; place-items: center; border: 0; cursor: pointer;
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.6), inset 0 0 30px rgba(255,255,255,.25); transition: transform .2s; color: #fff;
}
.rec-core:active { transform: scale(.95); }
.rec-core .ico { width: 38%; height: 38%; }
.rec-core.recording { background: radial-gradient(circle at 35% 30%, #ff8aa5, #e11d48 70%); box-shadow: 0 0 70px rgba(225, 29, 72, 0.6), inset 0 0 30px rgba(255,255,255,.25); }
.rec-timer { font-family: var(--mono); font-size: clamp(40px, 10vw, 56px); letter-spacing: 0.04em; font-weight: 500; }
.rec-controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rec-form { width: 100%; max-width: 520px; text-align: left; }
.bm-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 520px; }

.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 28px 18px; text-align: center; cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--a2); background: rgba(139,92,246,.08); }
.dropzone .ico { width: 34px; height: 34px; color: var(--a1); margin-bottom: 8px; }

/* Modal / sheet */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 15, 0.6); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .15s; }
.modal { width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: rise .2s; }
.modal.wide { max-width: 640px; }
.modal h2 { margin-bottom: 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 600px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: calc(22px + var(--safe-b)); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }

.menu { position: fixed; z-index: 120; min-width: 210px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.45); animation: fade .12s; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--panel-2); }
.menu button .ico { width: 17px; height: 17px; color: var(--muted); }
.menu button.danger { color: var(--bad); } .menu button.danger .ico { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

.toasts { position: fixed; z-index: 200; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 16px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: rise .2s; max-width: 92vw; }
.toast.ok { border-color: rgba(52,211,153,.5); } .toast.bad { border-color: rgba(251,113,133,.6); }
.toast .ico { width: 18px; height: 18px; } .toast.ok .ico { color: var(--ok); } .toast.bad .ico { color: var(--bad); }

/* Login */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 410px; padding: 30px 26px; }
.auth-card .logo { width: 54px; height: 54px; border-radius: 17px; margin: 0 auto 18px; }
.auth-card .logo svg { width: 30px; height: 30px; }
.auth-card h1 { text-align: center; font-size: 26px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 24px; }
.lock-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; margin-top: 18px; }
.lock-note .ico { width: 14px; height: 14px; }
.otp { letter-spacing: 0.5em; text-align: center; font-family: var(--mono); font-size: 22px; }

/* Tables (admin) */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
@media (max-width: 700px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 10px; padding: 4px 8px; border: 0; }
  .table.responsive td::before { content: attr(data-l); color: var(--dim); font-size: 12px; }
}
.secret-box { font-family: var(--mono); font-size: 18px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px dashed var(--a2); text-align: center; letter-spacing: 0.06em; user-select: all; word-break: break-all; }
.qr { background: #fff; border-radius: 14px; padding: 10px; width: 200px; margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }

.section { margin-bottom: 18px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.seg-ctrl { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.seg-ctrl button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg-ctrl button.active { background: var(--panel-2); color: var(--text); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--a1); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.fab { position: fixed; right: 28px; bottom: 28px; z-index: 30; }
@media (max-width: 899px) { .fab { display: none; } }
.processing-hero { text-align: center; padding: 40px 18px; }
.processing-hero .ring { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--a1); border-right-color: var(--a2); animation: spin 1.2s linear infinite; box-shadow: 0 0 40px rgba(139,92,246,.35); }

@media print {
  .sidebar, .topbar, .tabbar, .player, .tabs, .fab, .aurora, .grid-bg, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ddd; background: #fff; break-inside: avoid; }
  .print-all .tabpane { display: block !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
