/* ============================================================
   Media SOP — Design System
   Aesthetic: media/creative, bold violet-indigo, energetic
   ============================================================ */

:root {
  /* Brand — violet/indigo primary */
  --violet-700: oklch(0.42 0.20 290);
  --violet-600: oklch(0.50 0.23 290);
  --violet-500: oklch(0.58 0.23 290);
  --violet-400: oklch(0.66 0.20 288);
  --violet-300: oklch(0.78 0.13 288);
  --violet-100: oklch(0.93 0.04 290);
  --violet-50:  oklch(0.97 0.018 290);

  /* Energetic accents — shared chroma, varied hue */
  --cyan:   oklch(0.72 0.14 210);
  --cyan-bg: oklch(0.95 0.04 210);
  --pink:   oklch(0.66 0.20 350);
  --pink-bg: oklch(0.95 0.04 350);
  --amber:  oklch(0.78 0.15 70);
  --amber-bg: oklch(0.95 0.05 75);
  --green:  oklch(0.68 0.15 152);
  --green-bg: oklch(0.95 0.05 152);
  --red:    oklch(0.62 0.20 25);
  --red-bg: oklch(0.95 0.04 25);

  /* Neutrals — warm-cool neutral tuned to violet */
  --bg:        oklch(0.975 0.006 290);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.985 0.005 290);
  --line:      oklch(0.92 0.008 290);
  --line-2:    oklch(0.88 0.01 290);
  --ink:       oklch(0.24 0.02 285);
  --ink-2:     oklch(0.44 0.02 285);
  --ink-3:     oklch(0.60 0.015 285);
  --ink-4:     oklch(0.72 0.012 285);

  --shadow-sm: 0 1px 2px oklch(0.40 0.05 290 / 0.06), 0 1px 3px oklch(0.40 0.05 290 / 0.05);
  --shadow-md: 0 4px 12px oklch(0.40 0.05 290 / 0.08), 0 2px 4px oklch(0.40 0.05 290 / 0.05);
  --shadow-lg: 0 18px 40px oklch(0.40 0.08 290 / 0.16), 0 4px 12px oklch(0.40 0.05 290 / 0.08);
  --shadow-violet: 0 10px 30px oklch(0.55 0.23 290 / 0.30);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --sidebar-w: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { min-height: 100vh; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: oklch(0.20 0.03 288);
  color: oklch(0.92 0.01 290);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--violet-400), var(--pink));
  display: grid; place-items: center; color: white;
  box-shadow: 0 6px 16px oklch(0.55 0.23 290 / 0.5);
  flex: 0 0 auto;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: white; line-height: 1.05; }
.brand-sub { font-size: 11px; color: oklch(0.72 0.04 290); letter-spacing: 0.02em; }

.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: oklch(0.60 0.03 290); padding: 16px 12px 7px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 11px; color: oklch(0.82 0.02 290);
  font-size: 14px; font-weight: 600; text-align: left; margin-bottom: 2px;
  transition: background .14s, color .14s; position: relative;
}
.nav-item:hover { background: oklch(0.28 0.04 288); color: white; }
.nav-item.active { background: linear-gradient(100deg, var(--violet-500), var(--violet-600)); color: white; box-shadow: 0 6px 16px oklch(0.50 0.23 290 / 0.45); }
.nav-item .nav-count {
  margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  background: oklch(1 0 0 / 0.16);
}
.nav-item.active .nav-count { background: oklch(1 0 0 / 0.25); }

.sidebar-footer { margin-top: auto; padding-top: 14px; }

/* persona card in sidebar */
.persona {
  display: flex; align-items: center; gap: 11px; padding: 10px;
  background: oklch(0.26 0.035 288); border-radius: 13px;
}
.persona .pcol { min-width: 0; }
.persona .pname { font-size: 13.5px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona .prole { font-size: 11.5px; color: oklch(0.70 0.04 290); }

/* ---------- Main column ---------- */
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; flex: 0 0 66px; background: oklch(1 0 0 / 0.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--ink-3); }
.topbar-spacer { flex: 1; }

.role-switch { display: flex; gap: 4px; background: var(--violet-50); padding: 4px; border-radius: 12px; border: 1px solid var(--violet-100); }
.role-switch button {
  display: flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .14s;
}
.role-switch button.active { background: var(--surface); color: var(--violet-600); box-shadow: var(--shadow-sm); }
.role-switch button:not(.active):hover { color: var(--ink); }

.content { padding: 28px; flex: 1; }
.content-narrow { max-width: 1240px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px; font-size: 14px; font-weight: 700;
  transition: transform .1s, box-shadow .14s, background .14s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(100deg, var(--violet-500), var(--violet-600)); color: white; box-shadow: var(--shadow-violet); }
