:root {
  --brand: #4f46e5;
  --brand-2: #0ea5e9;
  --brand-ink: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #eef2f7;
  --line: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.tiny { font-size: .75rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: 600 .95rem var(--font); cursor: pointer; background: var(--bg-3); color: var(--ink); transition: transform .05s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 16px -8px var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: 14px 24px; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; }
label { display: block; font-weight: 600; font-size: .875rem; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.field { margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.error { color: var(--bad); font-size: .9rem; min-height: 1.2em; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg-3); color: var(--ink-2); }
.badge.brand { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.live { background: #fee2e2; color: #b91c1c; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* Hero */
.hero { padding: 72px 0 56px; background: radial-gradient(1000px 400px at 80% -10%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent), radial-gradient(800px 400px at 0% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 560px; }
.join-card { padding: 28px; }
.join-card h3 { font-size: 1.25rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.section { padding: 72px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.feature { padding: 22px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.feature .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); margin-bottom: 14px; font-size: 1.3rem; }
.feature h4 { font-size: 1.05rem; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: .93rem; margin: 0; }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 28px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); position: relative; }
.plan.featured::before { content: 'Most popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.plan .price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: 6px 0 6px 28px; position: relative; color: var(--ink-2); }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }

footer { padding: 36px 0; color: var(--ink-3); font-size: .875rem; border-top: 1px solid var(--line); }

/* Auth */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 16px; background: var(--bg-2); }
.auth-card { width: 100%; max-width: 420px; }
.tabs { display: flex; background: var(--bg-3); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px; font: 600 .95rem var(--font); color: var(--ink-2); cursor: pointer; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Dashboard */
.dash { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 64px); }
.side { border-right: 1px solid var(--line); padding: 20px 12px; background: var(--bg-2); }
.side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.side a.active, .side a:hover { background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.main { padding: 28px clamp(16px, 4vw, 40px); max-width: 1100px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.quick button { border: 0; border-radius: 16px; padding: 20px 16px; text-align: left; color: #fff; font: 700 1rem var(--font); cursor: pointer; display: flex; flex-direction: column; gap: 22px; min-height: 120px; }
.quick button span.i { font-size: 1.6rem; }
.quick .q1 { background: linear-gradient(135deg, #f97316, #f59e0b); }
.quick .q2 { background: linear-gradient(135deg, var(--brand), #6366f1); }
.quick .q3 { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.quick .q4 { background: linear-gradient(135deg, #10b981, #22c55e); }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; flex-wrap: wrap; }
.item .when { width: 92px; flex: none; text-align: center; }
.item .when b { display: block; font-size: 1.1rem; }
.item .meta { flex: 1; min-width: 200px; }
.item .meta h4 { margin: 0 0 2px; font-size: 1rem; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: .95rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 500; word-break: break-all; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } .side { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; } .quick { grid-template-columns: repeat(2, 1fr); } }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: #fff; color: var(--ink); border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; box-shadow: 0 25px 60px -15px rgba(0,0,0,.5); }
.modal.wide { max-width: 860px; }
.modal h3 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Toasts */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; animation: slide .2s; max-width: min(560px, calc(100vw - 32px)); }
.toast.warn { background: #92400e; }
.toast.bad { background: #991b1b; }
.toast.ok { background: #166534; }
.toast .btn { padding: 4px 10px; font-size: .8rem; }
@keyframes slide { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Summary rendering */
.summary h4 { margin: 16px 0 6px; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { margin: 4px 0; }
.summary table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.summary td, .summary th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.transcript-view { max-height: 360px; overflow: auto; background: var(--bg-2); border-radius: 10px; padding: 12px; font-size: .9rem; }
.transcript-view div { margin: 4px 0; }
