/* Boss Level Community — application design system.
   Tokens are lifted straight from solutions/solution.css and the homepage
   palette so the logged-in product reads as the same brand: ink #050508,
   paper #f8f5ef, orange #ff4400, gold #ffb300, Archivo Black display type and
   mono eyebrows. Light mode mirrors the public site's [data-boss-theme] hook. */

:root {
  color-scheme: dark;

  --ink: #050508;
  --ink-2: #0a0a0e;
  --surface: #101016;
  --surface-2: #17171f;
  --paper: #f8f5ef;
  --orange: #ff4400;
  --gold: #ffb300;
  --teal: #20c5b5;
  --muted: #9a9285;
  --accent: var(--orange);

  --text: var(--paper);
  --text-soft: #f8f5efc7;
  --text-dim: #f8f5ef8a;
  --line: #ffffff1c;
  --line-strong: #ffffff33;
  --field: #0a0a0e;

  --ok: #35c47a;
  --warn: #ffb300;
  --danger: #ff5a48;
  --info: #4aa8ff;

  --shell-w: 268px;
  --topbar-h: 64px;
  --radius: 2px;
  --radius-lg: 4px;

  --display: 'Archivo Black', 'Archivo', system-ui, sans-serif;
  --body: 'Archivo', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;

  --shadow: 0 24px 55px rgba(0, 0, 0, .48);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .3);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

:root[data-boss-theme="light"] {
  color-scheme: light;
  --ink: #f5f1e8;
  --ink-2: #eee8dc;
  --surface: #fffdf8;
  --surface-2: #f3ead8;
  --paper: #17130f;
  --muted: #675e53;
  --text: #17130f;
  --text-soft: #17130fc7;
  --text-dim: #17130f96;
  --line: #2e241926;
  --line-strong: #2e241940;
  --field: #fffdf8;
  --shadow: 0 24px 55px rgba(75, 55, 30, .16);
  --shadow-sm: 0 8px 24px rgba(75, 55, 30, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 16px/1.6 var(--body);
  /* Nothing may push the layout sideways on a phone. */
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: -.02em; line-height: .95; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  padding: 12px 18px; background: var(--orange); color: #050508; font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }

.mono { font-family: var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.eyebrow { font: 500 11px/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- boot ------ */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 22px; }
.boot__mark { display: flex; gap: 4px; }
.boot__mark span {
  width: 7px; height: 26px; background: var(--orange);
  animation: bootPulse 1.1s var(--ease) infinite;
}
.boot__mark span.is-gold { background: var(--gold); }
.boot__mark span:nth-child(2) { animation-delay: .08s; }
.boot__mark span:nth-child(3) { animation-delay: .16s; }
.boot__mark span:nth-child(4) { animation-delay: .24s; }
.boot__mark span:nth-child(5) { animation-delay: .32s; }
@keyframes bootPulse { 0%, 100% { transform: scaleY(.5); opacity: .45; } 50% { transform: scaleY(1); opacity: 1; } }
.boot__label { font-size: 11px; color: var(--muted); }

.noscript { max-width: 620px; margin: 18vh auto; padding: 0 24px; text-align: center; }
.noscript h1 { font-size: 40px; margin-bottom: 16px; }
.noscript a { color: var(--orange); text-decoration: underline; }

/* ------------------------------------------------------------ buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 20px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: #050508;
  font: 700 14px/1 var(--body); text-transform: uppercase; letter-spacing: .05em;
  cursor: pointer; transition: transform .18s var(--ease), background .18s, box-shadow .18s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255, 68, 0, .3); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn--ghost:hover:not(:disabled) { border-color: var(--accent); box-shadow: none; }
.btn--gold { background: var(--gold); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 9px 14px; font-size: 12px; }
.btn--lg { padding: 17px 26px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { padding: 9px; width: 36px; height: 36px; }

.linkish { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; background: none; border: 0; padding: 0; }

/* ------------------------------------------------------------- fields ---- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field > label, .field__label { font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.field__error { font-size: 12px; color: var(--danger); }

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], input[type=date], input[type=datetime-local],
select, textarea {
  width: 100%; padding: 13px 14px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 68, 0, .16);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* Password reveal ------------------------------------------------------ */
/* The button sits inside the input's box, so the input reserves room for it on
   the right rather than letting the icon cover typed characters. */
.field__reveal-wrap { position: relative; display: flex; }
.field__reveal-wrap input { padding-right: 46px; }
.field__reveal {
  position: absolute; top: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  width: 44px; padding: 0;
  background: none; border: 0; border-radius: var(--radius);
  color: var(--text-dim); cursor: pointer;
  transition: color .18s;
}
.field__reveal:hover { color: var(--text); }
.field__reveal[aria-pressed="true"] { color: var(--orange); }
/* tabindex is -1, so this only shows for a mouse or touch user who has clicked
   it — but it keeps the control visible for anyone using a screen-reader
   cursor or a switch device that can still land focus here. */
.field__reveal:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px; color: var(--text);
}

.check { display: flex; align-items: flex-start; gap: 11px; padding: 12px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--orange); flex: none; }
.check__body strong { display: block; font-size: 14px; font-weight: 600; }
.check__body span { display: block; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale button {
  flex: 1; min-width: 44px; padding: 11px 4px; background: var(--field);
  border: 1px solid var(--line-strong); color: var(--text-dim);
  font: 600 13px var(--mono); cursor: pointer; transition: all .16s;
}
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #050508; }

/* Token / chip input used for expertise, tags, interests. */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; background: var(--surface-2); border: 1px solid var(--line);
  font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft);
}
.chip--accent { border-color: var(--accent); color: var(--accent); }
.chip button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid currentColor; color: var(--muted);
}
.badge--draft { color: var(--muted); }
.badge--review { color: var(--info); }
.badge--scheduled { color: var(--gold); }
.badge--published { color: var(--ok); }
.badge--archived { color: var(--text-dim); }
.badge--failed, .badge--danger { color: var(--danger); }
.badge--running { color: var(--info); }
.badge--ai { color: var(--teal); }

