/* ==========================================================
   College Blog — Admin panel
   Tokens follow the blog design (Plus Jakarta Sans, ink #0B1220,
   brand #4338CA, page #F5F7FB, 24px cards, pill buttons).
   ========================================================== */
:root {
  --ink: #0B1220;
  --ink-2: #1E293B;
  --text: #334155;
  --text-2: #475569;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --line: #E2E8F0;
  --line-2: #EEF2F7;
  --line-3: #F1F5F9;
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --brand: #4338CA;
  --brand-d: #312E81;
  --brand-soft: #EEF0FF;
  --brand-ink: #3730A3;
  --brand-tint: #C7D2FE;
  --brand-rgb: 67, 56, 202;           /* --brand as r, g, b for glows; the theme colour replaces all of these */
  --warm: #FFF1E0;
  --warm-ink: #7A3E0A;
  --ok: #15803D;
  --ok-soft: #DCFCE7;
  --bad: #B91C1C;
  --bad-soft: #FEE2E2;
  --warn: #A16207;
  --warn-soft: #FEF3C7;
  --t1: #E0E7FF; --t2: #FFEDD5; --t3: #DCFCE7; --t4: #FCE7F3; --t5: #E0F2FE; --t6: #FEF9C3;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sb: 268px;
  --shadow: 0 24px 48px -24px rgba(11, 18, 32, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Plus Jakarta Sans', Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
a:hover { color: var(--brand-d); }
[hidden] { display: none !important; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
kbd {
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: #fff;
}
:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; }

/* ---------- Keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes drawerIn { from { transform: translateX(104%); } to { transform: none; } }
@keyframes drawerOut { to { transform: translateX(104%); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(48px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(48px); } }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes leaveOk {
  0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
  35% { transform: none; box-shadow: 0 0 0 4px rgba(21, 128, 61, .45); }
  100% { opacity: 0; transform: translateX(80px) rotate(2deg) scale(.95); box-shadow: 0 0 0 4px rgba(21, 128, 61, 0); }
}
@keyframes leaveBad {
  0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
  35% { transform: none; box-shadow: 0 0 0 4px rgba(185, 28, 28, .4); }
  100% { opacity: 0; transform: translateX(-80px) rotate(-2deg) scale(.95); }
}
@keyframes leaveFade { to { opacity: 0; transform: scale(.94); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.floaty { animation: floaty 7s ease-in-out infinite; }
.live { animation: pulse 2s ease-in-out infinite; }

/* Staggered entrance on route change */
.view-in .rise { animation: rise .65s var(--ease) backwards;animation-delay: calc(var(--i, 0) * 55ms); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .25s, box-shadow .25s, border-color .25s, color .25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--ink); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { color: #fff; background: var(--brand-ink); box-shadow: 0 10px 24px -12px rgba(var(--brand-rgb), .8); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { color: #fff; box-shadow: 0 10px 24px -12px rgba(11, 18, 32, .7); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { color: #fff; box-shadow: 0 10px 24px -12px rgba(21, 128, 61, .8); border-color: var(--ok); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { color: #fff; border-color: var(--bad); box-shadow: 0 10px 24px -12px rgba(185, 28, 28, .8); }
.btn-danger-ghost { color: var(--bad); }
.btn-danger-ghost:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.btn-light { background: #fff; border-color: #fff; color: var(--ink); }
.btn-ghost { background: transparent; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.ripple-ink {
  position: absolute; border-radius: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  background: currentColor; opacity: .25; transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none;
}
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; color: var(--text); transition: background-color .2s, color .2s, transform .2s, border-color .2s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn.on { color: #F59E0B; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--brand-soft); color: var(--brand-ink);
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-warn i { animation: pulse 1.6s infinite; }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-muted { background: var(--line-3); color: var(--muted); }
.pill-warm { background: var(--warm); color: var(--warm-ink); }
.pill-dark { background: var(--ink); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; font-size: 13px;
  transition: background-color .25s, color .25s, border-color .25s, transform .2s;
}
.chip:hover { border-color: var(--brand); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chip .count { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--line-3); color: var(--muted); transition: inherit; }
.chip.on .count { background: rgba(255, 255, 255, .16); color: #fff; }

/* Segmented control with sliding thumb */
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 999px; background: #E8EBF3; }
.seg button {
  position: relative; z-index: 1; height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; transition: color .25s;
}
.seg button.on { color: var(--ink); font-weight: 700; }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: #fff;
  box-shadow: 0 2px 10px -2px rgba(11, 18, 32, .18); transition: transform .45s var(--ease), width .45s var(--ease);
}
.seg .count { font-size: 11px; font-weight: 800; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 1px 7px; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 42px; height: 24px; border-radius: 999px; background: #CBD5E1; position: relative; flex: none;
  transition: background-color .3s;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(11, 18, 32, .25); transition: transform .35s var(--spring);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(var(--brand-rgb), .45); outline-offset: 2px; }
.switch.ok input:checked + .track { background: var(--ok); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > span em { color: var(--bad); font-style: normal; }
.field small.hint { color: var(--muted); font-size: 12px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(185, 28, 28, .1); }
.field.invalid { animation: shake .45s; }
.field .err { color: var(--bad); font-size: 12px; font-weight: 600; }
.field .counter { align-self: flex-end; font-size: 11px; color: var(--muted); margin-top: -2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.search-box { position: relative; min-width: 240px; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 42px !important; border-radius: 999px !important; }
.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-cards label {
  flex: 1 1 120px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; font-weight: 600; transition: border-color .2s, background-color .2s;
}
.radio-cards input { accent-color: var(--brand); }
.radio-cards label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.radio-cards.stack { flex-direction: column; margin-top: 12px; text-align: left; }
.radio-cards.stack label { flex: none; align-items: flex-start; }
.radio-cards.stack input { margin-top: 3px; }
.radio-cards.stack small { display: block; margin-top: 2px; font-weight: 400; color: var(--muted); }

/* Upload */
.upload {
  position: relative; border: 1.5px dashed #CBD5E1; border-radius: 18px; background: #FAFBFE; min-height: 150px;
  display: grid; place-items: center; overflow: hidden; transition: border-color .2s, background-color .2s, transform .2s;
}
.upload:hover, .upload.drag { border-color: var(--brand); background: var(--brand-soft); }
.upload.drag { transform: scale(1.01); }
.upload-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); cursor: pointer; padding: 22px; text-align: center; width: 100%; height: 100%; justify-content: center; }
.upload-empty .ic { color: var(--brand); margin-bottom: 4px; transition: transform .3s var(--ease); }
.upload:hover .upload-empty .ic { transform: translateY(-4px); }
.upload-empty small { color: var(--muted); }
.upload-preview { display: none; width: 100%; }
.upload-preview img { display: block; width: 100%; max-height: 240px; object-fit: cover; animation: fade .4s; }
.upload.square .upload-preview img { max-height: 160px; width: 160px; height: 160px; margin: 14px auto; border-radius: 50%; }
.upload-actions { display: none; position: absolute; right: 10px; bottom: 10px; gap: 6px; }
.upload.has { border-style: solid; }
.upload.has .upload-empty { display: none; }
.upload.has .upload-preview, .upload.has .upload-actions { display: flex; }
.upload.busy::after {
  content: ''; position: absolute; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-tint); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

/* ---------- Login ---------- */
.login {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden;
  background: radial-gradient(1200px 600px at 80% -10%, #1E2A4A 0%, transparent 60%), var(--ink);
}
.blob { position: absolute; border-radius: 50%; pointer-events: none; }
.blob-1 { width: 420px; height: 420px; background: rgba(var(--brand-rgb), .45); filter: blur(10px); left: -120px; bottom: -140px; }
.blob-2 { width: 220px; height: 220px; background: rgba(165, 180, 252, .18); right: 12%; top: 8%; animation-delay: -3s; }
.login-ring { position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); right: -160px; bottom: -200px; animation-delay: -5s; }
.login-card {
  position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 36px 32px;
  display: flex; flex-direction: column; gap: 16px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); animation: rise .8s var(--ease) both;
}
.login-card.shake { animation: shake .5s; }
.login-card h1 { margin: 8px 0 0; font-size: 30px; letter-spacing: -.03em; font-weight: 800; }
.login-card p { margin: 0; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.login-brand small { color: var(--muted); font-weight: 500; }
.login-error { color: var(--bad); background: var(--bad-soft); padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 13px; animation: rise .3s; }
.demo-hint { text-align: center; color: var(--muted); font-size: 13px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px !important; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: 999px; }

.logo-box {
  width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 20px; font-weight: 800; flex: none; overflow: hidden;
}
.logo-box img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .logo-box { background: #fff; color: var(--ink); }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.app.boot .sidebar { animation: sbIn .7s var(--ease) both; }
.app.boot .topbar { animation: fade .6s .15s both; }
@keyframes sbIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb); background: var(--ink); color: #CBD5E1; z-index: 50;
  display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; scrollbar-width: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; text-decoration: none; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand:hover { color: #fff; }
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-text strong { font-size: 15px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted-2); font-size: 12px; font-weight: 500; }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-group { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 16px 12px 6px; }
.nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px;
  color: #CBD5E1; text-decoration: none; font-weight: 600; transition: color .25s, background-color .25s;
}
.nav-item .ic { transition: transform .35s var(--spring); }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item:hover .ic { transform: scale(1.12) rotate(-4deg); }
.nav-item.on { color: #fff; background: transparent; }
.nav-ind {
  position: absolute; left: 0; right: 0; top: 0; height: 44px; border-radius: 12px; z-index: 0; opacity: 0;
  background: linear-gradient(135deg, #4F46E5, var(--brand)); box-shadow: 0 12px 24px -12px rgba(99, 102, 241, .9);
  transition: transform .5s var(--ease), opacity .3s;
}
.nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #F59E0B; color: var(--ink);
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.nav-badge.bump { animation: pop .5s var(--spring); }
.sb-foot { margin-top: auto; padding-top: 20px; }
.sb-card { position: relative; overflow: hidden; border-radius: 20px; padding: 18px; background: linear-gradient(160deg, #1E293B, #172036); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sb-card strong { color: #fff; font-size: 14px; position: relative; }
.sb-card p { margin: 0 0 8px; font-size: 12px; color: var(--muted-2); position: relative; }
.sb-card .btn { position: relative; }
.sb-card-blob { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(var(--brand-rgb), .5); right: -40px; top: -50px; }

.main { margin-left: var(--sb); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; padding: 12px 32px;
  background: rgba(245, 247, 251, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(11, 18, 32, .06);
}
.menu-btn { display: none; }
.tb-title { min-width: 0; }
.tb-title h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.crumb { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 16px; min-width: 280px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px; color: var(--muted); transition: border-color .2s, box-shadow .2s;
}
.search-trigger:hover { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .08); }
.search-trigger span { flex: 1; text-align: left; }
.tb-actions { display: flex; align-items: center; gap: 8px; }
.notif-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #F43F5E; box-shadow: 0 0 0 2px var(--bg); }
.notif-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #F43F5E; animation: ping 1.6s infinite; }
.avatar-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 8px 4px 4px; border-radius: 999px; transition: background-color .2s; }
.avatar-btn:hover { background: #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6366F1, var(--brand)); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.who { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.who b { font-size: 13px; }
.who small { font-size: 11px; color: var(--muted); }

.dd { position: relative; }
.dd-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: #fff; border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: var(--shadow); padding: 8px; opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right;
  pointer-events: none; transition: opacity .22s, transform .3s var(--ease); z-index: 60;
}
.dd.open .dd-panel { opacity: 1; transform: none; pointer-events: auto; }
.dd-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; text-decoration: none; color: var(--ink); font-weight: 600; text-align: left; }
.dd-item:hover { background: var(--brand-soft); color: var(--brand-ink); }
.dd-item.danger { color: var(--bad); }
.dd-item.danger:hover { background: var(--bad-soft); }
.notif-panel { width: 360px; max-width: calc(100vw - 32px); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; }
.notif-head b { font-size: 15px; }
.notif-list { max-height: 380px; overflow-y: auto; padding: 0 8px 8px; }
.notif-item { display: flex; gap: 12px; padding: 10px; border-radius: 12px; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--brand-soft); }
.notif-item p { margin: 0; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.notif-item small { color: var(--muted); font-size: 12px; }

.view { max-width: 1280px; margin: 0 auto; padding: 28px 32px 72px; outline: none; }
.view-in { animation: fade .35s ease both; }
.scrim { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h2 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; max-width: 640px; }
.page-head.page-acts { justify-content: flex-end; margin-bottom: 18px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.toolbar-r { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar select.input { width: auto; min-width: 180px; border-radius: 999px; height: 42px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: 24px; }
.card-pad { padding: 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.lift { transition: transform .4s var(--ease), box-shadow .4s, border-color .3s; }
.lift:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; text-decoration: none; }
.link-more .ic { transition: transform .3s; }
.link-more:hover .ic { transform: translateX(4px); }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 32px; background: var(--ink); color: #fff; padding: 32px 36px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px;
}
.hero .b1 { position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); top: -120px; right: -60px; }
.hero .b2 { position: absolute; width: 170px; height: 170px; border-radius: 50%; background: rgba(var(--brand-rgb), .4); bottom: -80px; left: 42%; animation-delay: -3s; }
.hero-txt { position: relative; display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.hero-txt h2 { margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.hero-txt p { margin: 0; color: #CBD5E1; font-size: 15px; }
.hero-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .1); padding: 7px 13px; border-radius: 999px; color: #E0E7FF; }
.hero-tag i { width: 8px; height: 8px; border-radius: 50%; background: #A5B4FC; }
.hero-actions { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn:not(.btn-primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat { padding: 22px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; text-decoration: none; color: inherit; }
.stat:hover { color: inherit; }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; transition: transform .45s var(--spring); }
.stat:hover .stat-ic { transform: rotate(-8deg) scale(1.08); }
.stat-num { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-2); font-weight: 600; font-size: 13px; }
.stat-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-foot b { color: var(--ok); }
.stat-foot b.warn { color: var(--warn); }
.stat .glow { position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -50px; bottom: -70px; opacity: .55; transition: transform .6s var(--ease); }
.stat:hover .glow { transform: scale(1.3); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }

.chart { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding: 10px 4px 0; border-bottom: 1px solid var(--line-2); position: relative; }
.chart-grid { position: absolute; inset: 10px 0 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { border-top: 1px dashed var(--line-2); }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar {
  width: min(48px, 70%); height: var(--h); border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, #6366F1, var(--brand));
  transform-origin: bottom; animation: growY .9s var(--ease) both; animation-delay: calc(var(--i) * 80ms + .15s); position: relative;
  transition: filter .2s, transform .3s var(--ease);
}
.bar.cur { background: linear-gradient(180deg, #F59E0B, #D97706); }
.bar-col:hover .bar { filter: brightness(1.12); }
.bar-tip {
  position: absolute; bottom: calc(var(--h) + 10px); left: 50%; transform: translate(-50%, 6px); background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .2s, transform .25s var(--ease); pointer-events: none;
}
.bar-col:hover .bar-tip { opacity: 1; transform: translate(-50%, 0); }
.chart-x { display: flex; gap: 14px; padding: 10px 4px 0; }
.chart-x span { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }

.hbar { display: flex; flex-direction: column; gap: 14px; }
.hbar-row { display: grid; grid-template-columns: 110px 1fr 28px; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.hbar-track { height: 10px; border-radius: 999px; background: var(--line-3); overflow: hidden; }
.hbar-fill { height: 100%; width: var(--w); border-radius: 999px; transform-origin: left; animation: growX 1s var(--ease) both; animation-delay: calc(var(--i) * 70ms + .2s); }
.hbar-row b { text-align: right; font-variant-numeric: tabular-nums; }

.mini-q { display: flex; flex-direction: column; gap: 10px; }
.mini-q-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line-2); border-radius: 16px; transition: border-color .2s, background-color .2s; }
.mini-q-item:hover { border-color: var(--brand-tint); background: #FAFBFF; }
.mini-q-item .t { flex: 1; min-width: 0; }
.mini-q-item .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-q-item .t small { color: var(--muted); }
.mini-q-item .acts { display: flex; gap: 4px; }
.mini-q-item.leaving { animation: leaveOk .5s var(--ease) forwards; }
.mini-q-item.leaving-bad { animation: leaveBad .5s var(--ease) forwards; }

.timeline { display: flex; flex-direction: column; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.tl-item { display: flex; gap: 14px; padding: 8px 0; position: relative; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative; z-index: 1; box-shadow: 0 0 0 4px #fff; }
.tl-item p { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tl-item small { color: var(--muted); font-size: 12px; }

.thumb { width: 56px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center; color: var(--text-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ava { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--brand-ink); overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava.ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--t1); }

/* ---------- Approvals ---------- */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.q-card { display: flex; flex-direction: column; overflow: hidden; }
.q-card.leaving { animation: leaveOk .55s var(--ease) forwards; pointer-events: none; }
.q-card.leaving-bad { animation: leaveBad .55s var(--ease) forwards; pointer-events: none; }
.q-media { height: 170px; display: grid; place-items: center; color: var(--text-2); overflow: hidden; position: relative; }
.q-media > .ph, .q-media img { transition: transform .7s var(--ease); }
.q-card:hover .q-media > .ph, .q-card:hover .q-media img { transform: scale(1.06); }
.q-media img { width: 100%; height: 100%; object-fit: cover; }
.q-media .ph { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.q-media .stamp { position: absolute; top: 14px; left: 14px; }
.q-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.q-body h3 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.q-body p { margin: 0; color: var(--text-2); font-size: 13px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.q-meta .date { color: var(--muted); font-weight: 500; }
.q-from { display: flex; align-items: center; gap: 10px; padding-top: 12px; margin-top: auto; border-top: 1px solid var(--line-3); }
.q-from .ava { width: 34px; height: 34px; font-size: 12px; }
.q-from div { min-width: 0; line-height: 1.3; }
.q-from b { display: block; font-size: 13px; }
.q-from small { color: var(--muted); font-size: 12px; }
.q-acts { display: flex; gap: 8px; padding: 0 20px 20px; }
.q-acts .btn { flex: 1; }
.q-quote { padding: 24px 20px 0; color: var(--brand-tint); }
.q-story { font-size: 16px !important; line-height: 1.55; color: var(--ink-2) !important; font-weight: 500; }
.alum-line { display: flex; align-items: center; gap: 12px; }
.alum-line .ava { width: 48px; height: 48px; font-size: 11px; }
.alum-line b { display: block; font-size: 14px; }
.alum-line small { display: block; font-size: 12px; color: var(--muted); }
.alum-line .role { color: var(--brand); font-weight: 600; }

.empty { text-align: center; padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { margin: 6px 0 0; font-size: 20px; font-weight: 800; }
.empty p { margin: 0; color: var(--muted); max-width: 420px; }
.empty-ic { width: 84px; height: 84px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; animation: pop .6s var(--spring) both; }
.empty-ic.neutral { background: var(--brand-soft); color: var(--brand); }
.empty-ic svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .7s .35s ease forwards; }

.history { margin-top: 32px; }
.hist-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line-3); }
.hist-row:last-child { border-bottom: 0; }
.hist-row .t { flex: 1; min-width: 0; }
.hist-row .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row .t small { color: var(--muted); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-3); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .2s; }
.tbl tbody tr:hover { background: #FAFBFE; }
.view-in .tbl tbody tr.rise { animation-duration: .5s; animation-delay: calc(var(--i, 0) * 40ms); }
.removing { animation: leaveFade .34s ease forwards !important; pointer-events: none; }
.card.flash, .mini-q-item.flash { animation: pop .45s var(--spring); }
.cell-main { display: flex; align-items: center; gap: 14px; min-width: 260px; }
.cell-main .t { min-width: 0; }
.cell-main b { display: block; font-size: 14px; font-weight: 700; line-height: 1.35; }
.cell-main small { display: block; color: var(--muted); font-size: 12px; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-acts { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.nowrap { white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-top: 1px solid var(--line-2); }
.pager span { color: var(--muted); font-size: 13px; }
.pager-btns { display: flex; gap: 6px; }
.page-num { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 13px; transition: all .2s; }
.page-num:hover { border-color: var(--brand); }
.page-num.on { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.08); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--line-3); padding: 3px 8px; border-radius: 8px; color: var(--ink-2); }

/* ---------- Alumni grid ---------- */
.alum-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.alum-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.alum-card .q-ic { color: var(--brand-tint); }
.alum-card p.story { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); font-weight: 500; }
.alum-card .alum-line { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-3); }
.alum-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-tools { display: flex; gap: 2px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .3s var(--ease); }
.alum-card:hover .card-tools, .alum-card:focus-within .card-tools, .ad-card:hover .card-tools { opacity: 1; transform: none; }
.add-tile {
  border: 1.5px dashed #CBD5E1; border-radius: 24px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 240px; color: var(--text-2); font-weight: 700; transition: border-color .2s, background-color .2s, color .2s;
}
.add-tile:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.add-tile .plus { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px -10px rgba(11, 18, 32, .3); transition: transform .4s var(--spring); }
.add-tile:hover .plus { transform: rotate(90deg) scale(1.08); }

/* ---------- Banners ---------- */
.stage-card { position: relative; overflow: hidden; border-radius: 32px; background: var(--ink); color: #fff; padding: 32px; margin-bottom: 24px; }
.stage-card .b1 { position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); top: -110px; right: -70px; }
.stage-card .b2 { position: absolute; width: 160px; height: 160px; border-radius: 50%; background: rgba(var(--brand-rgb), .35); bottom: -70px; left: 38%; animation-delay: -3s; }
.stage-label { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.stage-label span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.stage { position: relative; height: 300px; }
.slide { position: absolute; inset: 0; display: flex; align-items: center; gap: 32px; opacity: 0; transform: translateX(32px); transition: opacity .7s ease, transform .7s var(--ease); pointer-events: none; }
.slide.on { opacity: 1; transform: none; pointer-events: auto; }
.slide-txt { flex: 1 1 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.slide-txt h3 { margin: 0; font-size: 40px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.slide-txt p { margin: 0; color: #CBD5E1; font-size: 16px; max-width: 440px; }
.slide-txt .btn { align-self: flex-start; }
.slide-img { flex: 1 1 0; height: 100%; border-radius: 22px; background: var(--ink-2); border: 1px solid rgba(255, 255, 255, .08); color: var(--muted-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; overflow: hidden; }
.slide-img img { width: 100%; height: 100%; object-fit: cover; }
.stage-ctrl { position: relative; margin-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dots { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 999px; border: 0; padding: 0; background: rgba(255, 255, 255, .3); transition: width .4s var(--ease), background-color .4s; }
.dot.on { width: 32px; background: #fff; }
.round-btns { display: flex; gap: 10px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; display: grid; place-items: center; transition: transform .25s, background-color .25s; }
.round:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .14); }
.round.primary { background: var(--brand); border-color: var(--brand); }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #6366F1, #A5B4FC); transform-origin: left; }
.progress.run { animation: drain 5s linear reverse both; }

.banner-list { display: flex; flex-direction: column; gap: 12px; }
.banner-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; transition: transform .45s var(--ease), box-shadow .3s, opacity .3s; }
.banner-row.off { opacity: .6; }
.banner-row .num { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; display: grid; place-items: center; flex: none; }
.banner-row .thumb { width: 96px; height: 60px; border-radius: 12px; background: var(--ink-2); color: var(--muted-2); }
.banner-row .t { flex: 1; min-width: 0; }
.banner-row .t b { display: block; font-size: 15px; }
.banner-row .t small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-btns { display: flex; flex-direction: column; }
.order-btns .icon-btn { width: 30px; height: 22px; border-radius: 6px; }
.banner-row.flash { animation: pop .45s var(--spring); }

/* ---------- Ads ---------- */
.ad-grid { display: grid; gap: 20px; }
.ad-card { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.ad-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ad-top b { font-size: 16px; display: block; }
.ad-top small { color: var(--muted); }
.ad-preview {
  height: 140px; border-radius: 20px; border: 1.5px dashed #CBD5E1; background: #fff; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; font-weight: 500; overflow: hidden; transition: transform .4s var(--ease), border-color .3s; text-align: center; padding: 0 16px;
}
.ad-preview:hover { transform: scale(1.01); border-color: var(--brand); color: var(--text-2); }
.ad-preview.has { padding: 0; border-style: solid; }
.ad-preview img { width: 100%; height: 100%; object-fit: cover; }
.ad-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ad-stat { background: var(--bg); border-radius: 16px; padding: 12px 14px; }
.ad-stat small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ad-stat b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ad-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ad-url { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.ad-url span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }

/* ---------- Categories ---------- */
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-3); transition: background-color .2s; }
.cat-row:hover { background: #FAFBFE; }
.cat-row:last-child { border-bottom: 0; }
.cat-row .sw { width: 14px; height: 14px; border-radius: 5px; flex: none; }
.cat-row .t { flex: 1; min-width: 0; }
.cat-row .t b { font-size: 15px; }
.cat-row .t small { display: block; color: var(--muted); }
.cat-row.flash { animation: pop .45s var(--spring); }
.cat-add { display: flex; gap: 10px; padding: 20px; border-bottom: 1px solid var(--line-2); }
.cat-add input { flex: 1; }
.chip-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-preview span { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; font-weight: 600; font-size: 13px; color: var(--text); animation: pop .4s var(--spring) both; animation-delay: calc(var(--i) * 50ms); }
.chip-preview span.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-grid form { display: flex; flex-direction: column; gap: 20px; }
.form-section { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.form-section h3 { margin: 0; font-size: 16px; font-weight: 800; }
.form-section > p { margin: -10px 0 0; color: var(--muted); font-size: 13px; }
.sticky { position: sticky; top: 88px; }
.save-bar {
  position: sticky; bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 20px;
  background: var(--ink); color: #fff; border-radius: 999px; box-shadow: var(--shadow); transform: translateY(140%); opacity: 0;
  transition: transform .45s var(--spring), opacity .3s; z-index: 5;
}
.save-bar.show { transform: none; opacity: 1; }
.save-bar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .2); }
.preview-site { overflow: hidden; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.pv-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.pv-brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-brand .logo-box { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.pv-apply { background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.pv-body { padding: 22px 18px; }
.pv-body h4 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.pv-body p { margin: 0; color: var(--text-2); font-size: 13px; }
.pv-foot { background: var(--ink); color: #CBD5E1; padding: 22px 18px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; font-size: 12px; line-height: 1.7; }
.pv-foot b { color: #fff; font-size: 15px; display: block; margin-bottom: 4px; }
.pv-social { display: flex; gap: 8px; margin-top: 6px; }
.pv-social span { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-2); display: grid; place-items: center; color: #fff; transition: transform .3s var(--spring), background-color .3s; }
.pv-social span.on { background: var(--brand); transform: scale(1.08); }
.danger-zone { border-color: #FECACA; }
.danger-zone h3 { color: var(--bad); }
.flash-bind { animation: pop .4s var(--spring); }

/* ---------- Drawer ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 80; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(11, 18, 32, .45); backdrop-filter: blur(3px); animation: fade .3s both; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #fff; display: flex; flex-direction: column;
  box-shadow: -30px 0 60px -30px rgba(11, 18, 32, .5); animation: drawerIn .45s var(--ease) both; margin: 0;
}
.drawer-wrap.closing .drawer { animation: drawerOut .35s var(--ease) forwards; }
.drawer-wrap.closing .drawer-scrim { animation: fade .3s reverse forwards; }
.drawer > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line-2); }
.drawer > header h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.drawer > header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-body > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms + .1s); }
.drawer > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line-2); background: #FAFBFE; }
.drawer > footer .spacer { margin-right: auto; }
.pv-post { border: 1px solid var(--line-2); border-radius: 24px; overflow: hidden; }
.pv-post .q-media { height: 220px; }
.pv-post .q-body h3 { font-size: 22px; }
.pv-post .body { white-space: pre-line; color: var(--text); font-size: 14px; line-height: 1.7; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-ink); font-size: 13px; font-weight: 500; }
.callout.warm { background: var(--warm); color: var(--warm-ink); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }
.cred { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: #fff; }
.cred code { font-size: 15px; font-weight: 700; letter-spacing: .04em; }

.kv-h { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.done-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.done-kv div { background: var(--bg); border-radius: 14px; padding: 10px 14px; min-width: 0; }
.done-kv small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.done-kv b { font-size: 14px; word-break: break-word; }
.tbl .field input { height: 40px; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(11, 18, 32, .5); backdrop-filter: blur(3px); animation: fade .25s both; }
.modal {
  position: relative; width: min(460px, 100%); background: #fff; border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); animation: modalIn .4s var(--spring) both; margin: 0;
}
.modal-wrap.closing .modal { animation: modalOut .25s ease forwards; }
.modal-wrap.closing .modal-scrim { animation: fade .25s reverse forwards; }
.modal-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); animation: pop .5s .1s var(--spring) both; }
.modal-ic.danger { background: var(--bad-soft); color: var(--bad); }
.modal h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.modal p { margin: 0; color: var(--text-2); }
.modal-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chips button { height: 32px; font-size: 12px; padding: 0 12px; }

/* ---------- Palette ---------- */
.pal-wrap { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pal-wrap .modal-scrim { animation: fade .2s both; }
.pal { position: relative; width: min(620px, 100%); background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); animation: modalIn .35s var(--spring) both; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line-2); }
.pal-in .ic { color: var(--muted); }
.pal-in input { flex: 1; height: 60px; border: 0; outline: none; font-size: 17px; background: transparent; }
.pal-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.pal-group { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 12px 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; text-align: left; transition: background-color .15s; }
.pal-item .pi { width: 34px; height: 34px; border-radius: 10px; background: var(--bg); color: var(--text-2); display: grid; place-items: center; flex: none; transition: all .2s; }
.pal-item .t { flex: 1; min-width: 0; }
.pal-item .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .t small { color: var(--muted); font-size: 12px; }
.pal-item .go { opacity: 0; color: var(--brand); transition: opacity .2s, transform .2s; transform: translateX(-4px); }
.pal-item.on { background: var(--brand-soft); }
.pal-item.on .pi { background: var(--brand); color: #fff; }
.pal-item.on .go { opacity: 1; transform: none; }
.pal-foot { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.pal-empty { padding: 32px; text-align: center; color: var(--muted); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 420px; padding: 14px 14px 14px 16px;
  background: var(--ink); color: #fff; border-radius: 18px; box-shadow: var(--shadow); animation: toastIn .45s var(--spring) both; font-weight: 600; font-size: 13px;
}
.toast.out { animation: toastOut .3s ease forwards; }
.toast-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); }
.toast-error .toast-ic { background: var(--bad); }
.toast-info .toast-ic { background: var(--brand); }
.toast-msg { flex: 1; }
.toast-undo { border: 0; background: rgba(255, 255, 255, .12); color: #A5B4FC; font-weight: 800; padding: 6px 12px; border-radius: 999px; font-size: 12px; }
.toast-undo:hover { background: rgba(255, 255, 255, .2); }
.toast-x { border: 0; background: none; color: var(--muted-2); padding: 4px; display: grid; place-items: center; border-radius: 8px; }
.toast-x:hover { color: #fff; }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #6366F1; transform-origin: left; animation: drain linear forwards; }
.toast:hover .toast-bar { animation-play-state: paused; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .settings-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .search-trigger { min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { padding: 0; width: 42px; justify-content: center; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .4s var(--ease); }
  .app.sb-open .sidebar { transform: none; }
  .app.sb-open .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 18, 32, .45); z-index: 45; animation: fade .3s; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .view { padding: 20px 16px 64px; }
  .who { display: none; }
  .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 26px 22px; border-radius: 26px; }
  .hero-txt h2, .page-head h2 { font-size: 26px; }
  .stage { height: 460px; }
  .slide { flex-direction: column; align-items: stretch; gap: 18px; }
  .slide-img { flex: 0 0 180px; }
  .slide-txt h3 { font-size: 28px; }
  .tb-title h1 { font-size: 18px; }
  .banner-row { flex-wrap: wrap; }
  .banner-row .thumb { display: none; }
  .q-grid { grid-template-columns: minmax(0, 1fr); }
  .drawer > header, .drawer-body, .drawer > footer { padding-left: 18px; padding-right: 18px; }
  .pv-foot { grid-template-columns: 1fr; }
  #toasts { left: 16px; right: 16px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
  .search-box { min-width: 0; flex: 1; }
}

/* ---------- Domain bookings: college-managed ---------- */
.who-tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #E0F2FE; color: #0369A1; }
.who-tag.stu { background: var(--warm); color: var(--warm-ink); }
.req-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--bg); transition: transform .25s var(--ease), box-shadow .25s; }
.req-row:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(11, 18, 32, .35); }
.req-main { flex: 1; min-width: 0; }
.req-main b { display: block; font-size: 14px; }
.req-main small { color: var(--muted); font-size: 12px; }
.req-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.req-note { margin: 8px 0 0; font-size: 13px; color: var(--text-2); font-style: italic; }
.req-row .cell-acts { flex: none; }
.req-pick { border: 0; background: rgba(255, 255, 255, .7); color: inherit; font: inherit; font-weight: 700; padding: 2px 10px; border-radius: 999px; cursor: pointer; transition: background .2s, transform .2s var(--spring); }
.req-pick:hover { background: #fff; transform: translateY(-1px); }

.bk-search { position: relative; display: flex; align-items: center; gap: 8px; }
.bk-search > .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.field .bk-search input { flex: 1; padding-left: 40px !important; }
.bk-search .btn { flex: none; height: 44px; }
#bk-cover { display: flex; align-items: center; gap: 4px; }
#bk-cover:empty { display: none; }
.bk-results { display: flex; flex-direction: column; gap: 8px; border-radius: 18px; }
.bk-results:empty { display: none; }
.bk-results.need { animation: shake .45s; box-shadow: 0 0 0 2px var(--bad); }
.bk-group { display: flex; flex-direction: column; gap: 6px; }
.bk-sugg-h { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.bk-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; animation: rise .4s var(--ease) both; transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.bk-group .bk-row:nth-child(2) { animation-delay: 40ms; } .bk-group .bk-row:nth-child(3) { animation-delay: 80ms; } .bk-group .bk-row:nth-child(4) { animation-delay: 120ms; }
.bk-group .bk-row:nth-child(5) { animation-delay: 160ms; } .bk-group .bk-row:nth-child(6) { animation-delay: 200ms; }
.bk-row:hover:not(.taken) { border-color: var(--brand); transform: translateX(2px); }
.bk-row.on { border-color: var(--brand); background: var(--brand-soft); }
.bk-row input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.bk-row.taken { cursor: default; background: var(--bg); opacity: .7; }
.bk-name { flex: 1; min-width: 0; font-size: 15px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-name b { color: var(--ink); }
.bk-price { font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.bk-price small { color: var(--muted); font-weight: 600; }
.bk-price em { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.bk-price em.prem { background: var(--warm); color: var(--warm-ink); }
.bk-taken { font-size: 12px; font-weight: 700; color: var(--bad); }
.sk { background: linear-gradient(90deg, var(--line-3) 0, #fff 50%, var(--line-3) 100%); background-size: 800px 100%; animation: shimmer 1.2s linear infinite; }
.bk-sk { height: 46px; border-radius: 14px; }
.bk-sum { background: var(--bg); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.bk-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.bk-line small { display: block; color: var(--muted); font-size: 12px; }
.bk-line.total { border-top: 1px dashed var(--line); padding-top: 10px; font-size: 16px; font-weight: 800; }
.bk-owner { margin: 2px 0 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.bk-prog { border-radius: 18px; padding: 16px; background: var(--ink); color: #fff; animation: rise .4s var(--ease) both; }
.bk-prog ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bk-prog li { display: flex; align-items: center; gap: 10px; font-size: 14px; opacity: .5; transition: opacity .3s; }
.bk-prog li.run, .bk-prog li.done, .bk-prog li.fail { opacity: 1; }
.bk-prog .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); display: grid; place-items: center; flex: none; }
.bk-prog li.run .st { border-color: #A5B4FC; border-top-color: transparent; animation: spin .8s linear infinite; }
.bk-prog li.done .st { background: var(--ok); border-color: var(--ok); animation: pop .4s var(--spring); }
.bk-prog li.fail .st { background: var(--bad); border-color: var(--bad); }
@media (max-width: 640px) {
  .req-row { flex-wrap: wrap; }
  .req-row .cell-acts { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Courses ---------- */
.crs-yrs { display: block; margin: 6px 0 0 2px; color: var(--muted); font-size: 12.5px; }
.crs-code { flex: none; width: 64px; height: 40px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--ink); letter-spacing: .01em; }
.cell-main .t small.crs-desc { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.crs-dept { min-width: 110px; max-width: 160px; }
.crs-hint { color: var(--muted); font-size: 12.5px; margin: -6px 0 0 54px; }
.seats { display: grid; gap: 6px; min-width: 110px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.seats i { display: block; height: 6px; border-radius: 99px; background: var(--line-3); overflow: hidden; }
.seats i b { display: block; height: 100%; border-radius: inherit; background: var(--brand); transform-origin: left; animation: seatGrow .9s var(--ease) both; }
.seats i.near b { background: #D97706; }
.seats i.full b { background: var(--bad); }
@keyframes seatGrow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .seats i b { animation: none; } }

/* ---------- Levels ---------- */
.crs-code.sm { width: 52px; height: 34px; border-radius: 10px; font-size: 12px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.tone-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.tone-pick label { cursor: pointer; }
.tone-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tone-pick i { display: grid; place-items: center; width: 44px; height: 36px; border-radius: 10px; font-style: normal; font-weight: 800; font-size: 13px; border: 2px solid transparent; transition: transform .2s var(--spring), border-color .2s; }
.tone-pick label:hover i { transform: translateY(-2px); }
.tone-pick input:checked + i { border-color: currentColor; box-shadow: 0 0 0 3px #fff inset; }
.tone-pick input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.preset-cols { display: grid; grid-template-columns: 1fr; gap: 18px; text-align: left; margin: 6px 0 4px; }
.preset-group h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.preset-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .2s, background .2s; }
.preset-row:hover { border-color: var(--brand-tint); background: var(--brand-soft); }
.preset-row.done { opacity: .6; cursor: default; background: var(--line-3); }
.preset-row .t { display: grid; min-width: 0; }
.preset-row .t b { font-size: 14px; color: var(--ink); }
.preset-row .t small { font-size: 12px; color: var(--muted); }
.preset-row input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
@media (max-width: 640px) { .preset-cols { grid-template-columns: 1fr; } }
.modal.wide { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }

/* ---------- Locked setting (set by the platform) ---------- */
.locked-field { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; row-gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--line-3); border: 1px dashed var(--line); color: var(--muted); }
.locked-field b { color: var(--ink); font-size: 15px; }
.locked-field small { grid-column: 2; font-size: 12.5px; }

/* ---------- Departments ---------- */
.dept-head { min-width: 160px; }
.dept-head b { display: block; color: var(--ink-2); font-weight: 600; }
.dept-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.crs-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crs-dept-filter { height: 44px; padding: 0 36px 0 14px; border-radius: 999px; max-width: 240px; }
@media (max-width: 760px) {
  .crs-filters { width: 100%; flex-direction: column; align-items: stretch; }
  .crs-filters .crs-dept-filter, .crs-filters .search-box { width: 100%; max-width: none; }
}
.crs-dept .pill { white-space: normal; height: auto; min-height: 26px; padding: 4px 10px; line-height: 1.3; text-align: left; }
.crs-dept { max-width: 150px; }
.cell-main .t small.crs-desc { max-width: 230px; }

/* ---------- Under-18 safety ---------- */
.safe-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.safe-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.safe-tag.need { background: var(--warn-soft); color: var(--warn); }
.safe-tag.ok { background: var(--ok-soft); color: var(--ok); }
.safe-tag.adult { background: #E0F2FE; color: #0369A1; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; }
.link-btn.sm { font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
.safe-pill { background: var(--ok-soft) !important; color: var(--ok) !important; display: inline-flex; align-items: center; gap: 4px; }
.sub-line { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.warn-t { color: var(--warn); }
.stu-minor-f { font-size: 13px; white-space: nowrap; }

/* ---------- Bulk import ---------- */
.imp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.imp-steps div { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.imp-steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; }
#imp-template { align-self: flex-start; }
#imp-body { display: flex; flex-direction: column; gap: 16px; }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--line); border-radius: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .2s, background .2s; }
.imp-drop:hover, .imp-drop:focus-visible, .imp-drop.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); outline: none; }
.imp-drop b { color: var(--ink); font-size: 15px; }
.imp-drop small { font-size: 12px; }
.imp-loading { display: flex; align-items: center; gap: 10px; padding: 24px; color: var(--muted); font-weight: 600; }
.imp-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.imp-sum span { padding: 12px 14px; border-radius: 14px; background: var(--bg); font-size: 12.5px; color: var(--muted); }
.imp-sum b { display: block; font-size: 22px; color: var(--ink); font-weight: 800; }
.imp-sum .ok b { color: var(--ok); }
.imp-sum .bad b { color: var(--bad); }
.imp-tbl { max-height: 380px; overflow: auto; border: 1px solid var(--line-2); border-radius: 14px; }
.imp-tbl .tbl td, .imp-tbl .tbl th { padding: 10px 12px; font-size: 13px; }
.imp-tbl thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.imp-bad { background: #FFF7F7; }
.imp-err, .imp-ok, .imp-note { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.imp-err { color: var(--bad); }
.imp-ok { color: var(--ok); }
.imp-note { color: var(--warn); font-weight: 500; }
.imp-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px 8px; }
.imp-done .done-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.imp-done h3 { margin: 0; font-size: 20px; }
.imp-done p { margin: 0; color: var(--text-2); max-width: 420px; }
@media (max-width: 640px) { .imp-steps, .imp-sum { grid-template-columns: 1fr; } }

/* ---------- Staff & roles ---------- */
.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.role-card { padding: 18px 20px; }
.role-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.role-top b { font-size: 24px; font-weight: 800; color: var(--ink); }
.role-card p { margin: 0; color: var(--text-2); font-size: 13px; }
.staff-scope { max-width: 260px; font-size: 13.5px; }
.role-pick { display: grid; gap: 8px; }
.role-pick label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-pick input { margin-top: 3px; accent-color: var(--brand); }
.role-pick b { display: block; color: var(--ink); font-size: 14px; }
.role-pick small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.scope-box { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding: 10px; border: 1px solid var(--line-2); border-radius: 14px; }
.scope-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scope-row > b { min-width: 64px; font-size: 13px; color: var(--ink); }
.scope-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.scope-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.scope-chip:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.scope-chip input { accent-color: var(--ok); }
@media (max-width: 900px) { .role-cards { grid-template-columns: 1fr; } }

/* ---------- Staff posts + Chat reports ---------- */
.pill.staff-pill { background: #F3EEFF; color: #6D28D9; }
.form-section > small.hint { display: block; color: var(--muted); font-size: 12px; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.rp-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.rp-card .q-acts { padding: 0; border: 0; flex-wrap: wrap; justify-content: flex-start; }
.rp-card .q-acts .btn { flex: 1 1 auto; }
.rp-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-top .date { margin-left: auto; color: var(--muted); font-size: 12px; }
.rp-q { margin: 0; padding: 12px 16px; border-left: 3px solid var(--bad); background: var(--bad-soft); border-radius: 0 14px 14px 0; color: var(--ink); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.rp-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.rp-kv dt { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rp-kv dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rp-kv dd small { display: block; color: var(--muted); font-weight: 500; }
.rp-ctx { border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: #FAFBFE; }
.rp-ctx > small { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rp-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.rp-line b { color: var(--ink); white-space: nowrap; }
.rp-line span { overflow-wrap: anywhere; }
.rp-line small { color: var(--muted-2); white-space: nowrap; }
.rp-line.hit { background: var(--bad-soft); }
.pl-box { margin-top: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #FAFBFF; }
.pl-box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.pl-box p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; }
.pl-box .toolbar-r { justify-content: flex-start; }
.rp-quote { display: block; font-size: 12px; color: var(--muted); }
.rp-photo { display: block; width: max-content; margin: 2px 0; }
.rp-photo img { display: block; max-width: 160px; max-height: 120px; border-radius: 8px; object-fit: cover; }
.rp-closed { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
@media (max-width: 640px) { .rp-grid { grid-template-columns: minmax(0, 1fr); } .rp-kv { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Organization switches ---------- */
.pill.swap-pill { background: #E0F2FE; color: #0369A1; }
.sw-dom { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink); font-size: 16px; overflow-wrap: anywhere; }
.sw-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; background: #FAFBFE; border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 14px; }
.sw-flow > div { display: flex; flex-direction: column; min-width: 0; }
.sw-flow small { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sw-flow b { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.sw-flow b + small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.sw-arrow { color: var(--brand); display: flex; }
.sw-hint { margin: 0; font-size: 13px; }
.sw-steps-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sw-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--warn-soft, #FEF3C7); color: var(--warn, #A16207); font-size: 12px; font-weight: 700; }
.sw-step.ok { background: var(--ok-soft, #DCFCE7); color: var(--ok, #15803D); }
.sw-step small { font-weight: 600; opacity: .8; }
.sw-found { display: flex; flex-direction: column; gap: 6px; }
.sw-pick { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; }
.sw-pick:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.sw-pick.off { opacity: .55; cursor: not-allowed; }
.sw-pick input { accent-color: var(--brand); }
.sw-pick span { display: flex; flex-direction: column; min-width: 0; }
.sw-pick b { color: var(--ink); }
.sw-pick small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .sw-flow { grid-template-columns: minmax(0, 1fr); } .sw-arrow { transform: rotate(90deg); } }

/* Credit statement (shared/credit-report.js: Admin → Credits and Platform → Credits) */
.cr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.cr-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.cr-filters select.input { width: auto; min-width: 150px; border-radius: 999px; height: 42px; }
.cr-stats .stat-num { font-size: 28px; }
.cr-card { margin-bottom: 24px; padding: 20px 20px 8px; }
.cr-card .card-head { margin-bottom: 8px; }
.tbl th.num, .tbl td.num { text-align: right; }
.cr-in { color: var(--ok, #15803D); }
.cr-out { color: var(--bad, #B91C1C); }
.cr-note { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cr-months tr.cr-click { cursor: pointer; }
.cr-months tr.cr-click:hover td, .cr-months tr.cr-click:focus td { background: var(--bg-soft, #F5F7FB); }
.cr-months tr.cr-quiet td { color: var(--muted); }
.cr-months tfoot td { border-top: 2px solid var(--line, #E2E8F0); }

/* Website plan cards (Book a domain) */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: border-color .2s, background-color .2s, box-shadow .2s, transform .2s var(--ease); }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:hover:not(.short) { border-color: var(--brand); transform: translateY(-2px); }
.plan-card.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.plan-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.plan-card.short { cursor: not-allowed; background: var(--bg); opacity: .6; }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; }
.plan-top b { color: var(--ink); white-space: nowrap; }
.plan-card > .plan-tag { align-self: flex-start; margin-top: 4px; }
.plan-card.on .plan-top b::before { content: '✓ '; color: var(--brand); }
.plan-tag { font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); white-space: nowrap; }
.plan-tag.bad { background: var(--bad-soft, #FEE2E2); color: var(--bad); }
.plan-price { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-sub { font-size: 12px; color: var(--muted); }
.plan-until { font-size: 11.5px; font-weight: 700; color: var(--brand); margin-top: 2px; white-space: nowrap; }
.plan-card.short .plan-until { color: var(--muted); }
@media (max-width: 560px) { .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Book a domain as a full page (openDrawer cls: 'drawer-page') */
.drawer-page .drawer { width: 100%; box-shadow: none; animation: pageIn .35s var(--ease) both; }
.drawer-page.closing .drawer { animation: pageOut .25s var(--ease) forwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pageOut { to { opacity: 0; transform: translateY(16px); } }
.drawer-page .drawer > header, .drawer-page .drawer > footer { padding-left: max(28px, calc((100% - 1180px) / 2)); padding-right: max(28px, calc((100% - 1180px) / 2)); }
.drawer-page .drawer-body { padding: 28px max(28px, calc((100% - 1180px) / 2)); }
.bk-page { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 32px; align-items: start; }
.bk-main, .bk-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.bk-side { position: sticky; top: 0; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
.bk-side .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-side .plan-card { background: #fff; }
.bk-side .plan-card.on { background: var(--brand-soft); }
.bk-side .plan-card.short { background: var(--bg); }
@media (max-width: 980px) { .bk-page { grid-template-columns: minmax(0, 1fr); } .bk-side { position: static; } }

/* Suggestions: a small icon next to Check (on = showing) */
.bk-sugg-ic { flex: none; width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); background: #fff; }
.bk-sugg-ic:hover { color: var(--brand); border-color: var(--brand); }
.bk-sugg-ic.on { color: #A16207; border-color: #F59E0B; background: #FEF3C7; }
#bk-sugg-box:empty { display: none; }
#bk-sugg-box { display: flex; flex-direction: column; gap: 8px; }
.bk-side .bk-sum { background: #fff; }
.bk-side .bk-line b { white-space: nowrap; }
.bk-side .bk-line span { min-width: 0; }

/* ---------- Activity page (shared/activity-log.js): admin panel, student / employee login, BIGWEB ---------- */
.al-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
.al-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.al-filters select.input { width: auto; min-width: 150px; height: 42px; border-radius: 999px; padding-top: 0; padding-bottom: 0; }
.al-filters .search-box { flex: 1 1 260px; min-width: 220px; }
.al-filters .search-box input { height: 42px; width: 100%; }
.al-filters .btn { height: 42px; display: inline-flex; align-items: center; gap: 6px; }
.al-filters .al-icon-btn { width: 42px; padding: 0; justify-content: center; }
.al-tbl td { vertical-align: middle; }
.al-when { color: var(--muted); font-size: 13px; }
.al-who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.al-who b { display: block; font-size: 14px; }
.al-who small { color: var(--muted); font-size: 12px; }
.al-ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; background: var(--brand-soft); color: var(--brand); }
.al-ava.al-student { background: #DCFCE7; color: #15803D; }
.al-ava.al-platform { background: #F3E8FF; color: #7E22CE; }
.al-what { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.al-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.al-ok { background: #DCFCE7; color: #15803D; }
.al-bad { background: #FEE2E2; color: #B91C1C; }
.al-warm { background: #FEF3C7; color: #A16207; }
.al-info { background: #E0F2FE; color: #0369A1; }
.al-muted { background: #F1F5F9; color: #64748B; }
.al-dev { display: block; font-size: 13px; }
.al-ip { color: var(--muted); font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.al-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line-3, #EEF0F4); }
.al-empty { padding: 40px; text-align: center; color: var(--muted); }

/* Receipts (₹) in the booking drawer */
.rc-list { display: flex; flex-direction: column; gap: 6px; }
.rc-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--text); }
.rc-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.rc-row span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rc-row b { color: var(--ink); font-size: 14px; }
.rc-row small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.rc-row em { font-style: normal; font-weight: 800; color: var(--ink); white-space: nowrap; }
.rc-row .ic { color: var(--brand); flex: none; }

/* ============ Help: first-login tips (shared/help.js) ============ */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tour { position: fixed; inset: 0; z-index: 110; animation: fade .2s; }
.tour.out { opacity: 0; transition: opacity .2s; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px rgba(11, 18, 32, .58);
  transition: left .35s var(--ease), top .35s var(--ease), width .35s var(--ease), height .35s var(--ease);
}
.tour.center .tour-spot { box-shadow: 0 0 0 9999px rgba(11, 18, 32, .58); }
.tour-card {
  position: fixed; width: min(360px, calc(100vw - 24px)); background: var(--card); border-radius: 18px; padding: 18px 20px 16px;
  box-shadow: var(--shadow), 0 2px 6px rgba(11, 18, 32, .12); outline: none;
  transition: left .35s var(--ease), top .35s var(--ease);
}
.tour-card.in { animation: modalIn .3s var(--ease); }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tour-count { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.tour-skip { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.tour-skip:hover { color: var(--ink); background: var(--line-3); }
.tour-card h2 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.tour-text { margin: 0 0 14px; color: var(--text); font-size: 14px; line-height: 1.55; }
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-dots { display: flex; gap: 5px; margin-right: auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 6px; background: var(--line); transition: width .25s var(--ease), background .25s; }
.tour-dots i.on { width: 18px; background: var(--brand); }

/* ============ Help: Bigu, the assistant for admins and staff ============ */
/* Bigu, the BigWeb elephant (same character and animation as packages/bigweb-ui/src/help-assistant.css), in the Star Of The City logo colours: indigo with gold cheeks */
.bw-buddy { display: block; flex-shrink: 0; overflow: visible; }
.bw-buddy * { stroke: none; }
/* Ears flap from where they join the head: a double flap, then a rest */
.bw-buddy-ear { fill: #818CF8; transform-box: fill-box; }
.bw-buddy-ear.left { transform-origin: right 40%; animation: bw-buddy-flap-l 3s ease-in-out infinite; }
.bw-buddy-ear.right { transform-origin: left 40%; animation: bw-buddy-flap-r 3s ease-in-out infinite; }
.bw-buddy-ear-in { fill: #F5B8D6; opacity: .9; }
.bw-buddy-head { fill: #4F46E5; }
.bw-buddy-brow { fill: #fff; opacity: .12; }
/* The trunk: a thick curve with a darker outline (so it shows even in front of the face) and ring folds across it.
   Its shape is animated in help.js (swing right and left, lift to each side, up high to trumpet). */
.bw-buddy-trunk path { fill: none; stroke-linecap: round; }
.bw-buddy-trunk .bw-buddy-trunk-line { stroke: #3730A3 !important; stroke-width: 7.4; }
.bw-buddy-trunk .bw-buddy-trunk-skin { stroke: #4F46E5 !important; stroke-width: 6.2; }
.bw-buddy-root { fill: #4F46E5; }
.bw-buddy-trunk .bw-buddy-trunk-rings { stroke: #312E81 !important; stroke-width: 4.4; stroke-linecap: butt; opacity: .35;
  stroke-dasharray: 0 11 .55 3.4 .55 3.4 .55 3.4 .55 60; }
.bw-buddy-eyes { fill: #0A0F2C; transform-box: fill-box; transform-origin: center; animation: bw-buddy-blink 4.2s infinite; }
.bw-buddy-shine { fill: #fff; }
.bw-buddy-cheek { fill: #FBBF24; opacity: .75; }
.bw-buddy-body { transform-box: fill-box; transform-origin: center bottom; animation: bw-buddy-bob 3s ease-in-out infinite; }
.bw-buddy.busy .bw-buddy-body, .bw-buddy.busy .bw-buddy-ear { animation-duration: .9s; }
@keyframes bw-buddy-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes bw-buddy-flap-l { 0%, 45%, 100% { transform: rotate(0) scaleX(1); } 12% { transform: rotate(-16deg) scaleX(.82); } 24% { transform: rotate(2deg) scaleX(1.02); } 34% { transform: rotate(-9deg) scaleX(.9); } }
@keyframes bw-buddy-flap-r { 0%, 45%, 100% { transform: rotate(0) scaleX(1); } 12% { transform: rotate(16deg) scaleX(.82); } 24% { transform: rotate(-2deg) scaleX(1.02); } 34% { transform: rotate(9deg) scaleX(.9); } }
@keyframes bw-buddy-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
/* Every 10 seconds (help.js adds .shout and raises the trunk): it trumpets, sound waves burst out, the ears flap fast,
   and Bigu grows a little for a moment */
.bw-buddy-toot { opacity: 0; }
.bw-buddy-toot path { fill: none; stroke: #F59E0B !important; stroke-width: 2.2; stroke-linecap: round; }
.bw-buddy-toot path { transform-box: fill-box; transform-origin: left center; opacity: 0; }
.bw-buddy { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.bw-buddy.shout { transform: scale(1.18); }
/* Trumpeting like a real elephant: ears spread wide and stay open, the head lifts back, the mouth opens under the raised trunk */
.bw-buddy-mouth { fill: #9D174D; transform-box: fill-box; transform-origin: center top; transform: scale(.2, 0); }
.bw-buddy.shout .bw-buddy-mouth { animation: bw-buddy-mouth 2.4s ease-in-out; }
.bw-buddy.shout .bw-buddy-ear.left { animation: bw-buddy-spread-l 2.4s ease-in-out; }
.bw-buddy.shout .bw-buddy-ear.right { animation: bw-buddy-spread-r 2.4s ease-in-out; }
.bw-buddy.shout .bw-buddy-body { animation: bw-buddy-lift 2.4s ease-in-out; }
.bw-buddy-nose { opacity: 0; }
.bw-buddy-nose-end { fill: #3730A3; }
.bw-buddy-nostril { fill: #1E1B4B; }
.bw-buddy.shout .bw-buddy-nose { animation: bw-buddy-nose 2.4s ease-in-out; }
@keyframes bw-buddy-nose { 0%, 12%, 90%, 100% { opacity: 0; } 18%, 84% { opacity: 1; } }
@keyframes bw-buddy-mouth { 0%, 22%, 90%, 100% { transform: scale(.2, 0); } 36%, 80% { transform: scale(1.1, 1.2); } 50%, 66% { transform: scale(1.2, 1.35); } }
@keyframes bw-buddy-spread-l { 0%, 100% { transform: rotate(0) scaleX(1); } 20%, 80% { transform: rotate(-24deg) scale(1.12, 1.06); } 35%, 65% { transform: rotate(-20deg) scale(1.08, 1.04); } 50% { transform: rotate(-25deg) scale(1.13, 1.06); } }
@keyframes bw-buddy-spread-r { 0%, 100% { transform: rotate(0) scaleX(1); } 20%, 80% { transform: rotate(24deg) scale(1.12, 1.06); } 35%, 65% { transform: rotate(20deg) scale(1.08, 1.04); } 50% { transform: rotate(25deg) scale(1.13, 1.06); } }
@keyframes bw-buddy-lift { 0%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-3px) rotate(-2deg); } 36% { transform: translateY(-3.5px) rotate(2deg); } 52% { transform: translateY(-3px) rotate(-2deg); } 68% { transform: translateY(-3.5px) rotate(1.5deg); } 84% { transform: translateY(-1px) rotate(0); } }
.bw-buddy.shout .bw-buddy-toot { opacity: 1; }
.bw-buddy.shout .bw-buddy-toot path { animation: bw-buddy-toot .5s ease-out .95s 3; }
.bw-buddy.shout .bw-buddy-toot path:nth-child(2) { animation-delay: 1.05s; }
.bw-buddy.shout .bw-buddy-toot path:nth-child(3) { animation-delay: 1.15s; }
@keyframes bw-buddy-toot { 0% { opacity: 0; transform: translateX(-3px) scale(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateX(3px) scale(1.15); } }
/* Pointer on Bigu (help.js adds .hold and raises the trunk): it holds the trumpet pose until the pointer leaves */
.bw-buddy.hold { transform: scale(1.18); }
.bw-buddy.hold .bw-buddy-mouth { animation: none; transform: scale(1.1, 1.2); transition: transform .3s; }
.bw-buddy.hold .bw-buddy-ear.left { animation: none; transform: rotate(-22deg) scale(1.1, 1.05); transition: transform .35s; }
.bw-buddy.hold .bw-buddy-ear.right { animation: none; transform: rotate(22deg) scale(1.1, 1.05); transition: transform .35s; }
.bw-buddy.hold .bw-buddy-body { animation: none; transform: translateY(-3px); transition: transform .35s; }
.bw-buddy.hold .bw-buddy-nose { animation: none; opacity: 1; transition: opacity .2s .45s; }
.bw-buddy.hold .bw-buddy-toot { opacity: 1; }
.bw-buddy.hold .bw-buddy-toot path { animation: bw-buddy-toot 1.1s ease-out .7s infinite; }
.bw-buddy.hold .bw-buddy-toot path:nth-child(2) { animation-delay: .85s; }
.bw-buddy.hold .bw-buddy-toot path:nth-child(3) { animation-delay: 1s; }
.bigu-badge { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); flex: none; }
.bigu-thinking { display: inline-flex; align-items: center; gap: 8px; }
/* The button is the whole character; on hover it raises its trunk and "Ask Bigu" curves under it */
.bigu-fab {
  position: fixed; right: 18px; bottom: 14px; z-index: 70; display: block; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 10px 16px rgba(72, 0, 120, .35)); transition: transform .25s var(--ease);
}
.bigu-fab:hover { transform: translateY(-4px) scale(1.06); }
.bigu-fab:hover .bw-buddy-ear { animation-duration: 1.6s; }
.bigu-fab:focus-visible { outline: 3px solid var(--brand-tint); outline-offset: 4px; border-radius: 50%; }
.bigu-fab-tip {
  position: absolute; right: 78px; top: 50%; transform: translateY(-50%) translateX(6px); white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: #fff; color: #480078; font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .18); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
}
.bigu-fab:focus-visible:not(.asking) .bigu-fab-tip { opacity: 1; transform: translateY(-50%); }
/* "I am Bigu!" while it trumpets: small letters curved like a U under Bigu (an SVG textPath on a half circle round its chin) */
.bigu-fab-say {
  position: absolute; left: calc(50% - 50px); top: calc(50% - 57px); width: 100px; height: 100px; max-width: none; overflow: visible; pointer-events: none;
  opacity: 0; transform: scale(.7); transform-origin: 50% 50%;
}
.bigu-fab-say text {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; fill: #4338CA;
  stroke: #fff; stroke-width: 3px; stroke-linejoin: round; paint-order: stroke;
}
.bigu-fab.shouting .bigu-fab-say { animation: bigu-say 2.5s cubic-bezier(.34, 1.56, .64, 1) both; }
.bigu-fab.asking .bigu-fab-say { animation: bigu-ask .45s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes bigu-ask { 0% { opacity: 0; transform: scale(.7) rotate(-12deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.bigu-fab.shouting .bigu-fab-tip { opacity: 0; }
@keyframes bigu-say {
  0% { opacity: 0; transform: scale(.7) rotate(-12deg); }
  16% { opacity: 1; transform: scale(1.06) rotate(0); }
  24%, 84% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.1) rotate(0); }
}
.has-bigu #toasts { bottom: 96px; }
.bigu {
  position: fixed; right: 20px; bottom: 96px; z-index: 75; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: var(--card); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow), 0 2px 8px rgba(11, 18, 32, .1); border: 1px solid var(--line); animation: modalIn .25s var(--ease);
}
.bigu[hidden] { display: none; }
.bigu-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line-2); }
.bigu-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.bigu-head b { color: var(--ink); font-size: 15px; }
.bigu-head small { color: var(--muted); font-size: 12px; }
.bigu-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); overscroll-behavior: contain; }
.bigu-msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; color: var(--text); animation: rise .25s var(--ease); }
.bigu-msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line-2); border-top-left-radius: 4px; }
.bigu-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.bigu-msg p { margin: 0 0 6px; }
.bigu-msg p:last-child { margin-bottom: 0; }
.bigu-msg ul, .bigu-msg ol { margin: 4px 0 8px; padding-left: 20px; }
.bigu-msg li { margin: 2px 0; }
.bigu-msg b { color: var(--ink); }
.bigu-msg.me b { color: #fff; }
.bigu-msg-title { display: block; margin-bottom: 4px; }
.bigu-acts { margin-top: 8px; }
.bigu-chips-label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.bigu-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bigu-chip { border: 1px solid var(--brand-tint); background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
.bigu-chip:hover { background: #fff; border-color: var(--brand); }
.bigu-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.bigu-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); animation: pulse 1s infinite; }
.bigu-typing i:nth-child(2) { animation-delay: .15s; }
.bigu-typing i:nth-child(3) { animation-delay: .3s; }
.bigu-ask { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-2); background: var(--card); }
.bigu-ask input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; color: var(--ink); }
.bigu-ask input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bigu-ask .btn { height: 38px; }
@media (max-width: 640px) {
  .bigu-fab { right: 10px; bottom: 8px; }
  .bigu-fab .bw-buddy { width: 60px; height: 60px; }
  .bigu-fab-say { left: calc(50% - 42px); top: calc(50% - 51px); width: 84px; height: 84px; }
  .bigu { right: 8px; left: 8px; bottom: 80px; width: auto; height: calc(100vh - 150px); }
  .has-bigu #toasts { bottom: 84px; }
}
/* Colour swatches: a person's website colour, and the organization's theme colour (Site settings) */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s var(--spring); }
.swatch:hover { transform: translateY(-2px); }
.swatch input[type=radio] { position: absolute; opacity: 0; }
.sw-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); color: #fff; display: grid; place-items: center; }
.sw-dot .ic { opacity: 0; transform: scale(.4); transition: all .3s var(--spring); }
.swatch:has(input:checked) { border-color: var(--sw); background: var(--sw-soft); }
.swatch:has(input:checked) .sw-dot .ic { opacity: 1; transform: none; }
.swatch:has(input[type=radio]:focus-visible) { outline: 3px solid var(--sw); outline-offset: 2px; }
.sw-custom input[type=color] { width: 30px; height: 26px; margin-left: 2px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.sw-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.sw-custom input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.theme-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 16px; }
.theme-row .field { max-width: 180px; margin: 0; }
.theme-row .field input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.theme-note { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; color: var(--warn); }
.theme-note:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tour, .tour-card.in, .bigu, .bigu-msg { animation: none; }
  .bw-buddy-body, .bw-buddy-ear, .bw-buddy-eyes, .bw-buddy-toot path, .bw-buddy-mouth { animation: none !important; }
  .tour-spot, .tour-card { transition: none; }
}

/* Domain bookings: is the website open on its own domain yet? */
.cell-main .t small[class^="setup-"] { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-weight: 600; }
.setup-ok { color: #15803D; }
.setup-warn { color: #A16207; }
.setup-bad { color: #B91C1C; }
