/* ---------- upnest design tokens ---------- */
:root {
  /* surfaces */
  --ink: #0A0A0B;
  --ink-2: #1a1820;
  --paper: #FAFAF7;
  --paper-2: #F3F1EC;
  --hair: rgba(20, 10, 40, 0.08);
  --hair-strong: rgba(20, 10, 40, 0.14);

  /* plum */
  --plum-50: #F5F0FB;
  --plum-100: #E7DBF6;
  --plum-200: #C9AEEA;
  --plum-400: #8B5BC4;
  --plum-500: #6B3FA0;
  --plum-600: #50297E;
  --plum-700: #3B1E5E;
  --plum-900: #1C0E30;

  /* text */
  --t-1: #0A0A0B;
  --t-2: #3a3640;
  --t-3: #726b7a;
  --t-4: #a49daf;

  /* states */
  --ok: #3a7a4e;
  --warn: #b56a2b;
  --err: #a23a3a;
  --gold: #b89547;

  /* type */
  --serif: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* elevation */
  --shadow-1: 0 1px 2px rgba(20,10,40,.04), 0 4px 12px rgba(20,10,40,.04);
  --shadow-2: 0 1px 2px rgba(20,10,40,.05), 0 12px 32px rgba(20,10,40,.06);
  --shadow-plum: 0 1px 2px rgba(59,30,94,.08), 0 14px 40px rgba(59,30,94,.18);

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

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--t-1);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11', 'tnum';
}

/* headings */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--mono); }
.num   { font-variant-numeric: tabular-nums; }

/* utilities */
.hair { background: var(--hair); }
.hair-b { border-bottom: 1px solid var(--hair); }
.hair-t { border-top: 1px solid var(--hair); }
.hair-r { border-right: 1px solid var(--hair); }
.hair-l { border-left: 1px solid var(--hair); }

/* inputs */
.field {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  background: #fff;
  font: 400 14px/1.2 var(--sans);
  color: var(--t-1);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  outline: none;
}
.field::placeholder { color: var(--t-4); }
.field:hover { border-color: rgba(20,10,40,.22); }
.field:focus {
  border-color: var(--plum-500);
  box-shadow: 0 0 0 4px rgba(107, 63, 160, 0.12);
}
.field.filled {
  background: var(--plum-50);
  border-color: var(--plum-100);
}