/* -------------------------------------------------------------- shell ---- */
.shell { display: grid; grid-template-columns: var(--shell-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; padding: 22px 16px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.sidebar__brand b { font: 400 19px var(--display); letter-spacing: .02em; text-transform: uppercase; }
.sidebar__brand b span { color: var(--orange); }
.sidebar__tag { font: 500 9px var(--mono); letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }

.navgroup { margin-top: 16px; }
.navgroup__title { padding: 0 8px 8px; font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); }
.navlink {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  color: var(--text-soft); font-size: 14px; font-weight: 500;
  border-left: 2px solid transparent; transition: background .16s, color .16s, border-color .16s;
}
.navlink:hover { background: var(--surface); color: var(--text); }
.navlink[aria-current="page"] { background: var(--surface); color: var(--text); border-left-color: var(--orange); }
.navlink__icon { width: 17px; text-align: center; opacity: .82; flex: none; }
.navlink__count { margin-left: auto; font: 600 10px var(--mono); color: var(--gold); }

.sidebar__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__spacer { flex: 1; }

.searchbox { position: relative; flex: 1; max-width: 460px; }
.searchbox input { padding-left: 38px; height: 40px; }
.searchbox__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchresults {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  max-height: 64vh; overflow-y: auto;
}
.searchresults a { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.searchresults a:last-child { border-bottom: 0; }
.searchresults a:hover, .searchresults a:focus { background: var(--surface-2); }
.searchresults strong { display: block; font-size: 14px; }
.searchresults span { font-size: 11.5px; color: var(--text-dim); }

.main { min-width: 0; }
.page { padding: clamp(24px, 4vw, 44px) clamp(16px, 3vw, 32px) 90px; max-width: 1320px; }

.pagehead { margin-bottom: 30px; }
.pagehead h1 { font-size: clamp(30px, 4.4vw, 52px); margin: 10px 0 12px; }
.pagehead p { color: var(--text-soft); max-width: 68ch; font-size: 16px; }
.pagehead__row { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; justify-content: space-between; }

/* -------------------------------------------------------------- cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
a.card:hover, .card--link:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card__kicker { font: 500 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.card__title { font-size: 19px; line-height: 1.18; }
.card__body { color: var(--text-soft); font-size: 14.5px; line-height: 1.6; }
.card__meta { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.card__media { margin: -22px -22px 4px; aspect-ratio: 16 / 9; background: var(--ink-2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card--flat { border-top-width: 1px; border-top-color: var(--line); }
.card--pad-0 { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }

.section { margin-bottom: 42px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(20px, 2.4vw, 28px); }
.section__more { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

/* Cinematic panel used for the dashboard hero and course landings. */
.hero-panel {
  position: relative; overflow: hidden; padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    repeating-linear-gradient(180deg, #ffffff08 0 1px, transparent 1px 9px),
    linear-gradient(140deg, var(--surface-2), var(--ink-2));
}
.hero-panel__level {
  position: absolute; right: -14px; bottom: -46px; pointer-events: none;
  font: 400 clamp(96px, 17vw, 210px)/1 var(--display); color: #ffffff07;
}
:root[data-boss-theme="light"] .hero-panel__level { color: #17130f0a; }
.hero-panel h1 { font-size: clamp(28px, 4.2vw, 50px); position: relative; }
.hero-panel p { position: relative; color: var(--text-soft); max-width: 60ch; margin-top: 12px; }

/* Featured image behind the title, not underneath it -------------------- */
/* The photograph becomes the ground the heading stands on. It stays a real
   <img> rather than a CSS background so its alt text survives, and the scrim
   over it is flat rather than hopeful: measured against a pure white
   photograph the title still reads at 5.8:1 and the copy beneath it at better
   than 11:1, so contrast does not depend on which image an admin picked.

   Every colour inside is written out rather than taken from a token, because
   the ground here is a dark scrim in both themes — a token that flips with the
   light theme would put dark text on it. */
.hero-panel--cover {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: clamp(230px, 28vw, 360px);
  background: var(--ink-2);
}
.hero-panel__cover {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.hero-panel--cover::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--orange) 20%, transparent), transparent 46%),
    linear-gradient(180deg, rgba(6, 6, 10, .62), rgba(6, 6, 10, .82));
}
.hero-panel--cover > :not(.hero-panel__cover) { position: relative; z-index: 2; }

.hero-panel--cover h1 { color: #fff; }
.hero-panel--cover p { color: rgba(255, 255, 255, .87); }
/* The accent orange is unreadable over a bright photograph — 1.6:1 at worst —
   so the eyebrow keeps its shape and gives up its colour. */
.hero-panel--cover .eyebrow { color: rgba(255, 255, 255, .92); }
.hero-panel--cover .field__hint { color: rgba(255, 255, 255, .78); }
.hero-panel--cover .chip {
  background: rgba(6, 6, 10, .46); border-color: rgba(255, 255, 255, .34); color: #fff;
}
.hero-panel--cover .btn--ghost {
  background: rgba(6, 6, 10, .42); border-color: rgba(255, 255, 255, .48); color: #fff;
}
.hero-panel--cover .btn--ghost:hover:not(:disabled) { border-color: var(--orange); }
.hero-panel--cover .meter { background: rgba(255, 255, 255, .24); }
/* A link inside the panel takes the ground's colour, not the theme's. */
.hero-panel--cover a:not(.btn) { color: #fff; }

/* Progress ------------------------------------------------------------- */
.meter { height: 6px; background: var(--line); overflow: hidden; }
.meter__fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); transition: width .5s var(--ease); }

.ring { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--orange) calc(var(--pct) * 1%), var(--line) 0); }
.ring__inner { width: 68px; height: 68px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 400 19px var(--display); }

