:root{
  --font:'Segoe UI Variable','Segoe UI',Inter,system-ui,-apple-system,Roboto,Arial,sans-serif;
}

body[data-theme="slate"]{
  --bg:#f3f6fb;
  --text:#0f172a;
  --muted:#475569;
  --glass:#ffffff;
  --glass-strong:#f8fbff;
  --line:#d7e0eb;
  --accent:#2563eb;
  --accent-strong:#1d4ed8;
  --accent-soft:#eff6ff;
  --success:#16a34a;
  --warning:#d97706;
  --danger:#dc2626;
  --shadow:0 18px 44px rgba(15,23,42,.08);
  --shadow-soft:0 8px 20px rgba(15,23,42,.06);
  --frame:#c7d6ea;
  --surface:#eef3f9;
  --surface-2:#f8fafc;
  --panel-radius:18px;
}

body[data-theme="command"]{
  --bg:#e8eef8;
  --text:#0d1b2a;
  --muted:#44556b;
  --glass:#eef5ff;
  --glass-strong:#f8fbff;
  --line:#bfd0e7;
  --accent:#0f6fff;
  --accent-strong:#0059d6;
  --accent-soft:#e0eeff;
  --success:#18a957;
  --warning:#d97706;
  --danger:#dc2626;
  --shadow:0 18px 44px rgba(8,20,40,.08);
  --shadow-soft:0 8px 20px rgba(8,20,40,.05);
  --frame:#b8cce7;
  --surface:#e7eef8;
  --surface-2:#f3f8ff;
  --panel-radius:18px;
}

body[data-theme="academy"]{
  --bg:#f7f4ed;
  --text:#1b2430;
  --muted:#5f6b7a;
  --glass:#fffdf8;
  --glass-strong:#fffdf8;
  --line:#ddd4c4;
  --accent:#7c5cff;
  --accent-strong:#6045d4;
  --accent-soft:#efe9ff;
  --success:#2f9e62;
  --warning:#c27c11;
  --danger:#c23b3b;
  --shadow:0 18px 44px rgba(40,36,28,.07);
  --shadow-soft:0 8px 20px rgba(40,36,28,.05);
  --frame:#d7d0c0;
  --surface:#f4efe6;
  --surface-2:#fffaf2;
  --panel-radius:18px;
}

