:root{
  --bg:#f6f8fc;
  --card:#ffffff;
  --border:#e6eaf2;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --ok:#16a34a;
  --err:#dc2626;
  --shadow:0 10px 24px rgba(15, 23, 42, .08);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
}

.container{max-width:1080px;margin:22px auto;padding:0 16px}

.topbar{
  position:sticky;top:0;z-index:50;
  background:linear-gradient(90deg, var(--primary), var(--primary2));
  color:#fff;
  box-shadow:0 6px 18px rgba(37,99,235,.25);
}
.topbar-inner{
  max-width:1080px;margin:0 auto;padding:14px 16px;
  display:flex;align-items:center;gap:12px;justify-content:space-between;
}
.brand{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none;font-weight:700;letter-spacing:.2px}
.logo-dot{width:14px;height:14px;border-radius:6px;background:rgba(255,255,255,.95);display:inline-block;box-shadow:0 0 0 4px rgba(255,255,255,.18)}

.nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.nav a{color:#eaf2ff;text-decoration:none;font-weight:600;padding:8px 10px;border-radius:12px}
.nav a:hover{background:rgba(255,255,255,.12)}
.nav-sep{width:1px;height:22px;background:rgba(255,255,255,.25);margin:0 6px}

.chip{background:rgba(255,255,255,.15);padding:8px 12px;border-radius:999px}
.chip-dark{background:rgba(15,23,42,.25)}
.burger{display:none;cursor:pointer;background:transparent;border:0;padding:10px;border-radius:12px}
.burger span{display:block;width:22px;height:2px;background:#fff;margin:4px 0;border-radius:2px;opacity:.95}

@media (max-width: 860px){
  .burger{display:block}
  .nav{
    position:absolute;left:16px;right:16px;top:58px;
    background:#ffffff;
    color:var(--text);
    border:1px solid var(--border);
    border-radius:16px;
    padding:10px;
    box-shadow:var(--shadow);
    display:none;
  }
  .nav.open{display:flex;flex-direction:column;align-items:stretch}
  .nav a{color:var(--text)}
  .nav a:hover{background:#f1f5ff}
  .nav-sep{display:none}
  .chip{background:#f1f5ff}
  .chip-dark{background:#0f172a;color:#fff}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}
.grid{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}
@media(max-width: 980px){.grid{grid-template-columns:1fr}}

.h1{font-size:28px;margin:0 0 6px}
.h2{font-size:18px;margin:0 0 8px}
.muted{color:var(--muted)}
.hr{height:1px;background:var(--border);margin:14px 0}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:8px;
  background:var(--primary);
  color:#fff;border:0;border-radius:14px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:700;
  box-shadow:0 10px 18px rgba(37,99,235,.22);
}
.btn:hover{background:var(--primary2)}
.btn:disabled{opacity:.6;cursor:not-allowed}
.btn-dark{background:#0f172a}
.btn-ghost{background:#eef2ff;color:#1e293b;box-shadow:none;border:1px solid #dbe3ff}
.btn-ghost:hover{background:#e6ecff}

.input, select, textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  outline:none;
}
.input:focus, select:focus, textarea:focus{
  border-color:rgba(37,99,235,.5);
  box-shadow:0 0 0 4px rgba(37,99,235,.15);
}
label{font-weight:700;font-size:13px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width: 700px){.row{grid-template-columns:1fr}}

.alert{padding:12px 14px;border-radius:14px;margin:0 0 12px;border:1px solid}
.alert-ok{background:#ecfdf3;border-color:#bbf7d0;color:#14532d}
.alert-err{background:#fef2f2;border-color:#fecaca;color:#7f1d1d}

.table{width:100%;border-collapse:separate;border-spacing:0}
.table th,.table td{padding:10px 10px;border-bottom:1px solid var(--border);text-align:left;font-size:14px}
.table th{color:#334155;font-size:12px;text-transform:uppercase;letter-spacing:.08em}

.badge{display:inline-block;padding:6px 10px;border-radius:999px;font-weight:800;font-size:12px}
.badge-ok{background:#dcfce7;color:#14532d}
.badge-warn{background:#fffbeb;color:#7c2d12}
.badge-err{background:#fef2f2;color:#7f1d1d}
.kbd{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background:#0f172a; color:#fff; padding:2px 6px; border-radius:8px; font-size:12px}

.footer{margin-top:28px;padding:18px 0}
.footer-inner{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.small{font-size:13px}
.pre{white-space:pre-wrap;background:#0b1220;color:#e5e7eb;border-radius:14px;padding:12px;overflow:auto}
.transcript{display:flex;flex-direction:column;gap:10px}
.bubble{padding:10px 12px;border-radius:16px;border:1px solid var(--border)}
.bubble.user{background:#f8fafc}
.bubble.ai{background:#eef2ff;border-color:#dbe3ff}
.status{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.pill{padding:6px 10px;border-radius:999px;background:#eff6ff;border:1px solid #dbeafe;color:#1e3a8a;font-weight:800;font-size:12px}