.btn-primary:hover { box-shadow: 0 14px 36px oklch(0.55 0.23 290 / 0.42); }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--violet-300); }
.btn-soft { background: var(--violet-100); color: var(--violet-700); }
.btn-soft:hover { background: var(--violet-300); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-h h3 { font-size: 16px; font-weight: 700; }
.card-h .sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.01em; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-violet { background: var(--violet-100); color: var(--violet-700); }
.badge-cyan { background: var(--cyan-bg); color: oklch(0.42 0.10 220); }
.badge-pink { background: var(--pink-bg); color: oklch(0.46 0.16 350); }
.badge-amber { background: var(--amber-bg); color: oklch(0.48 0.12 60); }
.badge-green { background: var(--green-bg); color: oklch(0.44 0.12 152); }
.badge-red { background: var(--red-bg); color: oklch(0.48 0.16 25); }
.badge-gray { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

/* video type chips */
.vchip { font-family: var(--font-display); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 7px; letter-spacing: 0.02em; }
.vchip.v1 { background: var(--cyan-bg); color: oklch(0.40 0.10 220); }
.vchip.v2 { background: var(--violet-100); color: var(--violet-700); }
.vchip.v3 { background: var(--pink-bg); color: oklch(0.44 0.16 350); }
.vchip.v4 { background: var(--amber-bg); color: oklch(0.46 0.12 55); }
.vchip.quay { background: var(--green-bg); color: oklch(0.42 0.12 152); }
.vchip.live { background: var(--red-bg); color: oklch(0.46 0.16 25); }

/* ---------- Avatar ---------- */
.avatar { border-radius: 50%; display: grid; place-items: center; color: white; font-weight: 700; font-family: var(--font-display); flex: 0 0 auto; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--ink-3); font-weight: 500; margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2);
  font-size: 14px; color: var(--ink); background: var(--surface); transition: border .14s, box-shadow .14s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet-400); box-shadow: 0 0 0 3px var(--violet-100); }
.textarea { resize: vertical; min-height: 90px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23857' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* segmented option pills */
.opt-grid { display: grid; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; transition: all .13s;
}
.opt:hover { border-color: var(--violet-300); background: var(--violet-50); }
.opt.sel { border-color: var(--violet-500); background: var(--violet-50); box-shadow: 0 0 0 3px var(--violet-100); }
.opt .opt-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: 0 0 auto; display: grid; place-items: center; }
.opt.sel .opt-radio { border-color: var(--violet-500); }
.opt.sel .opt-radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--violet-500); }
.opt-title { font-size: 13.5px; font-weight: 700; }
.opt-desc { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* ---------- Stars ---------- */
.stars { display: inline-flex; gap: 3px; }
.star { color: var(--line-2); transition: color .1s, transform .1s; }
.star.on { color: var(--amber); }
.star.click { cursor: pointer; }
.star.click:hover { transform: scale(1.18); }

/* ---------- Stat tiles ---------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat .stat-ic { position: absolute; right: 16px; top: 16px; opacity: 0.9; }
.stat .stat-label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat .stat-val { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 6px; letter-spacing: -0.02em; }
.stat .stat-foot { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 5px; font-weight: 600; }

/* ---------- Table ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--violet-50); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: 0 0 296px; width: 296px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.kcol.dragover { background: var(--violet-50); border-color: var(--violet-400); box-shadow: 0 0 0 3px var(--violet-100); }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.kcol-h .kdot { width: 9px; height: 9px; border-radius: 50%; }
.kcol-h .ktitle { font-size: 13px; font-weight: 800; font-family: var(--font-display); }
.kcol-h .kcount { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); padding: 0 8px; border-radius: 20px; }
.kcards { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 2px; min-height: 40px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .14s, transform .1s, border-color .14s; }
.kcard:hover { box-shadow: var(--shadow-md); border-color: var(--violet-300); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.4; }
.kcard-top { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.kcard-title { font-size: 14px; font-weight: 700; line-height: 1.3; margin-bottom: 9px; text-wrap: pretty; }
.kcard-meta { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.kcard-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line-2); }

/* progress bar */
.bar { height: 8px; background: var(--violet-100); border-radius: 20px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--violet-400), var(--violet-600)); }

/* ---------- Modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: oklch(0.20 0.03 288 / 0.5); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 24px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
.modal-wide { max-width: 760px; }
.modal-h { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-b { padding: 24px; }
.modal-f { padding: 18px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); transition: all .12s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.95) translateY(8px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }
@keyframes riseIn { from { transform: translateY(10px); } }

/* Base state is fully visible; the entrance only animates transform (never opacity),
   so static/print/background renderers can never leave .rise content invisible. */
.rise { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: riseIn .32s ease both; }
}