body[data-theme="calm"]{
  --bg:#eef7f5;
  --text:#12303a;
  --muted:#4d6770;
  --glass:#fbfffe;
  --glass-strong:#f8fffd;
  --line:#cfe0db;
  --accent:#0f8b8d;
  --accent-strong:#0a6f71;
  --accent-soft:#ddf5f3;
  --success:#1f9d67;
  --warning:#bf7b16;
  --danger:#c93c3c;
  --shadow:0 18px 44px rgba(18,48,58,.07);
  --shadow-soft:0 8px 20px rgba(18,48,58,.05);
  --frame:#c5ddd7;
  --surface:#e8f3f0;
  --surface-2:#f7fdfb;
  --panel-radius:18px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{min-height:100vh;font-family:var(--font);color:var(--text);background:linear-gradient(180deg,var(--surface-2) 0%, var(--surface) 100%)}
.page-frame{max-width:1280px;margin:18px auto;padding:18px}
.app-shell{border:1px solid var(--frame);border-radius:24px;background:rgba(255,255,255,.72);backdrop-filter:blur(10px);box-shadow:0 24px 60px rgba(15,23,42,.10)}
.wrap{max-width:1220px;margin:0 auto}
.panel{background:var(--glass);border:1px solid var(--line);border-radius:var(--panel-radius);box-shadow:var(--shadow-soft)}
.inset-panel{padding:16px}
.header-container{display:flex;justify-content:space-between;align-items:flex-start;padding:10px 4px 0;margin-bottom:14px}
.eyebrow{margin-bottom:6px;color:var(--accent);font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.command-text{margin:0;font-size:clamp(42px,5vw,64px);line-height:1.02;letter-spacing:-.04em;font-weight:900}
.tagline{margin:8px 0 0;color:var(--muted);font-size:15px;line-height:1.55;max-width:900px}
.topbar,.hero,.tabs,.section{padding:16px;margin-bottom:14px}
.topbar{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}
.topbar-right{display:flex;gap:14px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.hero{background:linear-gradient(180deg,var(--glass) 0%, var(--surface-2) 100%)}
.hero h2,.panel-head h3{margin:0 0 8px;font-size:20px}
.hero p{margin:0;color:var(--muted);line-height:1.6;max-width:1020px}
.hero p + p{margin-top:8px}
.hud-pills,.btn-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.pill,.score-pill,.custom-badge{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:999px;background:var(--surface);border:1px solid var(--line);font-size:12px;color:var(--muted)}
.score-pill{color:var(--text);font-weight:700}
.dot{width:8px;height:8px;border-radius:50%;background:#94a3b8}
.dot.ok{background:var(--success)} .dot.warn{background:var(--warning)} .dot.risk{background:var(--danger)}
.theme-switcher{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.theme-label{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.theme-buttons{display:flex;gap:8px;flex-wrap:wrap}
.theme-btn,.tab,.btn-solid,.btn-file,.ghost-link{cursor:pointer;border-radius:14px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);padding:10px 14px;font-weight:600;font-size:13px;text-decoration:none;transition:.18s ease}
.theme-btn.active,.tab.active,.btn-solid:hover,.btn-file:hover,.ghost-link:hover{background:var(--accent-soft);border-color:color-mix(in srgb, var(--accent) 25%, white);color:var(--accent-strong)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-primary:hover{background:var(--accent-strong);border-color:var(--accent-strong);color:#fff}
.ghost-link{padding:6px 12px;font-size:12px;background:#fff;font-weight:500;white-space:nowrap}
.tab.active{box-shadow:inset 0 0 0 1px rgba(37,99,235,.12)}
.tabs{display:flex;flex-wrap:wrap;gap:10px}
.tab-panel{display:none}
.tab-panel.active{display:block}
.section-label{display:inline-block;margin-bottom:12px;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2);font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);font-weight:700}
.grid{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}
@media (max-width:980px){.grid{grid-template-columns:1fr}}
.field-grid{display:grid;gap:12px}
.two-up{grid-template-columns:repeat(2,1fr)}
.three-up{grid-template-columns:repeat(3,1fr)}
@media (max-width:780px){.field-grid,.two-up,.three-up{grid-template-columns:1fr}}
.field{display:flex;flex-direction:column;gap:7px;margin-bottom:12px}
.field-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;min-height:34px}
.field-head > span{display:block;line-height:1.2;min-height:28px}
.field span,.boosters-title{font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--muted);font-weight:700}
.input{width:100%;border-radius:16px;border:1px solid var(--line);background:#fff;color:var(--text);padding:14px 14px;font:inherit;box-shadow:inset 0 1px 2px rgba(15,23,42,.03)}
.input:focus{outline:none;border-color:color-mix(in srgb, var(--accent) 35%, white);box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent)}
.textarea{min-height:110px;resize:vertical}
.tall{min-height:280px}
.outbox{margin:0;padding:14px;min-height:220px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);white-space:pre-wrap;line-height:1.58;color:var(--text);overflow:auto}
.note-list{line-height:1.65;color:var(--muted)}
.top-gap{margin-top:12px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.boosters{padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);margin-top:8px}
.booster-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:10px}
@media (max-width:780px){.booster-grid{grid-template-columns:1fr}}
.booster-item{display:flex;align-items:center;gap:8px;color:var(--text);font-size:14px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#fff;min-width:0}
.booster-item input{accent-color:var(--accent)}
.template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:12px}
.template-card{padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.template-card h4{margin:0 0 8px;font-size:16px}
.template-card p{margin:0 0 12px;color:var(--muted);line-height:1.55;font-size:14px}
.history-list{display:grid;gap:10px}
.history-item{padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.history-item .meta,.meta{font-size:12px;color:var(--muted);margin-bottom:8px}
.custom-wrap{display:none;gap:8px;margin-top:8px}
.custom-wrap.open{display:grid}
.custom-badge{display:none;width:max-content}
.custom-badge.active{display:inline-flex;background:#eefbf2;border-color:#c9f1d5;color:#166534}
@media (max-width:820px){.topbar-right{justify-content:flex-start;width:100%}.theme-switcher{width:100%}.theme-buttons{width:100%}.theme-btn{flex:1 1 120px}}
