/* ============================================================
   SFG Broker Portal — Design System
   Type: Space Grotesk (display) / Inter (UI)
   Palette: ink, paper, greys + electric cobalt (sparingly)
   ============================================================ */

:root {
  --font-display: "Space Grotesk", sans-serif;
  --font-ui: "Inter", sans-serif;

  --bg: #f1f2f4;
  --bg-deep: #e8eaee;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --ink: #0e1013;
  --ink-2: #4d5261;
  --ink-3: #6b7284;
  --line: #e3e5eb;
  --line-strong: #d3d6df;

  /* brand blue sampled from SFG mocks: fill #88e4f5, tint #eaf7fb, teal ink #245668 */
  --brand: #88e4f5;
  --brand-deep: #5fd9ef;
  --on-brand: #0e3540;
  --accent: #1e6b86;
  --accent-deep: #17566d;
  --accent-soft: rgba(136, 228, 245, 0.16);
  --accent-soft-2: rgba(136, 228, 245, 0.34);
  --on-accent: #0e3540;

  --good: #0e9f6e;
  --warn: #d97706;
  --bad: #dc2626;

  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(14, 16, 19, 0.05);
  --shadow-md: 0 10px 30px -12px rgba(14, 16, 19, 0.16);
  --shadow-lg: 0 24px 60px -20px rgba(14, 16, 19, 0.28);

  --sidenav-w: 236px;
  --topbar-h: 68px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --grain-opacity: 0.5;
}

[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-deep: #08090b;
  --surface: #14161b;
  --surface-2: #1a1d24;
  --surface-3: #21252e;
  --ink: #f1f2f6;
  --ink-2: #b4bac7;
  --ink-3: #99a1b3;
  --line: #22252f;
  --line-strong: #303542;

  --brand: #88e4f5;
  --brand-deep: #a5ecf9;
  --on-brand: #0b262e;
  --accent: #85dcef;
  --accent-deep: #a5ecf9;
  --accent-soft: rgba(136, 228, 245, 0.12);
  --accent-soft-2: rgba(136, 228, 245, 0.24);
  --on-accent: #0b262e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --grain-opacity: 0.35;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--brand); color: var(--on-brand); }

/* ---------- Grain overlay ---------- */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: calc(0.032 * var(--grain-opacity));
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); }

/* ---------- Icons ---------- */
.icon, svg.feather {
  width: 18px; height: 18px;
  stroke-width: 1.8;
  flex: none;
}
svg.feather.sm { width: 15px; height: 15px; }

/* ============================================================
   Layout: side nav + shell
   ============================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

.sidenav {
  width: var(--sidenav-w);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 60;
  overflow-y: auto;
  scrollbar-width: thin;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 0;
  margin-bottom: 30px;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 12px; letter-spacing: 0.02em;
  position: relative;
  transition: background 0.35s ease, color 0.35s ease;
}
.brand-mark::after {
  content: "";
  position: absolute; right: 4px; bottom: 4px;
  width: 5px; height: 5px; border-radius: 2px;
  background: var(--brand);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
}
.brand-name span { color: var(--ink-3); font-weight: 500; }

.nav-label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 12px;
  margin: 18px 0 8px;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9.5px 12px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active {
  background: var(--ink);
  color: var(--bg);
}
.nav-item.active .feather { stroke: var(--accent); }
[data-theme="dark"] .nav-item.active { background: #f1f2f6; color: #0e1013; }
.nav-item .badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 20px;
  padding: 1px 7px;
}
.nav-item.active .badge { background: var(--brand); }

.sidenav-footer { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

.masterclass-card {
  border-radius: var(--r-lg);
  padding: 16px 14px 14px;
  margin: 14px 2px 12px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(136, 228, 245, 0.4), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(136, 228, 245, 0.18), transparent 60%),
    var(--ink);
  color: #fff;
}
[data-theme="dark"] .masterclass-card { background:
    radial-gradient(120% 90% at 10% 0%, rgba(136, 228, 245, 0.32), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(136, 228, 245, 0.15), transparent 60%),
    #101218; }
.masterclass-card::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.14;
  pointer-events: none;
}
a.masterclass-card { display: block; transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease; }
a.masterclass-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.masterclass-card .callout-tag {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
  position: relative; z-index: 1;
}
.masterclass-card .meta b { color: #fff; font-weight: 600; }
.masterclass-card h4 { font-size: 15px; margin-bottom: 4px; position: relative; z-index: 1; }
.masterclass-card p { font-size: 12px; color: rgba(255,255,255,0.72); position: relative; z-index: 1; }
.masterclass-card .progress {
  margin-top: 12px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.2);
  position: relative; z-index: 1;
  overflow: hidden;
}
.masterclass-card .progress i {
  display: block; height: 100%; width: 64%;
  background: #fff; border-radius: 4px;
}
.masterclass-card .meta {
  display: flex; justify-content: space-between;
  font-size: 11px; margin-top: 7px;
  color: rgba(255,255,255,0.75);
  position: relative; z-index: 1;
}

/* ---------- Shell / topbar ---------- */
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 34px;
  position: sticky; top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.crumb { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.crumb b { color: var(--ink); font-weight: 600; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search-trigger {
  display: flex; align-items: center; gap: 10px;
  height: 38px;
  padding: 0 12px;
  min-width: 220px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.search-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.search-trigger kbd {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 11px;
  background: var(--surface-3);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--ink-2);
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  position: relative;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  border: 1.5px solid var(--surface);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line);
}
.avatar.initials {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  aspect-ratio: 1 / 1;
}

/* Portal-only parity refinement: keep the desktop left rail fixed while the shell scrolls. */
@media (min-width: 981px) {
  .sidenav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .shell {
    margin-left: var(--sidenav-w);
    width: calc(100% - var(--sidenav-w));
    padding-top: var(--topbar-h);
  }
  .topbar {
    position: fixed;
    top: 0;
    left: var(--sidenav-w);
    right: 0;
    z-index: 80;
  }
}

.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who span { font-size: 11.5px; color: var(--ink-3); }

/* mobile-only topbar logo + hamburger (injected by app.js) */
.topbar-logo { display: none; align-items: center; gap: 10px; }
.menu-btn { display: none; }

/* off-canvas scrim (mobile nav) */
.nav-scrim {
  position: fixed; inset: 0;
  background: rgba(10, 12, 15, 0.45);
  backdrop-filter: blur(3px);
  z-index: 290;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

/* floating dock (mobile) */
.dock {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 150;
  display: none;
  gap: 2px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 7px;
  box-shadow: var(--shadow-lg);
}
.dock a, .dock button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 60px;
  padding: 8px 0 6px;
  border-radius: 12px;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-3);
  transition: background 0.18s ease, color 0.18s ease;
}
.dock a .feather, .dock button .feather { width: 19px; height: 19px; }
.dock a.active { background: var(--accent-soft); color: var(--accent); }
.dock a:active, .dock button:active { transform: scale(0.94); }