/* Ensure content stays visible if the environment disables animations */
@media (prefers-reduced-motion: reduce) {
  .rise, .modal, .tg-msg, .toast, .tg-panel { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---------- Telegram panel ---------- */
.tg-panel { position: fixed; top: 0; right: 0; height: 100vh; width: 380px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 90; display: flex; flex-direction: column; animation: slideIn .2s ease; }
.tg-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.tg-body { flex: 1; overflow-y: auto; padding: 16px; background: linear-gradient(160deg, var(--violet-50), var(--cyan-bg)); }
.tg-msg { background: var(--surface); border-radius: 14px 14px 14px 4px; padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 12px; border: 1px solid var(--line); animation: riseIn .3s ease both; }
.tg-msg .tg-from { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--violet-600); margin-bottom: 6px; }
.tg-msg .tg-text { font-size: 13px; line-height: 1.45; color: var(--ink); }
.tg-msg .tg-time { font-size: 10.5px; color: var(--ink-4); margin-top: 6px; text-align: right; }
.tg-bot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--cyan), var(--violet-500)); display: grid; place-items: center; color: white; flex: 0 0 auto; }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: oklch(0.22 0.03 288); color: white; padding: 13px 16px; border-radius: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 11px; max-width: 360px; animation: riseIn .25s ease both; }
.toast .tg-bot { width: 30px; height: 30px; }
.toast .tt { font-size: 13px; font-weight: 600; line-height: 1.35; }
.toast .tt b { font-weight: 800; }

/* grids */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: 1.7fr 1fr; align-items: start; }

.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* perf band pill */
.band { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 20px; font-family: var(--font-display); }
.band-fail { background: var(--red-bg); color: oklch(0.48 0.16 25); }
.band-ok { background: var(--cyan-bg); color: oklch(0.40 0.10 220); }
.band-bonus { background: var(--green-bg); color: oklch(0.42 0.12 152); }
.band-over { background: var(--amber-bg); color: oklch(0.46 0.13 55); }

/* mini ring */
.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-wrap .ring-val { position: absolute; font-family: var(--font-display); font-weight: 700; }

/* empty state */
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--violet-50); display: grid; place-items: center; margin: 0 auto 16px; color: var(--violet-400); }

/* image placeholder */
.imgph { background-image: repeating-linear-gradient(135deg, var(--violet-50), var(--violet-50) 11px, var(--surface-2) 11px, var(--surface-2) 22px); border: 1px solid var(--line); border-radius: var(--r-md); display: grid; place-items: center; color: var(--ink-4); font-family: ui-monospace, monospace; font-size: 11px; }

.divider { height: 1px; background: var(--line); margin: 18px 0; }

.mobile-only { display: none; }
.menu-btn { display: none; }

/* ---------- Auth ---------- */
.auth-bg {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 60% 20%, oklch(0.28 0.08 290), var(--bg) 70%);
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink); }
.auth-sub { font-size: 12px; color: oklch(0.65 0.05 290); margin-top: 2px; }
.auth-heading { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink); margin: 0 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-label { font-size: 12.5px; font-weight: 600; color: oklch(0.70 0.04 290); margin-bottom: -4px; }
.auth-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
  transition: border-color .15s;
}
.auth-input:focus { border-color: var(--violet-400); }
.auth-select { cursor: pointer; }
.auth-btn {
  background: linear-gradient(135deg, oklch(0.55 0.20 290), oklch(0.50 0.22 320));
  color: white;
  border: none;
  border-radius: 11px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  font-family: var(--font-display);
  transition: opacity .15s;
}
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-btn:not(:disabled):hover { opacity: 0.88; }
.auth-btn-outline {
  background: transparent;
  color: oklch(0.65 0.05 290);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.auth-btn-outline:hover { border-color: var(--violet-400); color: var(--ink); }
.auth-error {
  background: oklch(0.95 0.05 15);
  color: oklch(0.45 0.18 15);
  border: 1px solid oklch(0.88 0.08 15);
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 13px;
}
.auth-footer { text-align: center; margin-top: 22px; font-size: 13.5px; color: oklch(0.65 0.05 290); }
.auth-link { background: none; border: none; color: var(--violet-500); font-weight: 700; cursor: pointer; font-size: 13.5px; padding: 0; }
.auth-link:hover { text-decoration: underline; }

/* Step indicator */
.auth-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.auth-step { font-size: 12.5px; font-weight: 600; color: oklch(0.60 0.04 290); padding: 5px 12px; border-radius: 20px; border: 1.5px solid var(--border); }
.auth-step.active { background: oklch(0.55 0.20 290); color: white; border-color: transparent; }
.auth-step-line { flex: 1; height: 1.5px; background: var(--border); }

/* Role picker */
.role-picker { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.role-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 13px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.role-card:hover { border-color: var(--violet-300); }
.role-card.selected { border-color: var(--role-color, var(--violet-500)); background: oklch(0.97 0.02 290); }
.role-card-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.role-card-label { font-size: 14px; font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.role-card-desc { font-size: 12px; color: oklch(0.65 0.04 290); margin-top: 3px; line-height: 1.5; }

/* Role badge in topbar */
.role-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--violet-50);
  border: 1px solid var(--violet-100);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--violet-600);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: grid; }
  .scrim-mobile { position: fixed; inset: 0; background: oklch(0.2 0.03 288 / 0.4); z-index: 25; }
  .topbar { padding: 0 16px; gap: 10px; }
  .content { padding: 16px; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .role-switch button span.rs-label { display: none; }
  .role-switch button { padding: 8px 10px; }
  .page-sub { display: none; }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr; }
}