.label {
  display: block;
  font: 500 12px/1 var(--sans);
  color: var(--t-2);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.label .req { color: var(--plum-500); margin-left: 2px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 10px;
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 1px 2px rgba(0,0,0,.15);
}
.btn-primary:hover { background: #000; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 18px rgba(0,0,0,.22); }
.btn-plum {
  background: var(--plum-700);
  color: #fff;
  box-shadow: var(--shadow-plum);
}
.btn-plum:hover { background: var(--plum-600); }
.btn-ghost {
  background: transparent;
  color: var(--t-1);
  border-color: var(--hair-strong);
}
.btn-ghost:hover { background: rgba(20,10,40,.03); }
.btn-white {
  background: #fff; color: var(--t-1);
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.btn-white:hover { background: var(--paper); }

/* segmented */
.seg {
  display: inline-flex;
  padding: 4px;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 999px;
  gap: 2px;
}
.seg > button {
  appearance: none; border: 0; background: transparent;
  padding: 8px 16px;
  font: 500 13px/1 var(--sans);
  color: var(--t-3);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.seg > button.active {
  background: #fff;
  color: var(--t-1);
  box-shadow: 0 1px 2px rgba(20,10,40,.06), 0 1px 1px rgba(20,10,40,.04);
}
.seg > button:hover:not(.active) { color: var(--t-1); }

/* chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font: 500 12px/1 var(--sans);
  color: var(--t-2);
  background: #fff;
}
.chip.solid-ink { background: var(--ink); color: var(--paper); border-color: transparent; }
.chip.plum { background: var(--plum-50); color: var(--plum-700); border-color: var(--plum-100); }
.chip.gold { background: #FBF4DF; color: #7a5a16; border-color: #EFE0B0; }
.chip.warn { background: #FDEFE3; color: #8c4a1b; border-color: #F4D8BE; }
.chip.err  { background: #FCE9E9; color: #8c2b2b; border-color: #F3CCCC; }
.chip.ok   { background: #E6F1E9; color: #2f5e3c; border-color: #CADBCF; }

/* link */
.link { color: var(--t-1); text-decoration: none; border-bottom: 1px solid var(--hair-strong); padding-bottom: 1px; }
.link:hover { border-color: var(--t-1); }
.link-plum { color: var(--plum-700); font-weight: 500; }

/* focus */
:focus-visible { outline: 2px solid var(--plum-400); outline-offset: 2px; border-radius: 4px; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(20,10,40,.12); border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: rgba(20,10,40,.2); }

/* decorative */
.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* app-level reset for full-bleed app views */
.app-root { min-height: 100vh; background: var(--paper); }

/* fade entrance */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s var(--ease) both; }
.fade-up.d1 { animation-delay: .05s; }
.fade-up.d2 { animation-delay: .12s; }
.fade-up.d3 { animation-delay: .2s; }
.fade-up.d4 { animation-delay: .28s; }

/* editorial auth animations */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes wordmarkIn {
  0%   { opacity: 0; transform: translateY(20px) scale(.96); letter-spacing: 0.04em; }
  60%  { opacity: 1; letter-spacing: -0.035em; }
  100% { opacity: 1; transform: none; letter-spacing: -0.03em; }
}
@keyframes curtainLeft {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes curtainRight {
  from { clip-path: inset(0 0 0 100%); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes hairDraw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slowPan {
  0%   { transform: translate3d(-2%, 2%, 0) scale(1.05); }
  50%  { transform: translate3d(2%, -1%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.05); }
}
@keyframes orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes cursorBlink { 50% { opacity: 0; } }
@keyframes numberDrop {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

.rise-in { animation: riseIn .7s var(--ease) both; }
.rise-in.d1 { animation-delay: .15s; }
.rise-in.d2 { animation-delay: .3s; }
.rise-in.d3 { animation-delay: .45s; }
.rise-in.d4 { animation-delay: .6s; }
.rise-in.d5 { animation-delay: .75s; }
.wordmark-in { animation: wordmarkIn 1.1s var(--ease) both; }
.curtain-left  { animation: curtainLeft .95s var(--ease) both; animation-delay: .1s; }
.curtain-right { animation: curtainRight .95s var(--ease) both; animation-delay: .1s; }
.hair-draw { transform-origin: left center; animation: hairDraw .8s var(--ease) both; animation-delay: .4s; }
.slow-pan { animation: slowPan 22s ease-in-out infinite; }
.orbit-slow { animation: orbit 80s linear infinite; transform-origin: center; }
.cursor-blink::after {
  content: '|'; display:inline-block; margin-left:2px; color: var(--t-3);
  animation: cursorBlink 1.1s steps(1) infinite;
}
.number-drop { animation: numberDrop .5s var(--ease) both; }

/* drawer animations */
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawerOut { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrimOut { from { opacity: 1; } to { opacity: 0; } }
.drawer-scrim { animation: scrimIn .25s var(--ease) both; }
.drawer-scrim.closing { animation: scrimOut .28s var(--ease) both; }
.drawer-panel { animation: drawerIn .48s cubic-bezier(.22,.9,.22,1) both; will-change: transform; }
.drawer-panel.closing { animation: drawerOut .36s cubic-bezier(.5,0,.7,.3) both; }
@keyframes drawerBodyRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.drawer-stagger > * { animation: drawerBodyRise .55s var(--ease) both; }
.drawer-stagger > *:nth-child(1) { animation-delay: .18s; }
.drawer-stagger > *:nth-child(2) { animation-delay: .24s; }
.drawer-stagger > *:nth-child(3) { animation-delay: .3s; }
.drawer-stagger > *:nth-child(4) { animation-delay: .36s; }
.drawer-stagger > *:nth-child(5) { animation-delay: .42s; }
.drawer-stagger > *:nth-child(6) { animation-delay: .48s; }

/* modal animations */
@keyframes modalScrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop {
  0%   { opacity: 0; transform: translateY(16px) scale(.96); filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
@keyframes modalOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px) scale(.98); }
}
.modal-scrim { animation: modalScrimIn .22s var(--ease) both; }
.modal-scrim.closing { animation: modalScrimIn .2s var(--ease) reverse both; }
.modal-card { animation: modalPop .52s cubic-bezier(.2,.9,.2,1) both; will-change: transform, opacity, filter; }
.modal-card.closing { animation: modalOut .24s var(--ease) both; }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer-bar {
  background: linear-gradient(90deg,
    rgba(59,30,94,0) 0%,
    rgba(59,30,94,.55) 45%,
    rgba(59,30,94,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes stepFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.step-fade { animation: stepFade .3s var(--ease) both; }

@keyframes pulseBg {
  0%, 100% { opacity: .9; }
  50%      { opacity: .55; }
}
.skel { pointer-events:none; }

/* toast animations */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(6px) scale(.98); }
}
.toast-in  { animation: toastIn  .32s var(--ease) both; }
.toast-out { animation: toastOut .26s var(--ease) both; }

/* scrim fade */
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }

.route-bar::-webkit-scrollbar { display: none; }
.route-bar {
  mask-image: linear-gradient(to right, transparent 0, black 20px, black calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 20px, black calc(100% - 20px), transparent 100%);
}
/* Don't fade the edges if not scrollable */
@media (min-width: 1200px) {
  .route-bar {
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* Responsive */
.recruiter-label { display: none; }

@media (max-width: 860px) {
  .hide-mobile { display: none !important; }
  .stack-mobile { flex-direction: column !important; align-items: stretch !important; grid-template-columns: 1fr !important; }
  .full-mobile { width: 100% !important; max-width: 100% !important; flex: 1 1 auto !important; }
  .pad-mobile { padding: 20px 16px 60px !important; }
  .pad-mobile-x { padding-left: 16px !important; padding-right: 16px !important; }
  .grid-1-mobile { grid-template-columns: 1fr !important; }
  .h1-mobile { font-size: 36px !important; line-height: 1.05 !important; }
  .h2-mobile { font-size: 24px !important; }
  .stat-strip { flex-wrap: wrap !important; }
  .stat-strip > * { flex: 1 1 50% !important; border-right: 1px solid var(--hair); }
  /* App shell: stack sidebar above content on mobile */
  .app-shell { flex-direction: column !important; }
  /* Global serif h1 downshift — catch any masthead we didn't explicitly tag */
  main h1, .masthead h1 { font-size: clamp(32px, 9vw, 44px) !important; line-height: 1.02 !important; letter-spacing: -.02em !important; }
  main h2 { font-size: clamp(22px, 6vw, 28px) !important; line-height: 1.1 !important; }
  /* Any grid of 3+ cols → single column */
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(5"] { grid-template-columns: 1fr !important; }
  /* Custom inline table grids (auto / fr units) → horizontal scroll */
  .table-row-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-row-grid::-webkit-scrollbar { height: 4px; }

  /* Recruiter table → card stack on mobile */
  .recruiter-table-head { display: none !important; }
  .recruiter-row {
    display: block !important;
    padding: 16px !important;
  }
  .recruiter-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    padding: 6px 0;
    gap: 10px;
  }
  .recruiter-label {
    display: inline !important;
    font-size: 9px !important;
    letter-spacing: .16em;
    color: var(--t-4);
    text-transform: uppercase;
  }
  .recruiter-action {
    margin-top: 10px !important;
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* ------- Dashboard RolesRow → card stack ------- */
  .roles-row-head { display: none !important; }
  .roles-row {
    display: block !important;
    padding: 16px 18px !important;
    position: relative;
  }
  .roles-row-main {
    margin-bottom: 12px !important;
  }
  .roles-row-cell {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 0 !important;
    gap: 12px !important;
    border-top: 1px solid var(--hair);
  }
  .roles-row-cell::before {
    content: attr(data-label);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .16em;
    color: var(--t-4);
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .roles-row-cell[data-label="Pipeline"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  .roles-row-cell[data-label="Pipeline"]::before {
    align-self: flex-start;
  }
  .roles-row-chev {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
  }

  /* ------- AttentionHero → stack ------- */
  .app-shell main [style*="grid-template-columns: minmax(0px, 1fr) 280px"] {
    grid-template-columns: 1fr !important;
  }

  /* Any two-column grid with minmax (hero-style layouts) → stack */
  [style*="grid-template-columns: minmax(0px, 1fr) auto"],
  [style*="grid-template-columns: minmax(0px, 1fr) 280px"],
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.35fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ------- GENERIC TABLE ROW RESPONSIVE -------
     Any grid-row with 4+ columns becomes a block with cells stacking.
     Works for client candidates / admin tables / dashboard rows.        */
  [style*="grid-template-columns: 70px"],
  [style*="grid-template-columns: 100px"],
  [style*="grid-template-columns: 120px"],
  [style*="grid-template-columns: 110px"],
  [style*="grid-template-columns: 160px"],
  [style*="grid-template-columns: minmax(0px, 1.6fr)"],
  [style*="grid-template-columns: minmax(0px, 2fr)"],
  [style*="grid-template-columns: 1.5fr"],
  [style*="grid-template-columns: 1.2fr 1.2fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 14px 16px !important;
  }

  /* Sticky headers with tabs + search → stack */
  .app-shell main header { padding: 12px 16px !important; }

  /* Masthead on client views */
  .masthead h1 { font-size: clamp(30px, 9vw, 44px) !important; }

  /* Sections with large horizontal padding */
  main section > div[style*="padding:'36px 36px"],
  main section > div[style*="padding: 36px 36px"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Generic table-like row with inline grid w/ fixed cols */
  [style*="gridTemplateColumns:'1.2fr 1.2fr"],
  [style*="grid-template-columns: 1.2fr 1.2fr"] {
    /* handled elsewhere via classes */
  }

  /* Search input next to tabs → full width */
  .app-shell main input[placeholder*="earch"] {
    width: 100% !important;
    box-sizing: border-box;
  }
  .app-shell main input[placeholder*="earch"]::-webkit-search-cancel-button { display:none; }

  /* Tab rows with overflow */
  main > div > section > div[style*="display:'flex'"][style*="borderBottom"] {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }

  /* ClientTopBar padding */
  div[style*="padding:'16px 28px'"][style*="borderBottom"] {
    padding: 12px 16px !important;
  }

  /* Drawer / modal: shrink to viewport */
  .drawer-slide { max-width: calc(100vw - 16px) !important; }

  /* Images / avatars stay fluid */
  img { max-width: 100%; height: auto; }

  /* No horizontal overflow on the root */
  html, body { overflow-x: hidden; }
}
  /* Kanban columns → horizontal scroll with min col width */
  [data-kanban] { overflow-x: auto !important; }
  [data-kanban] > * { min-width: 260px !important; }
  /* Any large fixed inline widths used for table headers — wrap */
  table { display: block; overflow-x: auto; }
}
@media (max-width: 640px) {
  .hide-xs { display: none !important; }
}

/* Login screens: stack on mobile */
@media (max-width: 820px) {
  .login-split { grid-template-columns: 1fr !important; }
  .login-brand { padding: 36px 24px !important; min-height: 240px; }
  .login-form { padding: 36px 24px !important; max-width: 100% !important; }
  .login-stats { padding: 36px 24px !important; border-left: 0 !important; border-top: 1px solid var(--hair); }
  .login-admin-card { padding: 28px 22px !important; }
  .login-hero { font-size: 32px !important; }
}

/* recruiter drawer slide (inset card, not full-height) */
@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateX(24px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes drawerSlideOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(16px) scale(.99); }
}
.drawer-slide { animation: drawerSlideIn .42s cubic-bezier(.22,.9,.22,1) both; will-change: transform, opacity; }
.drawer-slide.closing { animation: drawerSlideOut .32s var(--ease) both; }



/* editorial input — underline only */
.ed-field {
  width: 100%;
  padding: 14px 0 12px;
  border: 0; border-bottom: 1px solid var(--hair-strong);
  background: transparent;
  font: 400 17px/1.2 var(--serif);
  letter-spacing: -0.01em;
  color: var(--t-1);
  outline: none;
  transition: border-color .3s var(--ease), padding .3s var(--ease);
}
.ed-field::placeholder { color: var(--t-4); font-style: italic; }
.ed-field:focus { border-color: var(--ink); }
.ed-label {
  display: block; font-family: var(--mono);
  font-size: 9px; letter-spacing: 0.2em;
  color: var(--t-3); margin-bottom: 2px;
  text-transform: uppercase;
}
.ed-group { position: relative; }
.ed-group .ed-caret {
  position: absolute; right: 0; bottom: 14px; width: 6px; height: 16px;
  background: var(--ink); opacity: 0; transition: opacity .2s;
  animation: cursorBlink 1.1s steps(1) infinite;
}
.ed-field:focus ~ .ed-caret { opacity: 1; }


/* ================= RESPONSIVE ================= */
@media (max-width: 720px) {
  /* Bottom route bar: scrollable, compact */
  .route-bar {
    left: 8px !important; right: 8px !important;
    bottom: 8px !important;
    transform: none !important;
    max-width: calc(100vw - 16px) !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px 6px !important;
    justify-content: flex-start !important;
    border-radius: 12px !important;
  }
  .route-bar::-webkit-scrollbar { display: none; }
  .route-bar button {
    padding: 6px 10px !important;
    font-size: 10px !important;
    flex-shrink: 0;
  }
  .route-bar-prefix {
    flex-shrink: 0;
    font-size: 9px !important;
    padding: 4px 6px !important;
    position: sticky;
    left: 0;
    background: rgba(10,10,11,.92);
    z-index: 2;
  }

  /* Full-bleed shells: sidebar becomes a header drawer */
  .app-shell {
    flex-direction: column !important;
  }

  /* Shared: page content gets bottom padding for route bar */
  main { padding-bottom: 72px !important; }

  /* Grids collapse to 1-col */
  .kpi-grid,
  .stat-grid,
  .two-col,
  .three-col {
    grid-template-columns: 1fr !important;
  }

  /* Tables: allow horizontal scroll */
  table { font-size: 12px; }
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .scroll-x::-webkit-scrollbar { height: 4px; }
  .scroll-x::-webkit-scrollbar-thumb { background: rgba(10,10,11,.2); border-radius: 2px; }

  /* Reduce hero/serif on mobile */
  .serif-xxl { font-size: clamp(32px, 8vw, 44px) !important; }
}

@media (max-width: 480px) {
  main { padding-bottom: 64px !important; }
  .route-bar { bottom: 6px !important; }
}