/* theme toggle icon swap */
.theme-toggle .feather-sun { display: none; }
[data-theme="dark"] .theme-toggle .feather-sun { display: block; }
[data-theme="dark"] .theme-toggle .feather-moon { display: none; }

/* ---------- Main ---------- */
.main {
  padding: 26px 34px 80px;
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
}

/* ============================================================
   Shared components
   ============================================================ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px;
  background: var(--accent); border-radius: 2px;
}

.page-head { margin: 14px 0 30px; display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head .titles { max-width: 640px; }
.page-title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
}
.page-sub { color: var(--ink-2); margin-top: 10px; font-size: 15px; max-width: 54ch; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
[data-theme="dark"] .btn-primary { background: #f1f2f6; color: #0e1013; }
.btn-accent { background: var(--brand); color: var(--on-brand); }
.btn-accent:hover { background: var(--brand-deep); box-shadow: 0 8px 24px -8px var(--brand); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); color: #fff; }
.btn.sm { height: 33px; min-height: 33px; padding: 0 13px; font-size: 12.5px; border-radius: var(--r-sm); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-out);
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 13px;
  font-size: 12.5px; font-weight: 500;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
[data-theme="dark"] .chip.active { background: #f1f2f6; color: #0e1013; border-color: #f1f2f6; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--ink-2);
}
.tag.blue { background: var(--accent-soft); color: var(--accent); }
.tag.good { background: rgba(14,159,110,0.1); color: var(--good); }
.tag.warn { background: rgba(217,119,6,0.12); color: var(--warn); }
.tag.bad { background: rgba(220,38,38,0.1); color: var(--bad); }

/* avatar stacks */
.avatar-stack { display: flex; align-items: center; }
.avatar-stack img {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--surface);
  object-fit: cover;
  margin-left: -8px;
  transition: transform 0.18s var(--ease-out);
}
.avatar-stack img:first-child { margin-left: 0; }
.avatar-stack:hover img { transform: translateX(2px); }
.avatar-stack .more {
  width: 26px; height: 26px; border-radius: 50%;
  margin-left: -8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
  z-index: 1;
}

/* skeleton shimmer */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

/* ============================================================
   Command palette
   ============================================================ */
.cmdk {
  position: fixed; inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  background: color-mix(in srgb, var(--bg-deep) 62%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cmdk.open { display: flex; }
.cmdk-panel {
  width: 640px; max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input-row .feather { color: var(--ink-3); }
.cmdk-input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--ink);
}
.cmdk-input::placeholder { color: var(--ink-3); }
.cmdk-results { max-height: 46vh; overflow-y: auto; padding: 8px; }
.cmdk-group-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 10px 12px 5px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--ink-2);
}
.cmdk-item .t { color: var(--ink); font-weight: 500; font-size: 14px; }
.cmdk-item .s { font-size: 12px; color: var(--ink-3); }
.cmdk-item.sel, .cmdk-item:hover { background: var(--accent-soft); }
.cmdk-item.sel .t { color: var(--accent); }
.cmdk-item .go { margin-left: auto; color: var(--ink-3); opacity: 0; }
.cmdk-item.sel .go { opacity: 1; color: var(--accent); }
.cmdk-empty { padding: 34px; text-align: center; color: var(--ink-3); font-size: 14px; }
.cmdk-foot {
  display: flex; gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
}
.cmdk-foot kbd {
  font-family: var(--font-ui);
  background: var(--surface-3); border-radius: 4px;
  padding: 1px 5px; font-size: 10.5px; margin-right: 4px;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

/* ticker */
.ticker-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  display: flex; align-items: center;
  height: 40px;
  margin-bottom: 26px;
  position: relative;
}
.ticker-label {
  flex: none;
  display: flex; align-items: center; gap: 7px;
  height: 100%;
  padding: 0 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  z-index: 2;
}
[data-theme="dark"] .ticker-label { background: #f1f2f6; color: #0e1013; }
.ticker-label .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft-2); }
  55% { box-shadow: 0 0 0 6px transparent; }
}
.ticker-track {
  display: flex; gap: 44px;
  white-space: nowrap;
  padding-left: 24px;
  animation: ticker 42s linear infinite;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker-item { font-size: 12.5px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.ticker-item b { color: var(--ink); font-weight: 600; }
.ticker-item .up { color: var(--good); } .ticker-item .down { color: var(--bad); }

/* hero row */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  margin-bottom: 18px;
}
.dash-greeting { padding: 6px 4px; }
.dash-greeting .date-line {
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.dash-greeting h1 {
  font-size: clamp(34px, 4.2vw, 52px);
  font-weight: 600;
}
.dash-greeting h1 em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--brand) 60%, var(--accent)));
  -webkit-background-clip: text; background-clip: text;
}
.dash-greeting .sub { margin-top: 12px; color: var(--ink-2); font-size: 15px; max-width: 46ch; }