/* Avatars ---------------------------------------------------------------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.avatar--sm { width: 28px; height: 28px; }
.avatar--lg { width: 76px; height: 76px; }
.avatar--xl { width: 116px; height: 116px; border: 3px solid var(--ink); }
.avatar-fallback {
  display: grid; place-items: center; background: var(--surface-2); color: var(--accent);
  font: 400 15px var(--display); text-transform: uppercase;
}

/* Tables ----------------------------------------------------------------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
table.data th { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); background: var(--ink-2); position: sticky; top: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.actions { text-align: right; white-space: nowrap; }

/* Tabs ------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button {
  padding: 11px 15px; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-dim); font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--orange); }

/* Empty / error / skeleton ------------------------------------------------ */
.empty {
  padding: clamp(34px, 6vw, 60px) 28px; text-align: center;
  border: 1px dashed var(--line-strong); background: var(--surface);
}
.empty__mark { font: 400 34px var(--display); color: var(--accent); margin-bottom: 14px; }
.empty h3 { font-size: 21px; margin-bottom: 10px; }
.empty p { color: var(--text-soft); max-width: 46ch; margin: 0 auto 20px; font-size: 14.5px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line { height: 12px; margin-bottom: 9px; }
.skel-card { height: 168px; }

.alert { padding: 14px 16px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 14px; line-height: 1.55; }
.alert--danger { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.alert--warn { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.alert--ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.alert strong { display: block; margin-bottom: 4px; }

/* Toasts / modal ---------------------------------------------------------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 13px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); box-shadow: var(--shadow); font-size: 14px; animation: toastIn .24s var(--ease); }
.toast--danger { border-left-color: var(--danger); }
.toast--ok { border-left-color: var(--ok); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(2, 2, 4, .74); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(620px, 100%); max-height: 88vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-top: 3px solid var(--accent); box-shadow: var(--shadow); }
.modal__head { padding: 22px 24px 0; }
.modal__head h2 { font-size: 23px; }
.modal__body { padding: 18px 24px; }
.modal__foot { padding: 16px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal--wide { width: min(1040px, 100%); }

/* Prose ------------------------------------------------------------------- */
.prose { font-size: 17px; line-height: 1.72; color: var(--text-soft); max-width: 72ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(24px, 3vw, 32px); color: var(--text); margin-top: 1.7em; }
.prose h3 { font-size: clamp(19px, 2.2vw, 23px); color: var(--text); margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 18px; color: var(--text); font-size: 1.06em; }
.prose code { font: .88em var(--mono); background: var(--ink-2); padding: 2px 6px; border: 1px solid var(--line); }
.prose pre { background: var(--ink-2); border: 1px solid var(--line); padding: 16px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose img { border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); }

/* Forum ------------------------------------------------------------------- */
.thread-row { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .18s, transform .18s var(--ease); }
.thread-row:hover { border-color: var(--line-strong); transform: translateX(3px); }
.thread-row__main { min-width: 0; flex: 1; }
.thread-row h3 { font-size: 16.5px; line-height: 1.3; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 600; }
.thread-row__meta { margin-top: 7px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.thread-row__stat { display: grid; place-items: center; min-width: 52px; text-align: center; }
.thread-row__stat b { font: 400 19px var(--display); color: var(--accent); }
.thread-row__stat span { font: 500 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }

.post { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.post__body { min-width: 0; flex: 1; }
.post__head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.post__head b { font-weight: 600; }
.post__head time, .post__head .edited { color: var(--text-dim); font-size: 12px; }
.post__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.post--reply { margin-left: clamp(16px, 4vw, 52px); border-left: 1px solid var(--line); padding-left: 16px; }

.reaction { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: transparent; border: 1px solid var(--line); color: var(--text-dim); font: 600 11px var(--mono); cursor: pointer; transition: all .16s; }
.reaction:hover { border-color: var(--accent); color: var(--text); }
.reaction[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.chat-log { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; }
.chat-msg { display: flex; gap: 11px; padding: 7px 10px; border-radius: var(--radius); }
.chat-msg:hover { background: var(--surface); }
.chat-msg__meta { font-size: 11.5px; color: var(--text-dim); }
.chat-composer { position: sticky; bottom: 0; padding: 12px 0; background: var(--ink); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-end; }
.chat-composer textarea { min-height: 46px; max-height: 180px; }

/* Video ------------------------------------------------------------------- */
.player { width: 100%; background: #000; border: 1px solid var(--line); }
.player video { width: 100%; height: 100%; display: block; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-9-16 { aspect-ratio: 9 / 16; max-width: 340px; }

/* DMC Marketing Nugget cards. The poster is a facade: a thumbnail and a play
   button that swap themselves for the YouTube iframe on click, so a grid of
   episodes costs a handful of small JPEGs instead of a player per card. */
.nugget__media { position: relative; background: #000; }
.nugget__poster {
  display: block; width: 100%; height: 100%; padding: 0; margin: 0;
  border: 0; background: #000; cursor: pointer; position: relative;
}
.nugget__poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .18s ease; }
.nugget__play {
  position: absolute; inset: 0; margin: auto; width: 52px; height: 52px;
  background: rgba(5, 5, 8, .62); border: 1px solid var(--line-strong);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
/* The triangle is drawn rather than typed so it sits on the optical centre —
   a glyph would need nudging per font. */
.nugget__play::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--paper, #f8f5ef);
  transform: translateX(2px);
}
.nugget__poster:hover .nugget__play,
.nugget__poster:focus-visible .nugget__play { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.nugget__poster:hover img { opacity: .82; }
.nugget__time {
  position: absolute; right: 7px; bottom: 7px; padding: 2px 6px;
  background: rgba(5, 5, 8, .82); color: #f8f5ef;
  font: 500 11px var(--mono); letter-spacing: .04em;
}
.nugget__frame { width: 100%; height: 100%; border: 0; display: block; }
/* Three lines, so a long synopsis cannot make one card twice the height of the
   card beside it. */
.nugget__blurb {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.nugget__out { color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.nugget__out:hover { color: var(--accent); }

/* Wizard ------------------------------------------------------------------ */
.steps { display: flex; gap: 4px; margin-bottom: 30px; flex-wrap: wrap; }
.step { flex: 1; min-width: 132px; padding: 12px 14px; background: var(--surface); border-top: 3px solid var(--line); }
.step[data-state="active"] { border-top-color: var(--orange); background: var(--surface-2); }
.step[data-state="done"] { border-top-color: var(--ok); }
.step b { display: block; font: 500 10px var(--mono); letter-spacing: .16em; color: var(--text-dim); }
.step span { font-size: 13.5px; font-weight: 600; }

.joblog { max-height: 320px; overflow-y: auto; background: var(--ink-2); border: 1px solid var(--line); padding: 12px 14px; font: 12px/1.65 var(--mono); }
.joblog__line { display: flex; gap: 10px; }
.joblog__line time { color: var(--text-dim); flex: none; }
.joblog__line[data-level="error"] { color: var(--danger); }
.joblog__line[data-level="warn"] { color: var(--gold); }

.steplist { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.steplist__item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); font-size: 14px; }
.steplist__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.steplist__item[data-status="running"] .steplist__dot { background: var(--info); animation: pulse 1.2s infinite; }
.steplist__item[data-status="succeeded"] .steplist__dot { background: var(--ok); }
.steplist__item[data-status="failed"] .steplist__dot { background: var(--danger); }
.steplist__item[data-status="skipped"] { opacity: .5; }
.steplist__time { margin-left: auto; font: 11px var(--mono); color: var(--text-dim); }
@keyframes pulse { 50% { opacity: .35; } }

/* Auth screens ------------------------------------------------------------ */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
}
.auth__aside {
  position: relative; overflow: hidden; padding: clamp(34px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(circle at 74% 26%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 44%),
    repeating-linear-gradient(180deg, #ffffff08 0 1px, transparent 1px 9px),
    var(--ink-2);
  border-right: 1px solid var(--line);
}
.auth__aside h2 { font-size: clamp(34px, 4vw, 62px); line-height: .9; }
.auth__aside p { color: var(--text-soft); max-width: 42ch; margin-top: 18px; }
.auth__aside .hero-panel__level { right: -10px; bottom: -40px; }
.auth__form { display: grid; align-content: center; justify-items: stretch; padding: clamp(28px, 5vw, 60px); }
.auth__form form, .auth__inner { width: min(430px, 100%); margin: 0 auto; }
.auth__form h1 { font-size: clamp(30px, 3.6vw, 44px); margin-bottom: 10px; }
.auth__lede { color: var(--text-soft); margin-bottom: 26px; }
.auth__foot { margin-top: 22px; font-size: 13.5px; color: var(--text-dim); }
.auth__foot a { color: var(--accent); }

/* Member directory -------------------------------------------------------- */
.member-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--line); transition: border-color .18s, transform .18s var(--ease); }
.member-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.member-card h3 { font-family: var(--body); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 16px; }
.member-card__role { font-size: 13px; color: var(--text-dim); }

.profile-cover { height: clamp(140px, 22vw, 230px); background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { display: flex; gap: 20px; align-items: flex-end; margin-top: -54px; padding: 0 clamp(8px, 2vw, 22px); position: relative; flex-wrap: wrap; }

.deflist { display: grid; gap: 14px; }
.deflist div { display: grid; gap: 3px; }
.deflist dt { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.deflist dd { margin: 0; font-size: 14.5px; color: var(--text-soft); }

/* Filter bar -------------------------------------------------------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.filters select, .filters input { width: auto; min-width: 150px; height: 40px; padding-block: 0; }
.filters .searchbox { flex: 1; min-width: 200px; max-width: none; }

.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 32px; }
.pager span { font: 500 12px var(--mono); color: var(--text-dim); }

/* Bottom nav (mobile) ----------------------------------------------------- */
.mobilenav { display: none; }

@media (max-width: 1020px) {
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); z-index: 120;
    transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: var(--shadow);
  }
  .sidebar[data-open="true"] { transform: none; }
  .topbar__menu { display: inline-flex; }
  .page { padding-bottom: 108px; }
  .mobilenav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
    background: color-mix(in srgb, var(--ink-2) 96%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .mobilenav a {
    flex: 1; display: grid; justify-items: center; gap: 3px; padding: 10px 4px;
    font: 500 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim);
  }
  .mobilenav a[aria-current="page"] { color: var(--orange); }
  .mobilenav a span:first-child { font-size: 16px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__aside { display: none; }
  .post--reply { margin-left: 14px; }
}

@media (max-width: 560px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .card { padding: 17px; }
  .card__media { margin: -17px -17px 4px; }
  .modal__head, .modal__body, .modal__foot { padding-left: 17px; padding-right: 17px; }
  .thread-row { flex-direction: column; gap: 10px; }
  .thread-row__stat { flex-direction: row; gap: 6px; justify-content: flex-start; min-width: 0; }
}

.scrim { position: fixed; inset: 0; z-index: 115; background: rgba(2, 2, 4, .6); }
@media (min-width: 861px) { .scrim { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .topbar, .mobilenav, .toasts { display: none !important; }
  .shell { grid-template-columns: 1fr; }
}

/* Wizard stepper is buttons now: a finished step is a place you can go back to.
   Todo and active chips stay disabled — same palette as before, no UA fade. */
.steps button.step { appearance: none; font: inherit; color: inherit; text-align: left; border: 0; border-top: 3px solid var(--line); cursor: default; }
.steps button.step[data-state="active"] { border-top-color: var(--orange); }
.steps button.step[data-state="done"] { border-top-color: var(--ok); cursor: pointer; }
.steps button.step[data-state="done"]:hover { background: var(--surface-2); border-top-color: var(--gold); }
.steps button.step:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }

/* Folded field groups: the optional brief lives one fold down, in the same
   mono-label voice as every field label. A group with values shows a count so
   folded never means forgotten. */
.fold { border: 1px solid var(--line); background: var(--surface); margin: 18px 0; }
.fold__summary { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; list-style: none; user-select: none; }
.fold__summary::-webkit-details-marker { display: none; }
.fold__summary::before { content: '+'; font: 700 14px/1 var(--mono); color: var(--orange); width: 14px; flex: none; }
.fold[open] > .fold__summary::before { content: '\2013'; }
.fold__title { font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.fold__hint { font-size: 12.5px; color: var(--text-dim); margin-left: auto; text-align: right; }
.fold__count { font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-left: auto; border: 1px solid var(--line); padding: 4px 8px; }
.fold__body { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.fold__summary:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }

/* ---------------------------------------------------- cover cards ------- */
/* The Intel, The Vault and The Training lead with their art: the cover fills
   the head of the card and the kicker and title sit on it. The overlay is a
   gradient rather than a flat wash so the picture stays visible at the top and
   only darkens where type lands — a flat scrim dark enough to read through
   would hide the image it exists to show.

   Every cover is generated to the same brief (near-black, orange and gold), so
   the floor is already dark; the gradient guarantees the rest. The text-shadow
   is the belt to that braces, for the one image that comes back bright. */
.card--cover { padding: 0; overflow: hidden; }
.card--cover .card__cover {
  position: relative; aspect-ratio: 16 / 9; display: flex; align-items: flex-end;
  background: var(--ink-2);
}
.card--cover .card__cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.card--cover .card__cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 5, 8, .06) 0%,
    rgba(5, 5, 8, .20) 45%,
    rgba(5, 5, 8, .52) 100%);
}
/* The type sits on an even plate, not on the thin end of a fade. A gradient
   tuned to the card bottom is weakest exactly where the first line lands, and
   measuring it against a white image gave 3.9:1 at the top of the block —
   under AA for the small kicker. A flat scrim behind the text, with the cover
   wash ramping into it from above, holds ~4.9:1 at worst anywhere in the
   block while leaving the top half of the picture clear. The plate is dense on
   purpose: the "slight" overlay the brief asks for is the wash over the picture
   itself (0.06 to 0.20), not the backing under the words. */
.card--cover .card__coverbody {
  position: relative; padding: 22px 18px 14px; width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  /* The fade is spent inside the top padding, above the first line, so the
     plate meets the picture softly without thinning where the type sits. */
  background: linear-gradient(
    180deg,
    rgba(5, 5, 8, .34) 0,
    rgba(5, 5, 8, .80) 20px,
    rgba(5, 5, 8, .80) 100%);
}
/* Two lines keeps the cards even and stops a long headline eating the art. */
.card--cover .card__coverbody .card__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card--cover .card__coverbody .card__kicker { color: var(--gold); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.card--cover .card__coverbody .card__title {
  color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .55); text-wrap: balance;
}
/* The prose below the cover keeps the card's own surface, so the picture is a
   head rather than a background the body has to fight. */
.card--cover .card__rest { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card--cover .card__rest .card__meta { padding-top: 10px; }

/* No art: keep the same shape so a coverless row does not collapse the grid. */
.card--cover .card__cover--bare {
  background:
    radial-gradient(circle at 74% 26%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 52%),
    linear-gradient(140deg, var(--surface-2), var(--ink-2));
}

/* ------------------------------------------------ segmented toggle ------ */
/* Three formats, always visible, one press to switch — a select would hide two
   of the three behind a click and give no sense that the page is stacked. */
.segmented { display: inline-flex; border: 1px solid var(--line); background: var(--surface); height: 40px; }
.segmented__option {
  appearance: none; background: none; border: 0; cursor: pointer; color: var(--text-dim);
  font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  padding: 0 16px; height: 100%; transition: color .15s, background .15s;
}
.segmented__option + .segmented__option { border-left: 1px solid var(--line); }
.segmented__option:hover { color: var(--text); background: var(--surface-2); }
.segmented__option[aria-pressed="true"] { color: var(--ink); background: var(--accent); }
.segmented__option:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The jump-to-format control sits in a section head beside a heading, so it is
   a button that looks like the section link next to it. */
button.section__more { appearance: none; background: none; border: 0; cursor: pointer; }
button.section__more:hover { text-decoration: underline; }

/* The action that is not a section: it sits with the account links, separated
   from the nav so it never reads as another room to walk into. */
.sidebar__cta { padding: 14px 14px 0; margin-top: auto; }
.sidebar__cta .btn { width: 100%; }
/* The CTA becomes the thing pushed to the bottom, so the footer stops claiming
   its own share of the free space and the two stay together. */
.sidebar__cta + .sidebar__foot { margin-top: 0; }
