:root {
  --bg: #0A0E27;
  --bg-2: #12173A;
  --bg-3: #1A2050;
  --bg-4: #252C6A;
  --accent: #0044CC;
  --accent-hover: #003399;
  --accent-soft: rgba(0, 68, 204, 0.12);
  --surface: #FFFFFF;
  --gray-900: #1F2937;
  --gray-700: #4B5563;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --gray-50: #F9FAFB;
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #DC2626;
  --info: #0EA5E9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 260px;
  --sidebar-collapsed: 80px;
  --header: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--gray-900); }
p { margin: 0; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: width 180ms ease-out;
}

body.nav-collapsed .sidebar { width: var(--sidebar-collapsed); flex-basis: var(--sidebar-collapsed); }
body.nav-collapsed .sidebar .label,
body.nav-collapsed .sidebar .brand-text,
body.nav-collapsed .sidebar .nav-section { display: none; }
body.nav-collapsed .main { margin-left: var(--sidebar-collapsed); }

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header);
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar .brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .5px;
  flex: 0 0 36px;
}
.sidebar .brand-text strong { display: block; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.2; }
.sidebar .brand-text span { display: block; color: #6B7280; font-size: 11px; }

.nav { padding: 16px 8px; overflow-y: auto; flex: 1; }
.nav-section { color: #6B7280; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 12px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #CBD5E1; font-size: 14px; font-weight: 400;
  transition: background 160ms ease-out, color 160ms ease-out;
  margin-bottom: 2px;
}
.nav a:hover { background: var(--bg-4); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; font-weight: 500; }
.nav a svg { width: 20px; height: 20px; stroke-width: 1.75; flex: 0 0 20px; }
.nav a .label { white-space: nowrap; }
.nav .badge-count {
  margin-left: auto; background: rgba(255,255,255,0.12); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
}
.nav a.active .badge-count { background: rgba(255,255,255,0.22); }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.sidebar-user:hover { background: var(--bg-4); }
.sidebar-user .avatar { width: 34px; height: 34px; flex: 0 0 34px; }
.sidebar-user .meta { min-width: 0; }
.sidebar-user .meta strong { display: block; color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta span { display: block; color: #94A3B8; font-size: 11px; }

.main {
  margin-left: var(--sidebar);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 180ms ease-out;
}

.topbar {
  height: var(--header);
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { color: #fff; font-size: 20px; font-weight: 600; }
.topbar .sub { color: #94A3B8; font-size: 12px; }
.topbar .spacer { flex: 1; }

/* ---------- Notifications ---------- */
.notif-wrap { position: relative; }
.notif-dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--error); border: 1px solid var(--bg);
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; z-index: 50;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0,0,0,0.05); overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
}
.notif-head strong { font-size: 13px; color: var(--gray-900); }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item {
  display: block; padding: 10px 16px; border-bottom: 1px solid var(--gray-100);
  color: var(--gray-900); font-size: 13px; line-height: 1.5;
}
.notif-item:hover { background: var(--gray-100); }
.notif-item:last-child { border-bottom: none; }
.notif-item .when { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.notif-item .who { font-weight: 500; }
.notif-empty { padding: 24px 16px; text-align: center; font-size: 12px; color: var(--gray-500); }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #CBD5E1; cursor: pointer;
  transition: background 160ms ease-out, color 160ms ease-out;
}
.icon-btn:hover { background: var(--bg-4); color: #fff; }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.75; }

.page { padding: 24px; max-width: 1440px; width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
}
.card.hover { transition: transform 200ms ease, box-shadow 200ms ease; }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-title { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.card-sub { font-size: 12px; color: var(--gray-500); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card { padding: 16px; }
.stat-card .label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .value { font-size: 28px; font-weight: 600; color: var(--gray-900); margin-top: 8px; line-height: 1.1; }
.stat-card .delta { font-size: 12px; color: var(--success); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
  white-space: nowrap;
  font-family: inherit;
}
.btn svg { width: 18px; height: 18px; stroke-width: 1.75; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--gray-900); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }
.btn-dark { background: var(--bg-2); color: #fff; }
.btn-dark:hover { background: var(--bg-3); }
.btn-sm { height: 32px; padding: 6px 12px; font-size: 12px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--gray-900);
  background: #fff;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 88px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,68,204,0.2);
}
.input::placeholder, .textarea::placeholder { color: var(--gray-500); }
.hint { font-size: 12px; color: var(--gray-500); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Table ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--gray-100); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; background: var(--gray-50); color: var(--gray-700);
  font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em;
  padding: 12px 16px; position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid var(--gray-100);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-900); vertical-align: middle; }
tbody tr:hover { background: var(--gray-100); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Bits ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 14px;
  background: var(--accent);
  flex: 0 0 auto;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  background: var(--gray-100); color: var(--gray-700);
}
.chip-success { background: rgba(22,163,74,0.10); color: var(--success); }
.chip-warning { background: rgba(245,158,11,0.12); color: #B45309; }
.chip-error { background: rgba(220,38,38,0.10); color: var(--error); }
.chip-info { background: rgba(14,165,233,0.10); color: #0369A1; }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

.progress { height: 8px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 300ms ease-out; }
.progress.success > span { background: var(--success); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar h2 { font-size: 20px; font-weight: 600; }

.empty { text-align: center; padding: 48px 16px; color: var(--gray-500); }
.empty svg { width: 40px; height: 40px; stroke-width: 1.5; color: var(--gray-300); margin-bottom: 12px; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error { background: rgba(220,38,38,0.08); color: var(--error); }
.alert-success { background: rgba(22,163,74,0.08); color: var(--success); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert-warning { background: rgba(245,158,11,0.10); color: #B45309; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-100); margin-bottom: 16px; }
.tabs a {
  padding: 10px 16px; font-size: 14px; color: var(--gray-500); font-weight: 500;
  border-bottom: 2px solid transparent; transition: color 160ms ease-out, border-color 160ms ease-out;
}
.tabs a:hover { color: var(--gray-900); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }
.auth-art {
  background: linear-gradient(135deg, #0A0E27 0%, #12173A 50%, #1A2050 100%);
  padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-art::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,68,204,0.35), transparent 65%);
  right: -160px; bottom: -160px;
}
.auth-form-side { display: grid; place-items: center; padding: 48px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.auth-card .lead { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.auth-toggle { display: flex; background: var(--gray-100); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 24px; }
.auth-toggle button {
  flex: 1; height: 32px; border: none; background: transparent; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--gray-500); cursor: pointer; font-family: inherit;
  transition: background 160ms ease-out, color 160ms ease-out;
}
.auth-toggle button.active { background: #fff; color: var(--gray-900); box-shadow: var(--shadow-sm); }

/* ---------- Course page (USES-style) ---------- */
.course-hero {
  background: linear-gradient(135deg, #0A0E27 0%, #12173A 60%, #1A2050 100%);
  border-radius: var(--radius); padding: 24px; color: #fff;
  display: flex; gap: 24px; align-items: flex-start;
}
.course-hero .cover {
  width: 120px; height: 120px; border-radius: var(--radius);
  display: grid; place-items: center; flex: 0 0 120px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
}
.course-hero .cover svg { width: 48px; height: 48px; color: var(--accent); stroke-width: 1.5; }
.course-hero h1 { color: #fff; font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.course-hero p { color: #CBD5E1; font-size: 14px; line-height: 1.6; max-width: 720px; }

.lesson-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; background: #fff;
  border: 1px solid var(--gray-100); border-radius: var(--radius-sm);
  margin-bottom: 8px; transition: transform 200ms ease, box-shadow 200ms ease, border-color 160ms ease-out;
}
.lesson-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.lesson-row .num {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 32px;
  background: var(--gray-100); color: var(--gray-700); font-size: 13px; font-weight: 600;
}
.lesson-row.done .num { background: rgba(22,163,74,0.12); color: var(--success); }
.lesson-row.active { border-color: var(--accent); }
.lesson-row .body { flex: 1; min-width: 0; }
.lesson-row .body strong { display: block; font-size: 14px; font-weight: 500; color: var(--gray-900); }
.lesson-row .body span { font-size: 12px; color: var(--gray-500); }
.lesson-row .state { font-size: 12px; font-weight: 500; color: var(--gray-500); white-space: nowrap; }
.lesson-row .state.done { color: var(--success); }
.lesson-row .state.progress { color: var(--accent); }
.lesson-row .mini-progress { width: 90px; }

/* ---------- Slide player ---------- */
.player-wrap { background: #05081A; min-height: 100vh; display: flex; flex-direction: column; color: #fff; }
.player-bar {
  height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(10,14,39,0.9);
  position: sticky; top: 0; z-index: 20;
}
.player-bar .title { font-size: 14px; font-weight: 500; color: #fff; }
.player-bar .meta { font-size: 12px; color: #94A3B8; }
.player-bar .spacer { flex: 1; }
.player-stage { flex: 1; display: grid; place-items: center; padding: 24px; }
.slide-canvas {
  position: relative; width: 100%; max-width: 1120px; aspect-ratio: 16 / 9;
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--bg);
}
.slide-canvas .el { position: absolute; box-sizing: border-box; }
.player-controls {
  height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 24px;
  border-top: 1px solid rgba(255,255,255,0.08); background: rgba(10,14,39,0.9);
}
.player-controls .spacer { flex: 1; }
.player-hint { white-space: nowrap; }
.player-progress { flex: 0 1 320px; min-width: 120px; height: 6px; background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; }
.player-progress > span { display: block; height: 100%; background: var(--accent); transition: width 240ms ease-out; }
.player-btn {
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06);
  color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 160ms ease-out;
}
.player-btn:hover { background: rgba(255,255,255,0.12); }
.player-btn.primary { background: var(--accent); border-color: var(--accent); }
.player-btn.primary:hover { background: var(--accent-hover); }
.player-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Player drawers — contents + speaker notes (USES-style) */
.player-stage { position: relative; }
.player-drawer {
  position: absolute; top: 0; bottom: 0; width: 300px; z-index: 25;
  background: rgba(10,14,39,0.97); border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(-102%); transition: transform 180ms ease-out;
  box-shadow: var(--shadow-lg);
}
.player-drawer.contents { left: 0; }
.player-drawer.notes { right: 0; left: auto; border-right: none; border-left: 1px solid rgba(255,255,255,0.08); transform: translateX(102%); }
.player-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.drawer-head strong { color: #fff; font-size: 13px; font-weight: 600; }
.drawer-head .meta { font-size: 11px; color: #94A3B8; }
.contents-list { flex: 1; overflow-y: auto; padding: 8px; }
.contents-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; margin-bottom: 2px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: #CBD5E1; font-family: inherit; font-size: 12px; text-align: left; cursor: pointer;
  transition: background 160ms ease-out, color 160ms ease-out;
}
.contents-item:hover { background: #252C6A; color: #fff; }
.contents-item.active { background: var(--accent); color: #fff; font-weight: 500; }
.contents-item.seen .n { color: #86EFAC; }
.contents-item .n {
  flex: 0 0 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  background: rgba(255,255,255,0.08); font-size: 10px; font-variant-numeric: tabular-nums;
}
.contents-item.active .n { background: rgba(255,255,255,0.22); }
.contents-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contents-item .tick { color: #86EFAC; font-size: 11px; }
.contents-item.active .tick { color: #fff; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 11px; color: #94A3B8; }
.notes-body {
  flex: 1; overflow-y: auto; padding: 16px; color: #CBD5E1;
  font-size: 13px; line-height: 1.75; white-space: pre-wrap;
}
@media (max-width: 900px) {
  .player-drawer { width: 84%; }
  .player-hint { display: none; }
}

/* ---------- Animation classes used by the renderer ---------- */
@keyframes su-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes su-fade-up { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: translateY(0) } }
@keyframes su-fade-down { from { opacity: 0; transform: translateY(-24px) } to { opacity: 1; transform: translateY(0) } }
@keyframes su-slide-left { from { opacity: 0; transform: translateX(40px) } to { opacity: 1; transform: translateX(0) } }
@keyframes su-slide-right { from { opacity: 0; transform: translateX(-40px) } to { opacity: 1; transform: translateX(0) } }
@keyframes su-zoom { from { opacity: 0; transform: scale(0.88) } to { opacity: 1; transform: scale(1) } }
@keyframes su-pop { 0% { opacity: 0; transform: scale(0.7) } 70% { transform: scale(1.04) } 100% { opacity: 1; transform: scale(1) } }
@keyframes su-blur { from { opacity: 0; filter: blur(12px) } to { opacity: 1; filter: blur(0) } }
@keyframes su-flip { from { opacity: 0; transform: perspective(800px) rotateY(-24deg) } to { opacity: 1; transform: perspective(800px) rotateY(0) } }

.anim-fade { animation: su-fade var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-fade-up { animation: su-fade-up var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-fade-down { animation: su-fade-down var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-slide-left { animation: su-slide-left var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-slide-right { animation: su-slide-right var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-zoom { animation: su-zoom var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-pop { animation: su-pop var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-blur { animation: su-blur var(--dur, 600ms) var(--ease, ease-out) both; }
.anim-flip { animation: su-flip var(--dur, 600ms) var(--ease, ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  .anim-fade, .anim-fade-up, .anim-fade-down, .anim-slide-left, .anim-slide-right,
  .anim-zoom, .anim-pop, .anim-blur, .anim-flip { animation: none !important; }
}

/* ---------- Editor ---------- */
.editor-shell { display: grid; grid-template-columns: 220px minmax(0,1fr) 300px; height: 100vh; background: var(--bg); }
.editor-col { background: var(--bg-2); overflow-y: auto; }
.editor-center { background: #05081A; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.editor-toolbar {
  min-height: 56px; display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--bg-2); border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap; flex: 0 0 auto;
}
.editor-toolbar .spacer { flex: 1; }
.editor-toolbar > .flex { row-gap: 6px; }
.editor-tab-btn {
  height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12);
  background: transparent; color: #CBD5E1; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit;
  white-space: nowrap; flex: 0 0 auto;
}
.editor-tab-btn:hover { background: var(--bg-4); }
.editor-tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.editor-toolbar-elements { min-height: 48px; padding: 6px 16px; background: #0B1030; }
.editor-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.slide-thumb {
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: var(--bg);
}
.slide-thumb.active { border-color: var(--accent); }
.slide-thumb .n {
  position: absolute; left: 4px; top: 4px; z-index: 2;
  background: rgba(0,0,0,0.5); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px;
}

.panel { padding: 12px; }
.panel h4 { color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.panel label { display: block; color: #94A3B8; font-size: 11px; margin-bottom: 4px; }
.panel .input, .panel .select, .panel .textarea {
  height: 32px; font-size: 12px; background: var(--bg-3); border-color: var(--bg-4); color: #fff;
}
.panel .textarea { height: auto; }
.panel .input:focus, .panel .select:focus, .panel .textarea:focus { border-color: var(--accent); }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel-row { margin-bottom: 10px; }

.editor-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto; min-height: 0;
}
.editor-canvas {
  position: relative; width: min(100%, calc((100vh - 250px) * 16 / 9)); aspect-ratio: 16/9; flex: 0 0 auto;
  background: var(--bg); border-radius: 8px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.editor-canvas .el { position: absolute; cursor: move; }
.editor-canvas .el:hover { outline: 1px dashed rgba(255,255,255,0.4); }
.editor-canvas .el.selected { outline: 2px solid var(--accent); }
.resize-handle {
  position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px;
  background: var(--accent); border: 1px solid #fff; border-radius: 2px; cursor: nwse-resize;
}

.layer-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  color: #CBD5E1; font-size: 12px; cursor: pointer;
}
.layer-item:hover { background: var(--bg-3); }
.layer-item.active { background: var(--accent); color: #fff; }
.layer-move {
  background: none; border: none; color: #94A3B8; cursor: pointer;
  font-size: 9px; padding: 0 2px; line-height: 1; font-family: inherit;
}
.layer-move:hover { color: #fff; }
.layer-item.active .layer-move { color: rgba(255,255,255,0.75); }

@media (max-width: 1280px) {
  .editor-shell { grid-template-columns: 176px minmax(0,1fr) 260px; }
}
@media (max-width: 1024px) {
  .editor-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr auto; height: auto; min-height: 100vh; }
  .editor-col { max-height: 208px; }
  .editor-canvas-wrap { min-height: 320px; }
  .editor-center { min-height: 420px; }
}

/* ---------- Misc ---------- */
.hero-banner {
  border-radius: var(--radius); padding: 24px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0A0E27 0%, #12173A 55%, #1A2050 100%);
}
.hero-banner h1 { color: #fff; font-size: 28px; font-weight: 600; margin-bottom: 8px; }
.hero-banner p { color: #CBD5E1; font-size: 14px; max-width: 640px; line-height: 1.6; }

.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
}

.modal-backdrop { position: fixed; inset: 0; background: rgba(10,14,39,0.55); z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg);
}
.modal-head { padding: 20px 24px 0; }
.modal-head h3 { font-size: 20px; font-weight: 600; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 0 24px 20px; display: flex; gap: 8px; justify-content: flex-end; }

.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-2); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: var(--shadow-lg); animation: su-fade-up 240ms ease-out both;
}
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--gray-100); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--accent);
}
.timeline-item .when { font-size: 11px; color: var(--gray-500); }
.timeline-item .what { font-size: 13px; color: var(--gray-900); }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-chart .bar .fill { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; transition: height 300ms ease-out; }
.bar-chart .bar .cap { font-size: 11px; color: var(--gray-500); }

.split-input { display: flex; gap: 8px; }
.hidden { display: none !important; }
.muted { color: var(--gray-500); }
.small { font-size: 12px; }
.mt-0 { margin-top: 0 } .mt-8 { margin-top: 8px } .mt-16 { margin-top: 16px } .mt-24 { margin-top: 24px }
.mb-8 { margin-bottom: 8px } .mb-16 { margin-bottom: 16px } .mb-24 { margin-bottom: 24px }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px } .gap-16 { gap: 16px }
.wrap { flex-wrap: wrap; }