.quick-stats {
  display: flex; gap: 28px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.qstat { min-width: 108px; }
.qstat .num {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 600; letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 5px;
}
.qstat .num small { font-size: 13px; color: var(--good); font-weight: 600; }
.qstat .lbl { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-weight: 500; }

/* spotlight card (next event) */
.spotlight {
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  color: #fff;
  min-height: 250px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}
.spotlight img.bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);
  transition: transform 0.9s var(--ease-out);
}
.spotlight:hover img.bg { transform: scale(1.1); }
.spotlight::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(200deg, rgba(10,12,18,0) 20%, rgba(10,12,18,0.82) 78%),
              linear-gradient(0deg, rgba(136,228,245,0.22), rgba(136,228,245,0) 45%);
}
.spotlight .top-row {
  position: absolute; top: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.spotlight .tag-live {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 30px;
}
.spotlight h3 { font-size: 22px; margin: 6px 0 4px; color: #fff; }
.spotlight .when { font-size: 13px; color: rgba(255,255,255,0.82); display: flex; align-items: center; gap: 7px; }
.spotlight .foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px;
}
.spotlight .avatar-stack img, .spotlight .avatar-stack .more { border-color: rgba(255,255,255,0.4); }
.spotlight .btn { background: #fff; color: #0e1013; height: 36px; }
.spotlight .countdown { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9); letter-spacing: 0.04em; }

/* widget board */
.board-bar {
  display: flex; align-items: center; gap: 12px;
  margin: 6px 0 16px;
}
.board-bar h2 { font-size: 18px; font-weight: 600; }
.board-bar .hint {
  font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.board-bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.widget { grid-column: span 2; display: flex; flex-direction: column; min-height: 320px; position: relative; }
.widget.w-wide { grid-column: span 4; }
.widget.dragging {
  z-index: 40;
  box-shadow: var(--shadow-lg);
  transform: scale(1.02) rotate(0.6deg);
  cursor: grabbing;
}
.widget.drop-hint { outline: 2px dashed var(--accent); outline-offset: 4px; }

.widget-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px;
}
.widget-head h3 { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.widget-head h3 .feather { color: var(--accent); width: 16px; height: 16px; }
.widget-head .spacer { flex: 1; }
.widget-head .link {
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 0.15s ease;
}
.widget-head .link:hover { color: var(--accent); }
.drag-handle {
  color: var(--ink-3);
  cursor: grab;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  touch-action: none;
}
.drag-handle:hover { background: var(--surface-3); color: var(--ink); }
.drag-handle:active { cursor: grabbing; }

.widget-body { padding: 2px 8px 12px; flex: 1; display: flex; flex-direction: column; }

/* event rows in widget */
.event-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 10px;
  border-radius: var(--r-md);
  transition: background 0.16s ease;
}
.event-row:hover { background: var(--surface-2); }
.date-block {
  flex: none;
  width: 46px; height: 48px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display);
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease;
}
.date-block b { font-size: 17px; font-weight: 700; }
.date-block span { font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; color: var(--ink-3); }
.event-row:hover .date-block { background: var(--brand); color: var(--on-brand); }
.event-row:hover .date-block span { color: rgba(14,53,64,0.72); }
.event-row .info { min-width: 0; flex: 1; }
.event-row .info b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-row .info span { font-size: 12px; color: var(--ink-3); }
.event-row .arrow { color: var(--ink-3); opacity: 0; transform: translateX(-4px); transition: all 0.18s var(--ease-out); }
.event-row:hover .arrow { opacity: 1; transform: none; color: var(--accent); }

/* forum rows */
.forum-mini {
  display: flex; gap: 12px;
  padding: 11px 10px;
  border-radius: var(--r-md);
  transition: background 0.16s ease;
}
.forum-mini:hover { background: var(--surface-2); }
.forum-mini img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.forum-mini .info { min-width: 0; }
.forum-mini .info b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-mini .info span { font-size: 12px; color: var(--ink-3); }
.forum-mini .votes {
  margin-left: auto; flex: none; align-self: center;
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.forum-mini .votes .feather { width: 13px; height: 13px; color: var(--accent); }

/* resource rows */
.res-row {
  display: flex; align-items: center; gap: 13px;
  padding: 10.5px 10px;
  border-radius: var(--r-md);
  transition: background 0.16s ease;
}
.res-row:hover { background: var(--surface-2); }
.res-row .fmt {
  flex: none;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.res-row .fmt .feather { width: 16px; height: 16px; }
.res-row .info { min-width: 0; flex: 1; }
.res-row .info b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-row .info span { font-size: 12px; color: var(--ink-3); }
.res-row .views { font-size: 12px; color: var(--ink-3); display: flex; gap: 5px; align-items: center; flex: none; }

/* favourites empty state */
.fav-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  padding: 20px;
  color: var(--ink-3);
  font-size: 13px;
}
.fav-empty .ring {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px dashed var(--line-strong);
  display: grid; place-items: center;
  color: var(--ink-3);
}
.fav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: var(--r-md);
}
.fav-item:hover { background: var(--surface-2); }
.fav-item .feather { color: var(--accent); width: 15px; height: 15px; }
.fav-item b { font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-item button { color: var(--ink-3); } .fav-item button:hover { color: var(--bad); }

/* quick links widget */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 4px 10px 4px; }
.qlink {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all 0.18s var(--ease-out);
  background: var(--surface);
}
.qlink:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.qlink .feather { color: var(--accent); }
.qlink b { font-size: 13px; font-weight: 600; }
.qlink span { font-size: 11.5px; color: var(--ink-3); }

/* backdrop picker */
.bg-menu {
  position: absolute; right: 0; top: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: none;
  z-index: 80;
  width: 218px;
}
.bg-menu.open { display: block; }
.bg-menu .lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.bg-swatches { display: flex; gap: 8px; }
.bg-swatch {
  width: 34px; height: 34px; border-radius: 8px;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.bg-swatch:hover { transform: scale(1.1); }
.bg-swatch.active { border-color: var(--accent); }
.bg-swatch[data-bg="plain"] { background: var(--bg); }
.bg-swatch[data-bg="mesh"] { background: radial-gradient(at 30% 20%, rgba(136,228,245,0.5), transparent 60%), radial-gradient(at 80% 80%, rgba(136,228,245,0.28), transparent 55%), var(--bg); }
.bg-swatch[data-bg="dots"] { background-image: radial-gradient(var(--line-strong) 1.2px, var(--bg) 1.2px); background-size: 8px 8px; }
.bg-swatch[data-bg="grid"] { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 9px 9px; background-color: var(--bg); }

/* body backdrops */
body[data-bg="mesh"] {
  background-image:
    radial-gradient(56% 42% at 12% -4%, var(--accent-soft-2), transparent 62%),
    radial-gradient(50% 44% at 96% 32%, var(--accent-soft), transparent 64%);
  background-attachment: fixed;
}
body[data-bg="dots"] {
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}
body[data-bg="grid"] {
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* ============================================================
   EVENTS
   ============================================================ */
.featured-strip { margin: 8px 0 44px; position: relative; }
.featured-strip .strip-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.featured-strip .strip-head h2 { font-size: 19px; }
.strip-nav { margin-left: auto; display: flex; gap: 8px; }

.slider-viewport {
  overflow: hidden;
  margin: 0 -18px;
  padding: 16px 18px;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
}
.slider-viewport:active { cursor: grabbing; }
.slider-track { display: flex; gap: 18px; will-change: transform; }
.slider-track .feat-card { will-change: transform; }

.feat-card {
  flex: none;
  width: 420px;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  color: #fff;
  height: 300px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px;
  isolation: isolate;
  user-select: none;
}
.feat-card img.bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
  transition: transform 0.8s var(--ease-out);
}
.feat-card:hover img.bg { transform: scale(1.06); }
.feat-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(195deg, rgba(10,12,18,0.05) 30%, rgba(10,12,18,0.85) 85%);
}
.feat-card .cat {
  position: absolute; top: 14px; left: 14px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
  padding: 5px 11px; border-radius: 30px;
}
.feat-card .num {
  position: absolute; top: 8px; right: 14px;
  font-family: var(--font-display);
  font-size: 44px; font-weight: 700;
  color: rgba(255,255,255,0.24);
  letter-spacing: -0.04em;
}
.feat-card h3 { font-size: 21px; margin-bottom: 5px; color: #fff; }
.feat-card .when { font-size: 12.5px; color: rgba(255,255,255,0.85); display: flex; gap: 7px; align-items: center; }
.feat-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.feat-card .avatar-stack img, .feat-card .avatar-stack .more { border-color: rgba(20,22,30,0.5); }
.feat-card .btn { height: 34px; background: #fff; color: #0e1013; font-size: 12.5px; }

/* events layout */
.events-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 34px;
  align-items: start;
}
.filter-rail { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 22px; }
.filter-group .fg-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.filter-group .fg-label button { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: 0; text-transform: none; }
.filter-opts { display: flex; flex-wrap: wrap; gap: 7px; }

.month-block { margin-bottom: 40px; }
.month-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 48px;
  position: sticky; top: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  padding: 12px 0 26px;
  z-index: 5;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.month-head h2 { font-size: 26px; font-weight: 600; }
.month-head span { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.month-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.event-card {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 20px;
  padding: 20px;
  margin-bottom: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.event-card.cancelled { opacity: 0.55; }
.event-card .date-block { width: 74px; height: 76px; border-radius: var(--r-md); }
.event-card .date-block b { font-size: 26px; }
.event-card .date-block span { font-size: 10.5px; }
.event-card:hover .date-block { background: var(--brand); color: var(--on-brand); }
.event-card:hover .date-block span { color: rgba(14,53,64,0.72); }
.event-card .body { min-width: 0; }
.event-card .body .tags { display: flex; gap: 7px; margin-bottom: 7px; flex-wrap: wrap; }
.event-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 5px; }
.event-card .meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3);
}
.event-card .meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-card .desc { font-size: 13px; color: var(--ink-2); margin-top: 8px; max-width: 62ch; }
.event-card .side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.event-card .side .going { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.event-card .actions { display: flex; gap: 8px; }

.save-btn {
  width: 33px; height: 33px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-3);
  background: var(--surface);
  transition: all 0.18s ease;
}
.save-btn:hover { border-color: var(--accent); color: var(--accent); }
.save-btn.saved { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.save-btn.saved .feather { fill: currentColor; }

/* ============================================================
   RESOURCES — topics
   ============================================================ */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.topic-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 260px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px;
  isolation: isolate;
  color: #fff;
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.topic-card > img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.9s var(--ease-out), filter 0.4s ease;
}
.topic-card:hover > img { transform: scale(1.07); }
.topic-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(196deg, rgba(10,12,18,0.06) 32%, rgba(10,12,18,0.88) 88%);
  transition: opacity 0.3s ease;
}
.topic-card .count {
  position: absolute; top: 16px; left: 16px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.26);
  backdrop-filter: blur(8px);
  padding: 5px 11px; border-radius: 30px;
}
.topic-card .t-arrow {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.26);
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease-out);
}
.topic-card:hover .t-arrow { background: var(--brand); border-color: var(--brand); color: var(--on-brand); transform: rotate(45deg); }
.topic-card .kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.72); margin-bottom: 7px; }
.topic-card h3 { font-size: 23px; font-weight: 600; color: #fff; }
.topic-card p { font-size: 13px; color: rgba(255,255,255,0.78); margin-top: 6px; }
.topic-card.tall { grid-row: span 2; min-height: 100%; }

/* ============================================================
   RESOURCES — list
   ============================================================ */
.res-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.res-search {
  flex: 1; min-width: 260px;
  display: flex; align-items: center; gap: 11px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 0 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.res-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.res-search .feather { color: var(--ink-3); }
.res-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14.5px; }
.res-search .count-pill { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.view-toggle {
  display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
}
.view-toggle button {
  width: 40px; height: 44px;
  display: grid; place-items: center;
  color: var(--ink-3);
  background: var(--surface);
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  transition: all 0.15s ease;
}
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button.active { background: var(--ink); color: var(--bg); }
[data-theme="dark"] .view-toggle button.active { background: #f1f2f6; color: #0e1013; }

.res-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }

.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.res-grid.list-view { grid-template-columns: 1fr; }

.res-card {
  padding: 18px;
  display: flex; flex-direction: column;
  gap: 12px;
  position: relative;
}
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.res-card .top { display: flex; align-items: center; gap: 10px; }
.res-card .fmt-ic {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.res-card .fmt-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.res-card .save-btn { margin-left: auto; }
.res-card h3 { font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.res-card p { font-size: 13px; color: var(--ink-2); flex: 1; }
.res-card .foot {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--ink-3);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.res-card .foot span { display: inline-flex; gap: 5px; align-items: center; }
.res-card .foot .open {
  margin-left: auto;
  font-weight: 600; color: var(--ink);
  display: inline-flex; gap: 5px; align-items: center;
  transition: color 0.15s ease, gap 0.2s ease;
}
.res-card:hover .foot .open { color: var(--accent); gap: 8px; }

.res-grid.list-view .res-card { flex-direction: row; align-items: center; gap: 18px; }
.res-grid.list-view .res-card h3 { font-size: 15px; flex: 1; }
.res-grid.list-view .res-card p { display: none; }
.res-grid.list-view .res-card .foot { border: 0; padding: 0; margin-left: auto; flex: none; }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-3);
}
.no-results .big { font-family: var(--font-display); font-size: 21px; color: var(--ink); margin-bottom: 6px; }

/* ============================================================
   FORUM
   ============================================================ */
.forum-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  align-items: start;
}
.thread-list { display: flex; flex-direction: column; gap: 12px; }

.thread-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 18px;
  padding: 20px;
}
.thread-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.vote-col {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding-top: 2px;
}
.vote-btn {
  width: 30px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--ink-3);
  transition: all 0.15s ease;
}
.vote-btn:hover { background: var(--accent-soft); color: var(--accent); }
.vote-btn.voted { color: var(--accent); }
.vote-count { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.thread-card .body { min-width: 0; }
.thread-card .tags { display: flex; gap: 7px; margin-bottom: 8px; }
.thread-card h3 { font-size: 17.5px; font-weight: 600; margin-bottom: 5px; }
.thread-card h3 a:hover { color: var(--accent); }
.thread-card .excerpt {
  font-size: 13.5px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-card .meta-row {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px;
  font-size: 12.5px; color: var(--ink-3);
}
.thread-card .meta-row img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.thread-card .meta-row b { color: var(--ink-2); font-weight: 600; }
.thread-card .side {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between;
  gap: 10px;
}
.thread-card .replies {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.thread-card .replies .feather { width: 15px; height: 15px; color: var(--accent); }
.thread-card .activity { font-size: 11.5px; color: var(--ink-3); }

/* forum rail */
.forum-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; }
.rail-card { padding: 18px; }
.rail-card h4 { font-size: 14.5px; margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.rail-card h4 .feather { width: 15px; height: 15px; color: var(--accent); }
.cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8.5px 10px;
  margin: 0 -10px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-2);
  transition: all 0.15s ease;
  cursor: pointer;
}
.cat-row:hover, .cat-row.active { background: var(--surface-2); color: var(--ink); }
.cat-row.active { font-weight: 600; }
.cat-row .n { margin-left: auto; font-size: 11.5px; color: var(--ink-3); background: var(--surface-3); border-radius: 12px; padding: 1px 8px; }
.cat-row .dot-c { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); opacity: 0.85; }
.cat-row[data-cat="scenarios"] .dot-c { background: #88e4f5; }
.cat-row[data-cat="wins"] .dot-c { background: #0e9f6e; }
.cat-row[data-cat="compliance"] .dot-c { background: #d97706; }
.cat-row[data-cat="tech"] .dot-c { background: #8b5cf6; }
.cat-row[data-cat="general"] .dot-c { background: #64748b; }

.online-now { display: flex; align-items: center; gap: 12px; }
.online-now .txt { font-size: 12.5px; color: var(--ink-2); }
.online-now .txt b { color: var(--ink); }
.online-now .pulse-dot {
  flex: none;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(14, 159, 110, 0.18);
}

/* CTA card in rail */
.ask-cta {
  padding: 22px 18px;
  border-radius: var(--r-lg);
  position: relative; overflow: hidden;
  background:
    radial-gradient(130% 100% at 90% -10%, rgba(136,228,245,0.38), transparent 55%),
    var(--ink);
  color: #fff;
}
[data-theme="dark"] .ask-cta { background: radial-gradient(130% 100% at 90% -10%, rgba(136,228,245,0.3), transparent 55%), #101218; }
.ask-cta::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.13; pointer-events: none;
}
.ask-cta h4 { font-size: 17px; margin-bottom: 6px; position: relative; z-index: 1; }
.ask-cta p { font-size: 12.5px; color: rgba(255,255,255,0.75); margin-bottom: 14px; position: relative; z-index: 1; }
.ask-cta .btn { background: #fff; color: #0e1013; position: relative; z-index: 1; }
.ask-cta .avg { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 11.5px; color: rgba(255,255,255,0.72); position: relative; z-index: 1; }

/* ---------- Forum post page ---------- */
.post-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }
.post-hero { padding: 28px 28px 22px; }
.post-hero .tags { display: flex; gap: 8px; margin-bottom: 14px; }
.post-hero h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 600; margin-bottom: 14px; }
.post-hero .author-row { display: flex; align-items: center; gap: 12px; }
.post-hero .author-row img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.post-hero .author-row .who b { display: block; font-size: 14px; }
.post-hero .author-row .who span { font-size: 12px; color: var(--ink-3); }
.post-hero .author-row .score-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}
.post-body { font-size: 15px; color: var(--ink-2); line-height: 1.7; margin-top: 18px; }
.post-body p + p { margin-top: 12px; }
.post-actions { display: flex; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); align-items: center; }
.post-actions .helped { font-size: 12.5px; color: var(--ink-3); margin-left: auto; display: flex; align-items: center; gap: 8px; }

.comment-compose { padding: 22px; margin-top: 18px; }
.comment-compose h3 { font-size: 17px; margin-bottom: 4px; }
.comment-compose .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.compose-row { display: flex; gap: 14px; }
.compose-row img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.compose-box { flex: 1; }
.compose-box textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 14px;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.compose-box textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.compose-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.compose-foot .hint { font-size: 12px; color: var(--ink-3); }
.compose-foot .btn { margin-left: auto; }

.comments-head { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; }
.comments-head h3 { font-size: 18px; }
.comments-head .tag { font-size: 11.5px; }
.comment {
  display: flex; gap: 14px;
  padding: 18px;
  margin-bottom: 10px;
}
.comment img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; flex-wrap: wrap; }
.comment .c-head b { font-size: 13.5px; }
.comment .c-head .when { font-size: 11.5px; color: var(--ink-3); }
.comment .c-text { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.comment .c-actions { display: flex; gap: 14px; margin-top: 9px; }
.comment .c-actions button {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 5px;
  transition: color 0.15s ease;
}
.comment .c-actions button:hover { color: var(--accent); }
.comment .c-actions button.liked { color: var(--accent); }
.comment.best { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment.best .best-tag { background: var(--brand); color: var(--on-brand); }

/* related rail */
.related-row { display: flex; gap: 10px; padding: 9px 0; align-items: baseline; }
.related-row .n { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--ink-3); flex: none; }
.related-row a { font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.4; }
.related-row a:hover { color: var(--accent); }

/* ============================================================
   EVENT DETAIL
   ============================================================ */
.event-hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 340px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 30px;
  color: #fff;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}
.event-hero img.bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.event-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(198deg, rgba(10,12,18,0.04) 30%, rgba(10,12,18,0.88) 88%),
              linear-gradient(0deg, rgba(136,228,245,0.16), rgba(136,228,245,0) 40%);
}
.event-hero .top-row {
  position: absolute; top: 20px; left: 20px; right: 20px;
  display: flex; gap: 8px; align-items: center;
}
.event-hero .tag-glass {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.26);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 12px; border-radius: 30px;
}
.event-hero .tag-glass.brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.event-hero h1 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 600; max-width: 18ch; margin: 10px 0 12px; color: #fff; }
.event-hero .meta-row {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 13.5px; color: rgba(255,255,255,0.88);
}
.event-hero .meta-row span { display: inline-flex; align-items: center; gap: 7px; }

.event-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: start;
  margin-top: 26px;
}
.event-main .card { padding: 26px; margin-bottom: 18px; }
.event-main h2 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.event-main h2 .feather { color: var(--accent); width: 17px; height: 17px; }
.event-main .about p { color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
.event-main .about p + p { margin-top: 10px; }

.agenda-item {
  display: flex; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.agenda-item:last-child { border-bottom: 0; padding-bottom: 0; }
.agenda-item .n {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex: none;
}
.agenda-item .t b { display: block; font-size: 14px; font-weight: 600; }
.agenda-item .t span { font-size: 12.5px; color: var(--ink-3); }

.host-row { display: flex; align-items: center; gap: 14px; }
.host-row img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.host-row .who b { display: block; font-size: 15px; }
.host-row .who span { font-size: 12.5px; color: var(--ink-3); }
.host-row .btn { margin-left: auto; }

/* register rail */
.register-card { padding: 22px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.register-card .price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.register-card .price-row .free { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.register-card .price-row span { font-size: 12.5px; color: var(--ink-3); }
.detail-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.detail-row:last-of-type { border-bottom: 0; }
.detail-row .feather { color: var(--accent); width: 16px; height: 16px; }
.detail-row b { font-weight: 600; }
.detail-row span { color: var(--ink-3); display: block; font-size: 12px; }

.capacity-block { margin: 16px 0 18px; }
.capacity-block .bar {
  height: 6px; border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.capacity-block .bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.capacity-block .cap-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-3);
  margin-top: 7px;
}
.capacity-block .cap-meta b { color: var(--accent); font-weight: 700; }
.register-card .btn { width: 100%; justify-content: center; }
#register-btn { margin-bottom: 13px; }
.register-card .btn + .btn { margin-top: 13px; }
.register-card .save-btn {
  width: 100%; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-md);
}
.register-card .going-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}

/* ============================================================
   Image backdrops (dashboard personalisation)
   ============================================================ */
body[data-bg="nature"], body[data-bg="beach"], body[data-bg="water"],
body[data-bg="zen"], body[data-bg="art"], body[data-bg="fun"] {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body[data-bg="nature"] { background-image: linear-gradient(color-mix(in srgb, var(--bg) 67%, transparent), color-mix(in srgb, var(--bg) 67%, transparent)), url("https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?auto=format&fit=crop&w=1800&q=55"); }
body[data-bg="beach"]  { background-image: linear-gradient(color-mix(in srgb, var(--bg) 66%, transparent), color-mix(in srgb, var(--bg) 66%, transparent)), url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1800&q=55"); }
body[data-bg="water"]  { background-image: linear-gradient(color-mix(in srgb, var(--bg) 66%, transparent), color-mix(in srgb, var(--bg) 66%, transparent)), url("https://images.unsplash.com/photo-1518837695005-2083093ee35b?auto=format&fit=crop&w=1800&q=55"); }
body[data-bg="zen"]    { background-image: linear-gradient(color-mix(in srgb, var(--bg) 66%, transparent), color-mix(in srgb, var(--bg) 66%, transparent)), url("https://images.unsplash.com/photo-1506126613408-eca07ce68773?auto=format&fit=crop&w=1800&q=55"); }
body[data-bg="art"]    { background-image: linear-gradient(color-mix(in srgb, var(--bg) 68%, transparent), color-mix(in srgb, var(--bg) 68%, transparent)), url("https://images.unsplash.com/photo-1541961017774-22349e4a1262?auto=format&fit=crop&w=1800&q=55"); }
body[data-bg="fun"]    { background-image: linear-gradient(color-mix(in srgb, var(--bg) 67%, transparent), color-mix(in srgb, var(--bg) 67%, transparent)), url("https://images.unsplash.com/photo-1492684223066-81342ee5ff30?auto=format&fit=crop&w=1800&q=55"); }

/* dashboard cards let the backdrop breathe through slightly */
body[data-page="dashboard"] .card,
body[data-page="dashboard"] .ticker-wrap {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.bg-menu { width: 258px; }
.bg-swatches { flex-wrap: wrap; }
.bg-swatch { background-size: cover; background-position: center; }
.bg-swatch[data-bg="nature"] { background-image: url("https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?auto=format&fit=crop&w=120&q=50"); }
.bg-swatch[data-bg="beach"]  { background-image: url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=120&q=50"); }
.bg-swatch[data-bg="water"]  { background-image: url("https://images.unsplash.com/photo-1518837695005-2083093ee35b?auto=format&fit=crop&w=120&q=50"); }
.bg-swatch[data-bg="zen"]    { background-image: url("https://images.unsplash.com/photo-1506126613408-eca07ce68773?auto=format&fit=crop&w=120&q=50"); }
.bg-swatch[data-bg="art"]    { background-image: url("https://images.unsplash.com/photo-1541961017774-22349e4a1262?auto=format&fit=crop&w=120&q=50"); }
.bg-swatch[data-bg="fun"]    { background-image: url("https://images.unsplash.com/photo-1492684223066-81342ee5ff30?auto=format&fit=crop&w=120&q=50"); }

/* ============================================================
   Shared form fields (login / compose / admin)
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 11px 14px;
  font-size: 14px;
  outline: 0;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field textarea { min-height: 140px; resize: vertical; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: var(--bg);
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast .feather { width: 15px; height: 15px; color: var(--brand); }
[data-theme="dark"] .toast { background: #f1f2f6; color: #0e1013; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px;
  color: #fff;
  isolation: isolate;
}
.login-visual img.bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.login-visual::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(210deg, rgba(10,12,18,0.2), rgba(10,12,18,0.82)),
              linear-gradient(0deg, rgba(136,228,245,0.18), transparent 50%);
}
.login-visual .brand-name, .login-visual .brand-name span { color: #fff; }
.login-visual blockquote { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 32px); font-weight: 600; line-height: 1.25; max-width: 20ch; margin: 0; letter-spacing: -0.02em; }
.login-visual .quote-meta { margin-top: 16px; font-size: 13px; color: rgba(255,255,255,0.75); display: flex; align-items: center; gap: 10px; }
.login-visual .quote-meta img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
}
.login-box { width: 380px; max-width: 100%; }
.login-box h1 { font-size: 28px; margin-bottom: 8px; }
.login-box .sub { color: var(--ink-2); font-size: 14px; margin-bottom: 28px; }
.login-box .btn { width: 100%; justify-content: center; height: 44px; }
.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.login-foot a { color: var(--accent); font-weight: 600; }
.demo-pill {
  margin-top: 26px;
  font-size: 12px; color: var(--ink-3);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  text-align: center;
}
.otp-row { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 20px; }
.otp-row input {
  width: 52px; height: 60px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.otp-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.login-step { display: none; }
.login-step.active { display: block; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 18px; }
.back-link:hover { color: var(--ink); }
@media (max-width: 880px) { .login-body { grid-template-columns: 1fr; } .login-visual { display: none; } }

/* ============================================================
   COMPOSE QUESTION (forum-new)
   ============================================================ */
.cat-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-choices input { position: absolute; opacity: 0; pointer-events: none; }
.cat-choices label.chip { margin: 0; }
.cat-choices input:checked + label.chip,
.cat-choices label.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="dark"] .cat-choices input:checked + label.chip { background: #f1f2f6; color: #0e1013; border-color: #f1f2f6; }
.guideline-row { display: flex; gap: 12px; padding: 10px 0; font-size: 13px; color: var(--ink-2); }
.guideline-row .feather { width: 16px; height: 16px; color: var(--good); flex: none; margin-top: 2px; }

/* ============================================================
   RESOURCE DETAIL
   ============================================================ */
.resource-detail-main { display: flex; flex-direction: column; gap: 16px; }
.resource-hero { padding: 28px; }
.resource-hero .top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.resource-hero #res-tags { gap: 4px; }
.resource-hero .fmt-ic { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.resource-hero .fmt-ic .feather { width: 22px; height: 22px; }
.resource-hero h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 600; margin-bottom: 10px; }
.resource-hero .excerpt { font-size: 15px; color: var(--ink-2); max-width: 70ch; }
.resource-hero .meta-line { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 16px; }
.resource-hero .meta-line span { display: inline-flex; gap: 6px; align-items: center; }

.video-embed {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0b0c0f;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}
.video-embed video { width: 100%; height: 100%; display: block; }
.resource-rail .action-card > a.btn-accent { display: flex; justify-content: center; margin-bottom: 13px; }

.resource-content { padding: 28px; }
.resource-content h2 { font-size: 19px; margin: 22px 0 10px; }
.resource-content h2:first-child { margin-top: 0; }
.resource-content p { color: var(--ink-2); font-size: 14.5px; line-height: 1.75; margin-bottom: 12px; }
.resource-content ul { list-style: none; margin: 14px 0; }
.resource-content li { display: flex; gap: 11px; padding: 7px 0; font-size: 14px; color: var(--ink-2); }
.resource-content li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--brand); margin-top: 7px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-card { padding: 0; overflow: hidden; margin-bottom: 24px; }
.admin-card .ac-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.admin-card .ac-head h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.admin-card .ac-head h3 .feather { width: 16px; height: 16px; color: var(--accent); }
.admin-card .ac-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background 0.15s ease; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table td b { font-weight: 600; }
.admin-table td .sub { display: block; font-size: 12px; color: var(--ink-3); }
.admin-table .num { font-family: var(--font-display); font-weight: 600; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button, .row-actions a {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: var(--surface);
  transition: all 0.15s ease;
}
.row-actions button:hover, .row-actions a:hover { color: var(--ink); border-color: var(--line-strong); }
.row-actions button.danger:hover { color: var(--bad); border-color: var(--bad); background: rgba(220,38,38,0.06); }
.row-actions .feather { width: 14px; height: 14px; }

tr.editing td { background: var(--accent-soft) !important; }
td[contenteditable="true"] {
  outline: 1.5px dashed var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
  cursor: text;
}

/* drawer */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(10, 12, 15, 0.4);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 92vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 210;
  transform: translateX(105%);
  transition: transform 0.4s var(--ease-out);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer .d-head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer .d-head h3 { font-size: 17px; }
.drawer .d-head .sub { font-size: 12px; color: var(--ink-3); }
.drawer .d-head .icon-btn { margin-left: auto; }
.drawer .d-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer .d-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.drawer .d-foot .btn { flex: 1; justify-content: center; }

.rsvp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rsvp-row:last-child { border-bottom: 0; }
.rsvp-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.rsvp-row .who { flex: 1; min-width: 0; }
.rsvp-row .who b { display: block; font-size: 13.5px; }
.rsvp-row .who span { font-size: 11.5px; color: var(--ink-3); }

.admin-note {
  font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 7px;
  margin-top: 16px;
}
.admin-note .feather { width: 13px; height: 13px; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i {
  width: 40px; height: 22px; border-radius: 22px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  position: relative; flex: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.switch i::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: left 0.2s var(--ease-out);
}
.switch input:checked + i { background: var(--brand); border-color: var(--brand); }
.switch input:checked + i::after { left: 20px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.switch-row:last-of-type { border-bottom: 0; }
.switch-row .sr-label b { display: block; font-size: 13.5px; font-weight: 600; }
.switch-row .sr-label span { font-size: 12px; color: var(--ink-3); }

/* repeater (agenda items etc.) */
.rep-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}
.rep-item .rep-grip {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 4px;
}
.rep-item .rep-grip button {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  transition: all 0.15s ease;
}
.rep-item .rep-grip button:hover { color: var(--bad); border-color: var(--bad); }
.rep-item .rep-grip .feather { width: 13px; height: 13px; }
.rep-item input, .rep-item textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 8px 11px;
  font-size: 13.5px;
  outline: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.rep-item input:focus, .rep-item textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.rep-item input { margin-bottom: 8px; padding-right: 40px; font-weight: 600; }
.rep-item textarea { min-height: 42px; resize: vertical; color: var(--ink-2); }
.rep-add {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 13px; font-weight: 600;
  transition: all 0.18s ease;
}
.rep-add:hover { border-color: var(--brand); color: var(--accent); background: var(--accent-soft); }
.rep-add .feather { width: 15px; height: 15px; }

/* image upload drop */
.img-drop {
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  background: var(--surface-2);
}
.img-drop:hover { border-color: var(--brand); background: var(--surface); }
.img-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-drop .thumb {
  width: 92px; height: 58px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex: none;
  background: var(--surface-3);
}
.img-drop .txt b { display: block; font-size: 13px; font-weight: 600; }
.img-drop .txt span { font-size: 11.5px; color: var(--ink-3); }

/* table thumbs + pagination */
.row-thumb { width: 46px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; }
.cell-flex { display: flex; align-items: center; gap: 12px; }
.pager {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.pager .pages { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.pager button {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px; font-weight: 600;
  transition: all 0.15s ease;
}
.pager button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.pager button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="dark"] .pager button.on { background: #f1f2f6; color: #0e1013; border-color: #f1f2f6; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .feather { width: 14px; height: 14px; }

/* ============================================================
   Reveal helper states (GSAP sets final)
   ============================================================ */
.will-reveal { opacity: 0; transform: translateY(18px); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
  .board { grid-template-columns: repeat(2, 1fr); }
  .widget, .widget.w-wide { grid-column: span 1; }
  .topics-grid, .res-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-hero { grid-template-columns: 1fr; }
  .spotlight { min-height: 220px; }
}
/* Event listing action refinements requested from live QA. */
.event-card .actions .btn-ghost:hover {
  background: #0a0a0b;
  border-color: #0a0a0b;
  color: #fff;
}
.event-card .actions .btn-primary:hover {
  transform: translateY(-3px);
}
.event-card .actions .save-btn:hover {
  background: #0a0a0b;
  border-color: #0a0a0b;
  color: #fff;
}

/* Portal accessibility: legacy button:hover uses a dark fill, so specific button hovers need white text. */
.save-btn:hover,
.fav-item button:hover,
.comment .c-actions button:hover,
.comment .c-actions form button:hover,
.row-actions button:hover,
.rep-item .rep-grip button:hover,
.pager button:hover:not(:disabled) {
  color: #fff;
}

@media (max-width: 980px) {
  /* sidenav becomes an off-canvas drawer opened by the hamburger */
  .sidenav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100vh; height: 100dvh;
    z-index: 300;
    transform: translateX(-105%);
    transition: transform 0.42s var(--ease-out), background 0.35s ease;
    box-shadow: none;
  }
  .sidenav.open { transform: none; box-shadow: var(--shadow-lg); }

  /* topbar: logo replaces breadcrumbs, hamburger sits right of the avatar */
  .crumb { display: none; }
  .topbar-logo { display: flex; }
  .menu-btn { display: grid; }
  .topbar-actions { margin-left: auto; }
  .search-trigger { min-width: 0; }
  .search-trigger .label, .search-trigger kbd { display: none; }
  .user-chip .who { display: none; }

  .dock { display: flex; }
  .main { padding-bottom: 130px; }

  .events-layout, .forum-layout, .post-layout, .event-layout { grid-template-columns: 1fr; }
  .register-card { position: static; }
  .filter-rail, .forum-rail { position: static; }
  .main, .topbar { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 680px) {
  .topics-grid, .res-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; }
  .event-card .side { flex-direction: row; align-items: center; justify-content: space-between; }
  .thread-card { grid-template-columns: 1fr; }
  .vote-col { flex-direction: row; }
  .page-head .head-actions { margin-left: 0; }
}

/* Portal live-render parity refinements for approved rails/toolbars. */
.resource-results-panel .res-toolbar {
  align-items: center;
}
.resource-results-panel .res-toolbar .res-search {
  flex: 1 1 420px;
  margin: 0;
}
.resource-filter-rail,
.resource-rail {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.post-layout > .forum-rail,
.resource-detail-layout > .forum-rail,
.events-layout > .filter-rail,
.resources-list-layout > .filter-rail {
  align-self: start;
  margin-top: 0;
}
.comment-action-form {
  display: inline-flex;
}
.comment .c-actions form button {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}
.comment .c-actions form button:hover,
.comment .c-actions form button.liked {
  color: var(--accent);
}
.res-grid.list-view {
  grid-template-columns: 1fr;
}
.res-grid.list-view .res-card {
  min-height: 0;
}
