/* =====================================================================
   Whitnu Aware — design system (see docs/UI-NOTES.md)
   Brand: blue #355F82 + purple #5D4276 (from the whitnu | aware lockup).
   Fonts are self-hosted (CSP allows 'self' only); no inline styles.
   ===================================================================== */

@font-face { font-family: "Inter"; src: url("fonts/inter-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-700.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("fonts/interdisplay-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("fonts/interdisplay-700.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("fonts/interdisplay-800.woff") format("woff"); font-weight: 800; font-display: swap; }

:root {
  /* brand */
  --navy: #1f3b57;
  --brand: #355f82;
  --navy-900: #10202f;
  --navy-700: #355f82;
  --purple: #6f4f93;
  --purple-600: #5d4276;
  --purple-50: #f3eef8;
  --purple-100: #e5dbef;
  --lime: #9ef01a;

  /* tenant-overridable (from /theme.css) */
  --header: #ffffff;
  --accent: #355f82;
  --accent-2: var(--purple);

  /* neutrals */
  --ink: #0e1a33;
  --ink-2: #33415c;
  --muted: #5d6b82;
  --faint: #616e82;
  --bg: #f4f6fa;
  --card: #ffffff;
  --card-2: #f8f9fc;
  --line: #e2e7ef;
  --line-2: #eef1f6;

  /* status */
  --ok: #0f7a47;
  --ok-50: #e7f7ef;
  --warn: #a35400;
  --warn-50: #fdf2e3;
  --bad: #c2362b;
  --bad-50: #fdecea;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(14,26,51,.05);
  --shadow: 0 1px 2px rgba(14,26,51,.04), 0 6px 20px -8px rgba(14,26,51,.10);
  --shadow-lg: 0 2px 4px rgba(14,26,51,.04), 0 24px 48px -16px rgba(14,26,51,.18);
  --ring: 0 0 0 4px rgba(111,79,147,.16);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Inter Display", "Inter", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  --side-w: 256px;
  --top-h: 64px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15.5px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01";
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; }
a { color: var(--purple-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--purple); }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
h1 { font-size: clamp(1.55rem, 1.2rem + 1vw, 1.95rem); line-height: 1.2; font-weight: 700; letter-spacing: -.022em; margin: .1rem 0 .5rem; }
h2 { font-size: 1.12rem; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; margin: 0 0 .45rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 0 0 .35rem; }
p { margin: 0 0 .85rem; }
ul, ol { padding-left: 1.2rem; }
li { margin: .2rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; }
code { background: var(--line-2); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--navy-900); color: #e6ebf5; padding: 1rem 1.1rem; border-radius: var(--r); overflow-x: auto; }
pre code { background: none; padding: 0; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.kicker {
  color: var(--purple-600); font-size: .72rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; margin: 0 0 .3rem;
}

/* ---------- app shell ---------- */
body.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, #fff 0, #fff var(--side-w), var(--bg) var(--side-w)); }
body.app--guest { background: var(--bg); }
body.app--guest { grid-template-columns: minmax(0, 1fr); }
.shell { min-width: 0; display: flex; flex-direction: column; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line);
  padding: 1.15rem .85rem .85rem;
  overflow-y: auto; z-index: 40;
}
.side-brand { display: block; padding: .35rem .7rem 1.1rem; text-decoration: none; }
.side-brand img { display: block; height: 27px; width: auto; max-width: 100%; }
.side-product {
  display: block; margin-top: .55rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.side-nav { flex: 1; }
.side-label {
  margin: 1.1rem .75rem .3rem; font-size: .78rem; font-weight: 600; color: var(--muted);
}
.side-nav a {
  position: relative; display: flex; align-items: center; gap: .7rem;
  padding: .52rem .75rem; margin: 1px 0; border-radius: 10px;
  color: var(--ink-2); font-weight: 550; font-size: .925rem; text-decoration: none;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--card-2); color: var(--ink); }
.side-nav a.on { background: var(--purple-50); color: var(--navy); font-weight: 650; }
.side-nav a.on::before {
  content: ""; position: absolute; left: -.85rem; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--purple);
}
.side svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a.on svg { color: var(--purple); }

.side-foot { display: flex; align-items: center; gap: .35rem; border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.side-user { flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: 10px; text-decoration: none; color: inherit; }
.side-user:hover, .side-user.on { background: var(--card-2); color: inherit; }
.side-user-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user-text strong { font-size: .86rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.side-user-text small { font-size: .74rem; color: var(--muted); }
.avatar-sm {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; font-size: .9rem; color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--purple) 100%);
}
.side-logout { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.side-logout-form { margin: 0; display: contents; }
/* 2.9.2: a POST control that reads as a plain link (Sign out). */
.link-btn { border: 0; background: none; padding: 0; min-height: 24px; color: var(--accent, inherit); text-decoration: underline; cursor: pointer; font: inherit; }
.side-logout:hover { background: var(--bad-50); color: var(--bad); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h); display: flex; align-items: center; gap: 1rem;
  padding: 0 clamp(1rem, 2.5vw, 2rem);
  background: rgba(244,246,250,.82);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
body.app:not(.app--guest) .topbar { border-bottom-color: var(--line); }
.topbar-logo { display: none; }
.topbar-logo img { height: 40px; width: auto; display: block; }
.topbar-logo--guest { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.topbar-org { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.org-logo { max-height: 34px; max-width: 160px; width: auto; display: block; border-radius: 6px; }
.org-name { font-family: var(--font-display); font-weight: 650; font-size: 1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.topbar-action {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink-2); font-size: .84rem; font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-xs); transition: border-color .15s, color .15s;
}
.topbar-action:hover { border-color: var(--purple); color: var(--purple-600); }
.topbar-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-tag { color: var(--muted); font-weight: 600; font-size: .84rem; padding-left: 1rem; border-left: 1px solid var(--line); }
.nav-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; place-items: center; }
.nav-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.side-scrim { display: none; }

.wrap { width: 100%; max-width: 1180px; padding: clamp(1.1rem, 2.5vw, 2rem); padding-top: 1.5rem; flex: 1; }
body.app--guest .wrap { margin: 0 auto; }

footer.tiny {
  display: flex; flex-direction: column; gap: .3rem;
  margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  color: var(--faint); font-size: .76rem; line-height: 1.5;
}
.foot-brand { font-weight: 650; color: var(--muted); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 0 0 10px 0; z-index: 100; }
.skip-link:focus { left: 0; color: #fff; }

/* ---------- surfaces ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(111,79,147,.55) 0%, rgba(111,79,147,0) 55%),
    radial-gradient(80% 120% at 0% 100%, rgba(53,95,130,.9) 0%, rgba(53,95,130,0) 60%),
    linear-gradient(135deg, #14283b 0%, #1f3b57 55%, #3d2c55 100%);
  color: #fff; border-radius: var(--r-xl);
  padding: clamp(1.4rem, 3vw, 2.1rem) clamp(1.4rem, 3vw, 2.2rem);
  margin-bottom: 1.4rem; box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(110deg, transparent 35%, #000 100%);
          mask-image: linear-gradient(110deg, transparent 35%, #000 100%);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; z-index: -1;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 0 0 40px rgba(255,255,255,.03), 0 0 0 80px rgba(255,255,255,.02);
}
.hero h1 { color: #fff; margin: .15rem 0 .45rem; max-width: 30ch; }
.hero p { color: #d3dcf0; max-width: 62ch; margin-bottom: 0; }
.hero p + p { margin-top: .9rem; }
.hero .kicker { color: #d4c3ea !important; }
.hero .btn { background: #fff; color: var(--navy); }
.hero .btn:hover { background: #f1ecf7; color: var(--navy); }
.hero .btn.ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.28); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.16); }
.hero a:not(.btn) { color: #fff; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card .card { box-shadow: none; background: var(--card-2); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }
.grid.top { align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.link-card { text-decoration: none; color: inherit; display: block; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.link-card:hover { color: inherit; transform: translateY(-2px); border-color: #cdbfe0; box-shadow: var(--shadow-lg); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 .85rem; }
.section-head h2 { margin: 0; font-size: 1.2rem; }
.section-head p { margin: 0; }
main > h2, .wrap > h2 { margin: 1.9rem 0 .8rem; font-size: 1.2rem; }

/* ---------- buttons ---------- */
.btn, button.btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem 1.05rem;
  background: var(--accent); color: #fff;
  border: 1px solid transparent; border-radius: 10px;
  font: 600 .9rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(14,26,51,.12), inset 0 1px 0 rgba(255,255,255,.08);
  transition: background .15s, box-shadow .15s, transform .05s, filter .15s;
  white-space: nowrap;
}
.btn:hover { color: #fff; filter: brightness(1.12); box-shadow: 0 4px 14px -4px rgba(21,43,92,.45); }
.btn:active { transform: translateY(1px); }
.btn.ghost, button.btn2 {
  background: #fff; color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow-xs);
}
.btn.ghost:hover, button.btn2:hover { filter: none; color: var(--navy); border-color: #c9d1de; background: var(--card-2); box-shadow: var(--shadow-xs); }
.btn.purple { background: var(--purple); }
.btn.danger, button.danger { background: var(--bad); color: #fff; }
.btn-lg { min-height: 46px; font-size: .96rem; padding: .6rem 1.3rem; }
.btn-block { width: 100%; }
p > .btn + .btn, p > .btn + form, .btn + .btn { margin-left: .4rem; }
button:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: .1rem; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: .55rem .75rem; margin: .3rem 0 1rem;
  border: 1px solid #d3dae6; border-radius: 10px; background: #fff;
  font: inherit; font-size: .94rem; color: var(--ink);
  box-shadow: var(--shadow-xs) inset;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9aa5b6; }
input:hover, select:hover, textarea:hover { border-color: #bcc6d6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: var(--ring); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%235d6b82' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
}
input[type=checkbox], input[type=radio] {
  width: 17px; height: 17px; min-height: 0; margin: 0 .45rem 0 0; padding: 0; vertical-align: -3px;
  accent-color: var(--purple); box-shadow: none;
}
input[type=file] { padding: .45rem; background: var(--card-2); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button {
  margin-right: .8rem; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: .35rem .8rem; font: 600 .84rem var(--font); color: var(--ink-2); cursor: pointer;
}
input[type=color] { width: 64px; height: 42px; padding: 4px; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1.1rem; margin: 1rem 0; }
legend { font-weight: 700; padding: 0 .4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-size: .82rem; font-weight: 600; text-decoration: none; }
.color-field { display: flex; align-items: center; gap: .6rem; }
.color-field input[type=color] { margin: .3rem 0 1rem; flex: none; }
.color-field input[type=text] { max-width: 160px; font-family: ui-monospace, Consolas, monospace; }

.choice {
  display: flex; align-items: center; gap: .1rem; margin: .4rem 0; padding: .62rem .8rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: #d0c2e2; background: #fbf9fd; }
.choice:has(input:checked) { border-color: var(--purple); background: var(--purple-50); }

/* ---------- feedback ---------- */
.flash-stack { margin-bottom: 1.1rem; }
.flash {
  display: flex; gap: .6rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--purple);
  padding: .75rem 1rem; border-radius: var(--r); margin: 0 0 .5rem; box-shadow: var(--shadow);
  font-weight: 500; animation: flash-in .3s ease;
}
.flash.flash-bad { border-left-color: var(--bad); }
.flash.flash-ok { border-left-color: var(--ok); }
.flash.flash-warn { border-left-color: var(--warn); }
.flash-close { margin-left: auto; flex: none; appearance: none; border: 0; background: none; color: var(--muted); font: 600 1.15rem/1 var(--font); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; }
.flash-close:hover { background: var(--card-2); color: var(--ink); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--ok-50); color: var(--ok);
  font-size: .74rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; vertical-align: middle;
}
.pill.pass { background: var(--ok); color: #fff; }
.pill.warn { background: var(--warn-50); color: var(--warn); }
.pill.bad { background: var(--bad-50); color: var(--bad); }
.pill.purple { background: var(--purple-50); color: var(--purple-600); }
.review { background: var(--ok-50); border: 1px solid #c6ead6; border-radius: var(--r); padding: .85rem 1.05rem; margin-bottom: 1rem; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
th, td { padding: .7rem .75rem; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th {
  background: var(--card-2); color: var(--muted); font-size: .8rem; font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
th:first-child { border-top-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; }
tr:last-child td { border-bottom: 0; }
tr:nth-child(even) > td { background: #fafbfd; }
tr:hover > td { background: #f5f2f9; }
td a { font-weight: 600; text-decoration: none; }
td input, td select { margin: 0; }
.table-wrap, .card:has(> table) { overflow-x: auto; }

/* ---------- details / faq ---------- */
details > summary { cursor: pointer; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); padding: .75rem 1rem; margin: .5rem 0; background: #fff; box-shadow: var(--shadow-xs); }
.faq summary { font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--purple); font-weight: 700; font-size: 1.1rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { margin-bottom: .5rem; }
.help-search {
  width: 100%; min-height: 48px; padding: .7rem 1rem .7rem 2.6rem; border-radius: var(--r); margin-bottom: 1rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%238b97aa' stroke-width='2'/%3E%3Cpath d='M20 20l-4-4' stroke='%238b97aa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat .9rem center / 18px;
}

/* ---------- progress / steps ---------- */
.steps { display: flex; gap: .35rem; margin: .7rem 0 1.2rem; }
.steps span { height: 6px; flex: 1; border-radius: 99px; background: #dde3ec; transition: background .3s; }
.steps span.on { background: linear-gradient(90deg, var(--purple), #4f7ba3); }
.progress-wrap { margin: 0 0 1.2rem; }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.progress-bar { height: 10px; border-radius: 999px; background: #e3e8f0; overflow: hidden; }
.progress-bar span { display: block; height: 100%; min-width: 10px; background: linear-gradient(90deg, var(--purple) 0%, #4f7ba3 60%, var(--lime) 130%); border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin: 0 0 1.4rem; }
.stat { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.15rem; box-shadow: var(--shadow); overflow: hidden; }
.stat-num { display: block; font-family: var(--font-display); font-size: 1.95rem; font-weight: 700; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-num .muted { font-size: 1rem; font-weight: 500; color: var(--faint); }
.stat-label { display: block; margin-top: .3rem; color: var(--muted); font-size: .8rem; font-weight: 550; }

/* ---------- admin dashboard tiles ---------- */
.tile-group { margin-bottom: 1.6rem; }
.tile-group > h2 { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; font-family: var(--font); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.tile {
  display: flex; gap: .85rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1rem 1.05rem; text-decoration: none; color: inherit; box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover { color: inherit; transform: translateY(-2px); border-color: #cdbfe0; box-shadow: var(--shadow-lg); }
.tile-ico { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--purple-50); color: var(--purple-600); }
.tile-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-ico.navy { background: #e8eef9; color: var(--navy-700); }
.tile-ico.green { background: var(--ok-50); color: var(--ok); }
.tile-ico.amber { background: var(--warn-50); color: var(--warn); }
.tile strong { display: block; font-weight: 650; font-size: .95rem; color: var(--ink); margin-bottom: .1rem; }
.tile span.desc { display: block; font-size: .84rem; color: var(--muted); line-height: 1.45; }

.setup-card { border: 1px solid #ddd0ea; background: linear-gradient(180deg, #faf8fc 0%, #fff 70%); }
.setup-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .2rem; }
.setup-meter { display: flex; align-items: center; gap: .7rem; margin: .25rem 0 .6rem; font-size: .84rem; color: var(--muted); font-weight: 600; }
.setup-meter .progress-bar { flex: 1; max-width: 260px; height: 8px; }
.setup-list { list-style: none; padding: 0; margin: .2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.setup-list li { margin: 0; }
.setup-list li a { display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--line); background: #fff; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.setup-list li a:hover { border-color: var(--purple); }
.setup-list .chk { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid #c7cfdc; display: grid; place-items: center; }
.setup-list li.done a { color: var(--muted); }
.setup-list li.done .chk { background: var(--ok); border-color: var(--ok); }
.setup-list li.done .chk::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }

/* ---------- lessons ---------- */
.learn-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; margin-bottom: 1.4rem; align-items: stretch; }
.learn-top .hero { margin: 0; }
.progress-card { margin: 0; display: flex; flex-direction: column; justify-content: center; gap: .3rem; }
.progress-ring { display: flex; align-items: center; gap: 1rem; }
.progress-ring svg { width: 84px; height: 84px; flex: none; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 9; }
.progress-ring .track { stroke: #e7ebf2; }
.progress-ring .val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.progress-ring strong { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.progress-ring small { color: var(--muted); font-size: .82rem; }

.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.lesson-grid > .card { margin: 0; }
.lesson-card { display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d9cfe7; }
.lesson-card > p:not(.kicker) { color: var(--muted); font-size: .92rem; }
.lesson-card .card-foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.lesson-card .card-foot .btn { margin-left: 0; }
.lesson-card .card-foot form { margin: 0; }
.lesson-row.is-passed { background: linear-gradient(180deg, #f6fcf8 0%, #fff 70%); border-color: #cbe9d7; }
.lesson-card.is-passed { background: linear-gradient(180deg, #f6fcf8 0%, #fff 55%); border-color: #cbe9d7; }
.lesson-card-top { display: flex; gap: .85rem; align-items: center; margin-bottom: .55rem; }
.lesson-card-top h2 { margin: 0; font-size: 1.02rem; }
.lesson-card-top .kicker { margin-bottom: .15rem; }
.lesson-art { position: relative; width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); padding: 4px; }
.lesson-hero-art { width: 64px; height: 64px; flex: none; }
.lesson-head { display: flex; gap: 1rem; align-items: center; }
.lesson-head h1 { margin-bottom: .15rem; }
.lesson-actions { display: flex; justify-content: flex-end; gap: .5rem; margin: 1.2rem 0 0; }
.lesson-actions .btn { min-width: 150px; }
.lesson-body { padding: clamp(1.2rem, 2.5vw, 1.8rem); font-size: 1rem; }
.lab-card .card-foot { margin-top: auto; padding-top: .4rem; }
.lab-card { display: flex; flex-direction: column; }
.lab-card .lab-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: #e8eef9; color: var(--navy-700); margin-bottom: .7rem; }
.lab-card .lab-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.rec-card { display: flex; align-items: center; gap: 1.2rem; border: 1px solid #ddd0ea; background: linear-gradient(100deg, #f7f3fb 0%, #fff 60%); }
.rec-card .rec-body { flex: 1; min-width: 0; }
.rec-card h2 { margin-bottom: .2rem; }
.rec-card p.muted { margin: 0; }
.rec-ico { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--purple); color: #fff; box-shadow: 0 8px 20px -8px rgba(111,79,147,.7); }
.rec-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ring badge on a passed lesson */
.ring-check { position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; box-shadow: var(--shadow); }
.ring-check::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.takeaway { margin-top: 1.2rem; padding: 1rem 1.15rem; border-left: 4px solid var(--purple); background: var(--purple-50); border-radius: 0 var(--r) var(--r) 0; font-weight: 600; color: #2c2140; }
.takeaway-label { display: block; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--purple-600); font-weight: 700; margin-bottom: .25rem; }

/* ---------- pass celebration ---------- */
.pass-card { text-align: center; position: relative; overflow: hidden; padding: 2rem 1.5rem; }
.pass-check { width: 92px; height: 92px; margin: .2rem auto .8rem; }
.pass-check svg { width: 100%; height: 100%; }
.pc-ring { fill: none; stroke: var(--ok); stroke-width: 5; stroke-dasharray: 214; stroke-dashoffset: 214; animation: draw-ring .6s ease forwards; }
.pc-tick { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw-tick .4s .5s ease forwards; }
@keyframes draw-ring { to { stroke-dashoffset: 0; } }
@keyframes draw-tick { to { stroke-dashoffset: 0; } }
.confetti-piece { position: fixed; top: -12px; width: 9px; height: 14px; opacity: .9; z-index: 60; animation: confetti-fall linear forwards; border-radius: 2px; }
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(540deg); opacity: 1; } }

/* ---------- risk ---------- */
.risk-dial-card { text-align: center; }
.risk-dial { position: relative; width: 168px; margin: .4rem auto; }
.risk-dial svg { width: 168px; height: 168px; }
.risk-dial circle:last-child { transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); stroke-linecap: round; }
.risk-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.risk-num strong { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.risk-num span { color: var(--faint); font-size: .86rem; }
.risk-band { font-weight: 700; font-size: 1.08rem; margin: .35rem 0 .4rem; }
.risk-spark { width: 100%; height: 80px; }
.risk-pill { color: #fff; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; display: inline-block; min-width: 2.4rem; text-align: center; font-variant-numeric: tabular-nums; font-size: .86rem; }

/* ---------- report verdicts ---------- */
.verdict-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; flex-wrap: wrap; }
.verdict-badge { font-weight: 800; letter-spacing: .05em; color: #fff; padding: .25rem .75rem; border-radius: 999px; font-size: .8rem; }
.verdict-bad .verdict-badge { background: var(--bad); }
.verdict-warn .verdict-badge { background: var(--warn); }
.verdict-ok .verdict-badge { background: var(--ok); }
.verdict-bad { border-left: 4px solid var(--bad); }
.verdict-warn { border-left: 4px solid var(--warn); }
.verdict-ok { border-left: 4px solid var(--ok); }

/* ---------- states, scope ---------- */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .45rem; margin-bottom: 1rem; }
.state-grid .choice { font-size: .86rem; margin: 0; }
.state-grid label.choice { display: flex; align-items: center; flex-direction: row; text-align: left; }
.scope-box { border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1.1rem; margin: 1rem 0; }
.scope-box legend { font-weight: 700; padding: 0 .4rem; }
.scope-box strong { display: block; margin: .6rem 0 .2rem; }

/* ---------- illustrations ---------- */
.wart { width: 100%; height: auto; display: block; }
.explainer-wrap { margin: .2rem 0 1.2rem; max-width: 440px; }
.explainer-wrap .wart { border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: .5rem; }
img.diagram { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; padding: .5rem; }

.magic-toggle { margin-top: .4rem; }
.magic-toggle summary { color: var(--purple-600); font-weight: 600; font-size: .9rem; text-align: center; list-style: none; padding: .55rem; border-radius: 10px; }
.magic-toggle summary::-webkit-details-marker { display: none; }
.magic-toggle summary:hover { background: var(--purple-50); }
.magic-toggle form { margin-top: .8rem; }

/* =====================================================================
   Mock inbox (lessons, labs, phishing previews) — skins kept as-is
   ===================================================================== */
.mail { display: grid; grid-template-columns: 210px 1fr; grid-template-areas: "chrome chrome" "side read"; border: 1px solid #d7dde5; border-radius: 14px; overflow: hidden; margin-bottom: 1rem; background: #fff; min-height: 330px; box-shadow: var(--shadow-lg); font-size: .92rem; }
.mail-chrome { grid-area: chrome; display: flex; align-items: center; gap: .55rem; padding: .55rem .85rem; border-bottom: 1px solid #e6eaef; font-size: .9rem; }
.mail-dot { width: 10px; height: 10px; border-radius: 50%; background: #c9cdd3; }
.mail-side { grid-area: side; border-right: 1px solid #ebeef2; padding: .75rem .6rem; }
.mail-nav { padding: .42rem .6rem; border-radius: 6px; color: #3b4450; margin: .12rem 0; font-size: .88rem; }
.mail-read { grid-area: read; padding: 1.15rem 1.25rem; }
.mail-subject { font-size: 1.32rem; font-weight: 650; margin-bottom: .9rem; }
.mail-from { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.mail-meta { flex: 1; }
.avatar { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.mail-body { white-space: pre-wrap; margin-bottom: 1.1rem; line-height: 1.5; }
.mail-cta { display: inline-block; color: #fff; padding: .5rem .95rem; border-radius: 4px; font-weight: 650; pointer-events: none; }

.mail.o365 { font-family: "Segoe UI", Arial, sans-serif; }
.mail.o365 .mail-chrome { background: #faf9f8; }
.mail.o365 .o-word { color: #0f6cbd; font-weight: 700; }
.mail.o365 .o-waffle { color: #0f6cbd; font-size: 1.05rem; }
.mail.o365 .o-search { margin-left: auto; color: #8a8886; background: #f3f2f1; padding: .28rem .75rem; border-radius: 4px; font-size: .82rem; }
.mail.o365 .mail-side { background: #faf9f8; }
.mail.o365 .o-tabs { display: flex; gap: 1rem; font-size: .82rem; font-weight: 650; margin: 0 .1rem .7rem; }
.mail.o365 .o-tabs .on { color: #0f6cbd; border-bottom: 2px solid #0f6cbd; padding-bottom: .22rem; }
.mail.o365 .o-tabs span:not(.on) { color: #8a8886; }
.mail.o365 .mail-nav.on { background: #ebf3fc; color: #0f6cbd; font-weight: 650; }
.mail.o365 .avatar { background: #0f6cbd; }
.mail.o365 .mail-cta { background: #0f6cbd; }

.mail.gmail { font-family: "Google Sans", Roboto, Arial, sans-serif; }
.mail.gmail .mail-chrome { background: #fff; }
.mail.gmail .gm-logo { display:inline-flex; width:24px; height:24px; align-items:center; justify-content:center; background:#ea4335; color:#fff; border-radius:5px; font-weight:800; font-size:.82rem; }
.mail.gmail .gm-word { color: #5f6368; font-weight: 500; font-size: 1.15rem; letter-spacing: -.01em; }
.mail.gmail .gm-search { margin-left: auto; color: #80868b; background: #eaf1fb; padding: .38rem .95rem; border-radius: 999px; font-size: .82rem; min-width: 170px; }
.mail.gmail .mail-side { background: #fff; }
.mail.gmail .gm-compose { background:#c2e7ff; color:#001d35; font-weight:600; padding:.5rem .85rem; border-radius:999px; margin-bottom:.75rem; display:inline-block; font-size:.85rem; }
.mail.gmail .mail-nav { border-radius: 0 999px 999px 0; padding-left: .85rem; }
.mail.gmail .mail-nav.on { background: #fce8e6; color: #d93025; font-weight: 700; }
.mail.gmail .avatar { background: #7b4fc0; }
.mail.gmail .gm-star { color:#dadce0; font-size:1.25rem; }
.mail.gmail .mail-cta { background: #1a73e8; }
.mail.gmail .gm-actions { display:flex; gap:.6rem; margin-top:1rem; }
.mail.gmail .gm-actions span { border:1px solid #dadce0; border-radius:999px; padding:.32rem .9rem; color:#3c4043; font-size:.85rem; }

.mail.generic { font-family: var(--font); }
.mail.generic .mail-chrome { background: #f4f6f9; }
.mail.generic .g-logo { display:inline-flex; width:24px; height:24px; align-items:center; justify-content:center; background:#475569; color:#fff; border-radius:5px; font-size:.85rem; }
.mail.generic .g-word { color: #334155; font-weight: 700; font-size: 1.05rem; }
.mail.generic .g-search { margin-left: auto; color: #64748b; background: #e8edf3; padding: .3rem .8rem; border-radius: 6px; font-size: .82rem; min-width: 150px; }
.mail.generic .mail-side { background: #f8fafc; }
.mail.generic .mail-nav.on { background: #e8edf3; color: #334155; font-weight: 700; }
.mail.generic .avatar { background: #475569; }
.mail.generic .mail-cta { background: #475569; }

/* ---------- spot the red flags ---------- */
.spot-intro { font-weight: 600; margin: .2rem 0 .8rem; }
.mail-spot .ft { font: inherit; color: inherit; background: #fff8d6; border: 1px dashed #d8c24a; border-radius: 4px; padding: 0 2px; cursor: pointer; transition: background .12s; }
.mail-spot .ft:hover { background: #fff0a8; }
.mail-spot .ft.picked { background: #ffe08a; border-style: solid; border-color: #c9a227; animation: ft-pop .18s ease; }
@keyframes ft-pop { 50% { transform: scale(1.06); } }
.mail-spot.checked .ft { cursor: default; }
.mail-spot.checked .ft.ok { background: #d7f5dd; border: 1px solid #2f9e52; color: #176234; }
.mail-spot.checked .ft.missed { background: #fde3c4; border: 1px solid #d98324; color: #8a4b05; }
.mail-spot.checked .ft.wrong { background: #fbd6d6; border: 1px solid #c0392b; color: #8a1f17; text-decoration: line-through; }
.spot-result { margin: 1rem 0; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--card-2); }
.spot-notes { list-style: none; padding: 0; margin: .5rem 0 0; }
.spot-notes li { padding: .5rem .7rem; border-radius: 8px; margin: .35rem 0; font-size: .92rem; }
.spot-notes .sn-ok { background: #e9f8ee; }
.spot-notes .sn-missed { background: #fdf0e1; }
.spot-notes .sn-wrong { background: #fcebea; }
[data-spot-check] { margin-top: .4rem; }
.scenario-items { margin-top: .6rem; }
.scenario-items .ft { display: block; width: 100%; text-align: left; margin: .4rem 0; padding: .6rem .85rem; border-radius: 10px; }

/* =====================================================================
   Auth pages (sign in, reset, MFA, sign up)
   ===================================================================== */
body.auth { background: #fff; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-form { display: flex; flex-direction: column; padding: 2rem clamp(1.25rem, 5vw, 4rem); }
.auth-logo img { height: 30px; width: auto; display: block; }
.auth-inner { width: 100%; max-width: 410px; margin: auto; padding: 2.5rem 0; }
.auth-title { font-size: 1.85rem; margin: .2rem 0 .35rem; }
.auth-sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth-fields .btn { margin-top: .3rem; }
.auth-switch { text-align: center; margin-top: 1.6rem; color: var(--muted); font-size: .92rem; }
.auth-switch a { font-weight: 600; text-decoration: none; }
.auth-foot { color: var(--faint); font-size: .78rem; margin: 0; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin: 1.3rem 0 .4rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.code-input { font-size: 1.5rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

.auth-brand {
  position: relative; overflow: hidden; isolation: isolate;
  margin: .75rem; border-radius: 26px;
  background:
    radial-gradient(90% 70% at 85% 10%, rgba(111,79,147,.65) 0%, rgba(111,79,147,0) 60%),
    radial-gradient(70% 60% at 10% 95%, rgba(53,95,130,.7) 0%, rgba(53,95,130,0) 60%),
    linear-gradient(160deg, #13263a 0%, #1f3b57 50%, #3a2a52 100%);
  color: #fff; display: flex; align-items: center;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 70% 30%, #000 0%, transparent 100%);
          mask-image: radial-gradient(70% 60% at 70% 30%, #000 0%, transparent 100%);
}
.auth-brand-inner { width: 100%; max-width: 520px; margin: 0 auto; padding: 3rem clamp(1.5rem, 4vw, 3.5rem); }
.auth-eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #d4c3ea; margin-bottom: .8rem; }
.auth-brand h2 { color: #fff; font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; margin: 0 0 .9rem; }
.auth-lede { color: #cdd7ee; font-size: 1.04rem; max-width: 42ch; margin-bottom: 2rem; }

.demo-mail {
  background: rgba(255,255,255,.97); color: var(--ink); border-radius: 18px; padding: 1.1rem 1.2rem 1rem;
  box-shadow: 0 30px 60px -20px rgba(4,10,30,.6), 0 0 0 1px rgba(255,255,255,.4);
  transform: rotate(-1.2deg); max-width: 430px; margin-bottom: 2rem;
}
.demo-mail-head { display: flex; align-items: center; gap: .7rem; }
.demo-mail-head div { flex: 1; min-width: 0; line-height: 1.3; }
.demo-mail-head strong { display: block; font-size: .9rem; }
.demo-mail-head small { display: block; color: var(--bad); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #e2e7ef; color: var(--ink-2); font-weight: 700; font-size: .8rem; flex: none; }
.demo-tag { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--purple-600); background: var(--purple-50); padding: .2rem .5rem; border-radius: 999px; }
.demo-subj { font-weight: 650; font-size: .95rem; margin: .8rem 0 .6rem; }
.demo-flags { list-style: none; padding: 0; margin: 0 0 .85rem; display: grid; gap: .3rem; }
.demo-flags li { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--ink-2); margin: 0; }
.flag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-50); }
.demo-caught { display: flex; align-items: center; gap: .5rem; background: var(--ok-50); color: var(--ok); border-radius: 10px; padding: .5rem .7rem; font-size: .84rem; font-weight: 650; }
.demo-caught svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.auth-points li { position: relative; padding-left: 1.7rem; color: #cdd7ee; font-size: .95rem; margin: 0; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: .3rem; width: 16px; height: 16px; border-radius: 50%; background: rgba(158,240,26,.16); box-shadow: inset 0 0 0 1.5px var(--lime); }
.auth-points li::after { content: ""; position: absolute; left: 5.5px; top: .5rem; width: 4px; height: 7px; border: solid var(--lime); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.auth-points strong { color: #fff; font-weight: 650; }

/* Older templates still using these */
.login-shell { min-height: 60vh; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); }

/* =====================================================================
   Public landing page
   ===================================================================== */
.lp { max-width: 1120px; margin: 0 auto; }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2.5rem; align-items: center; padding: 2rem 0 3rem; }
.lp-hero h1 { font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3.3rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; margin: .3rem 0 1rem; }
.lp-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--purple), #355f82); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero .lede { font-size: 1.12rem; color: var(--ink-2); max-width: 52ch; margin-bottom: 1.5rem; }
.lp-cta { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.lp-cta .btn + .btn { margin-left: 0; }
.lp-note { color: var(--muted); font-size: .86rem; margin-top: .9rem; }
.lp-visual { position: relative; }
.lp-visual .demo-mail { transform: rotate(1.5deg); margin: 0 0 0 auto; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); }
.lp-visual::before { content: ""; position: absolute; inset: -10% -6% -10% 6%; z-index: -1; border-radius: 40px; background: radial-gradient(60% 60% at 60% 40%, rgba(111,79,147,.22), transparent 70%); }
.lp-trust { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; color: var(--muted); font-size: .88rem; font-weight: 600; padding: 1rem 0 2.5rem; border-bottom: 1px solid var(--line); margin-bottom: 3rem; }
.lp-trust span::before { content: "✓"; color: var(--ok); margin-right: .45rem; font-weight: 800; }
.lp-section-title { text-align: center; max-width: 640px; margin: 0 auto 1.8rem; }
.lp-section-title h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -.025em; margin-bottom: .4rem; }
.lp-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 3.5rem; }
.lp-features .card { margin: 0; }
.lp-features .tile-ico { margin-bottom: .8rem; }
.lp-features p { color: var(--muted); font-size: .92rem; margin: 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 2rem; align-items: stretch; }
.plan { display: flex; flex-direction: column; margin: 0; }
.plan.featured { border: 2px solid var(--purple); box-shadow: 0 20px 40px -18px rgba(111,79,147,.45); position: relative; }
.plan.featured::before { content: "Most offices"; position: absolute; top: -12px; left: 1.3rem; background: var(--purple); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 999px; }
.plan-price { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; color: var(--navy); line-height: 1; margin: .4rem 0 .2rem; }
.plan-price small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .plan-seats { color: var(--muted); font-size: .88rem; margin-bottom: .9rem; }
.plan .plan-foot { margin-top: auto; padding-top: .8rem; }
.lp-band { text-align: center; }
.lp-band h2 { color: #fff; font-size: 1.6rem; }
.lp-band p { margin: 0 auto 1.2rem; }

/* =====================================================================
   Focus, motion, responsive
   ===================================================================== */
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; border-radius: 8px; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .pc-ring, .pc-tick { animation: none; stroke-dashoffset: 0; }
  .confetti-piece { display: none; }
}

@media (max-width: 1100px) {
  .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-top { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw);
    transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .side { transform: none; }
  body.nav-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(11,23,54,.45); z-index: 35; }
  .nav-toggle { display: grid; }
  .topbar-logo { display: block; }
  .topbar-org .org-name { display: none; }
  .topbar-action span { display: none; }
  .topbar-action { padding: .5rem; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .lp-hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1rem; }
  .lp-visual .demo-mail { margin: 0 auto; }
}

@media (max-width: 720px) {
  .grid, .grid-3, .field-row { grid-template-columns: 1fr; }
  .lp-features { grid-template-columns: 1fr; }
  .mail { grid-template-columns: 1fr; grid-template-areas: "chrome" "read"; }
  .mail-side { display: none; }
  .stat-num { font-size: 1.55rem; }
  .rec-card { flex-direction: column; align-items: flex-start; }
  .product-tag { display: none; }
  .lesson-actions { justify-content: stretch; }
  .lesson-actions .btn { flex: 1; }
  .card { padding: 1.05rem 1.1rem; }
}

@media print {
  .side, .topbar, .side-scrim, footer.tiny, .skip-link { display: none !important; }
  body.app { display: block; background: #fff; }
  .card, .stat { box-shadow: none; }
  .hero { background: #fff; color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
  .hero h1, .hero p { color: var(--ink); }
}
.people-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 960px) { body.app { background: var(--bg); } }
@media (max-width: 720px) { .people-grid { grid-template-columns: 1fr; } }
.error-card { max-width: 560px; margin: 3rem auto; text-align: center; padding: 2.4rem 2rem; }
.error-code { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 3.4rem; line-height: 1; letter-spacing: -.04em; background: linear-gradient(135deg, var(--navy), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: .6rem; }
/* Tenant "header" color shows as a thin brand stripe across the top bar. */
body.app:not(.app--guest) .topbar { box-shadow: inset 0 3px 0 var(--header); }

/* ===== 2.0: account security, Security Center, trials (CODE-2; designer may polish) ===== */
.nav-badge { margin-left: auto; min-width: 1.4rem; text-align: center; font-size: .72rem; padding: .05rem .4rem; }
.card.notice { border-left: 4px solid var(--warn, #c76a0a); }
.status-banner { border-left: 6px solid var(--line); }
.status-banner.status-red { border-left-color: var(--bad, #c2362b); }
.status-banner.status-amber { border-left-color: var(--warn, #c76a0a); }
.status-banner.status-green { border-left-color: var(--ok); }
.status-banner h2 { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-size: 1.05rem; }
.findings td { vertical-align: top; }
/* 2.9: Acknowledge and Resolve stack in the findings table so the last column never clips at desktop widths. */
.findings td.actions form { display: block; margin: 0 0 .3rem; }
.findings td.actions form + form { margin-left: 0; }
td.actions form, .actions form { display: inline-block; margin: 0 .25rem .25rem 0; }
.history-chart { width: 100%; height: auto; max-height: 180px; display: block; }
.history-chart .axis { stroke: var(--line); stroke-width: 1; }
.history-chart .bar-total { fill: var(--purple-100); }
.history-chart .bar-urgent { fill: var(--bad, #c2362b); }
.history-chart .chart-label { font-size: 10px; fill: var(--muted); }
.legend { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: -1px; }
.legend-total { background: var(--purple-100); }
.legend-urgent { background: var(--bad, #c2362b); }
.host-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .3rem 0; border-bottom: 1px solid var(--line-2); }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem .8rem;
  font-size: 1.05rem; letter-spacing: .04em; }
.mfa-key { font-size: 1rem; letter-spacing: .08em; word-break: break-all; }
.steps-list { padding-left: 1.2rem; }
.offer-box { background: var(--purple-50); border: 1px solid var(--purple-100); border-radius: 10px; padding: .8rem 1rem;
  margin: 0 0 1rem; }
.offer-box ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.form-grid .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }

/* ---- Security center polish ---- */
.status-banner { border-left-width: 6px; padding: 1.2rem 1.4rem; }
.status-main { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.status-main > div { flex: 1; min-width: 220px; }
.status-main h2 { font-size: 1.45rem; margin: 0 0 .15rem; }
.status-main p { margin: 0; }
.status-dot { width: 46px; height: 46px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 0 8px var(--ok-50); }
.status-red .status-dot { background: var(--bad); box-shadow: 0 0 0 8px var(--bad-50); animation: pulse-dot 2s ease-in-out infinite; }
.status-amber .status-dot { background: var(--warn); box-shadow: 0 0 0 8px var(--warn-50); }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 14px var(--bad-50); } }
.sev-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.sev-chip { display: inline-flex; align-items: baseline; gap: .35rem; padding: .35rem .75rem; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.sev-chip strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.sev-critical strong, .sev-high strong { color: var(--bad); }
.sev-medium strong { color: var(--warn); }
.app-stack { display: grid; gap: 1rem; margin-bottom: 1rem; }
.app-stack > .card { margin: 0; }
.checklist-2col { columns: 2 320px; column-gap: 2rem; }
.checklist-2col li { break-inside: avoid; }
.events-table td:first-child { white-space: nowrap; }
.events-table td:last-child { max-width: 420px; overflow-wrap: anywhere; }
@media (min-width: 1100px) { .host-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trials-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 960px) { .trials-grid { grid-template-columns: 1fr; } }
.hero code { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.lp-topics { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; max-width: 900px; margin: 0 auto 3.5rem; }
.topic { padding: .5rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .88rem; color: var(--ink-2); box-shadow: var(--shadow-xs); }
.topic.hot { border-color: var(--purple-100); background: var(--purple-50); color: var(--purple-600); }
.topic.hot::before { content: "New"; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--purple-600); color: #fff; border-radius: 999px; padding: .1rem .4rem; margin-right: .45rem; vertical-align: 1px; }

/* ---- Utilities that replace inline style="" attributes (review finding I-3:
   the CSP no longer allows inline styles). ---- */
.kicker-light { color: #cbb7f2; }
.m-0 { margin: 0; }
.mt-1 { margin-top: 1rem; }
.mt-08 { margin-top: .8rem; }
.mt-03 { margin-top: .3rem; }
.ml-05 { margin-left: .5rem; }
.inline-form { display: inline; }
.inline-block-form { display: inline-block; margin: .3rem .6rem .3rem 0; }
.card-tight { padding: .4rem .4rem .2rem; }
.stat-num.stat-num-sm { font-size: 1.15rem; padding: .45rem 0 .2rem; }
.stat-good { color: var(--ok); }
.stat-bad { color: var(--bad); }
.stat-warn { color: var(--warn); }
.tone-low { color: #1e7b41; }
.tone-moderate { color: #a65400; }
.tone-high { color: #b3261e; }
.bg-low { background: #1e7b41; }
.bg-moderate { background: #a65400; }
.bg-high { background: #b3261e; }
.dial-low { --c: #2f9e52; }
.dial-moderate { --c: #d98324; }
.dial-high { --c: #c0392b; }
.logo-thumb { max-height: 48px; }
.fine-print { font-size: .8rem; }
.media-thumb { max-width: 100%; border-radius: 12px; }
.scroll-box { max-height: 260px; overflow: auto; }
.pre-wrap { white-space: pre-wrap; }
.takeaway.takeaway-help { border-left-color: #0f6cbd; background: #eef5fc; color: #143a5a; }
.takeaway-help .takeaway-label { color: #0f6cbd; }
.code-sm { font-size: .78rem; }
.text-alert { color: #b00020; }
.w-100 { width: 100%; }
.narrow-420 { max-width: 420px; margin: 0 auto; }
.narrow-720 { max-width: 720px; margin: 0 auto; }
.brand-row { display: flex; align-items: center; gap: 1rem; }
.logo-26 { height: 26px; width: auto; }
.dim { opacity: .8; }
.lesson-actions.justify-start { justify-content: flex-start; }
.cell-right { text-align: right; }
.btn.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .82rem; }
[hidden] { display: none !important; }
/* AI lure review (phishing_template.html): keep the email readable, not code-styled. */
.lure-body { background: var(--card-2); color: var(--ink); white-space: pre-wrap; word-break: break-word; font-family: inherit; border: 1px solid var(--line); }

/* =====================================================================
   2.0 design system components (docs/UI-NOTES.md). Later rules win over
   the older ones above, so these are the reference definitions.
   ===================================================================== */

/* Labels in sentence case: no tracked-out capitals. */
.kicker { font-size: .84rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--purple-600); }
.hero .kicker, .kicker-light { color: #d9cdeb; }
.tile-group > h2 { font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--ink-2); font-family: var(--font-display); font-weight: 650; }
.takeaway-label { font-size: .8rem; letter-spacing: 0; text-transform: none; }
.auth-eyebrow { font-size: .88rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
.plan.featured::before { letter-spacing: 0; text-transform: none; font-size: .74rem; }

/* ---------- page header: every non-landing page starts with one ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem 1.5rem; margin: .1rem 0 1.5rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--line);
}
.page-head-text { min-width: 0; flex: 1 1 420px; }
.page-head h1 { margin: 0; font-size: clamp(1.45rem, 1.15rem + .9vw, 1.85rem); }
.page-sub { margin: .35rem 0 0; color: var(--muted); max-width: 70ch; font-size: .98rem; }
.page-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-actions form { margin: 0; }
.page-actions .btn + .btn { margin-left: 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; padding: 0; margin: 0 0 .4rem; font-size: .86rem; color: var(--muted); }
.crumbs li { margin: 0; display: inline-flex; align-items: center; gap: .5rem; }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; border-top: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint); transform: rotate(45deg); }
.crumbs a { color: var(--muted); font-weight: 550; text-decoration: none; }
.crumbs a:hover { color: var(--purple-600); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); font-weight: 600; }

/* ---------- sections: a card with a head (title, one line, one action) ---------- */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head > div { min-width: 0; flex: 1 1 260px; }
.card-head h2 { margin: 0; }
.card-head p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.card-head .btn + .btn, .card-head form + .btn { margin-left: 0; }
.card-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card-head-actions form { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 1.15rem 1.4rem 0; }
.card-flush > .card-foot-note { padding: .8rem 1.4rem 1rem; margin: 0; }
.card-flush table th:first-child, .card-flush table td:first-child { padding-left: 1.4rem; }
.card-flush table th:last-child, .card-flush table td:last-child { padding-right: 1.4rem; }
.card-flush table th { border-radius: 0; }
.card-foot-note { color: var(--muted); font-size: .86rem; margin-top: .9rem; }
.section-title { font-size: 1.12rem; margin: 2rem 0 .8rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.split > .card, .split > div > .card:last-child { margin-bottom: 0; }
.split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > .card + .card { margin-top: 1rem; }
.card.danger-zone { border-color: #f1cfcb; }
.danger-zone h2 { color: var(--bad); }
.note { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; font-size: .9rem; color: var(--ink-2); margin: 0 0 1rem; }
.note.warn { background: var(--warn-50); border-color: #f1d6b0; color: #6b3d05; }
.note.bad { background: var(--bad-50); border-color: #f1c7c2; color: #7d1f17; }
.note.ok { background: var(--ok-50); border-color: #c6ead6; color: #0d5c37; }
.note > :last-child { margin-bottom: 0; }
.callout { display: flex; gap: .9rem; align-items: flex-start; }
.callout-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--purple-50); color: var(--purple-600); }
.callout-ico svg, .empty-ico svg, .ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
td.cell-main { font-weight: 600; color: var(--ink); }
td .sub, .cell-sub { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; }
td.actions, th.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn, td.actions form + form { margin-left: .3rem; }
.table-compact th, .table-compact td { padding: .5rem .65rem; }
.bar { display: inline-block; vertical-align: middle; width: 90px; height: 7px; border-radius: 99px; background: #e3e8f0; overflow: hidden; margin-right: .5rem; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand); }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.meter-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- pills ---------- */
.pill.neutral { background: var(--line-2); color: var(--ink-2); }
.pill.info { background: #e8eff6; color: #24486a; }
.pill.ok { background: var(--ok-50); color: var(--ok); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-row { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 2rem 1.25rem; border: 1.5px dashed #d5dbe6; border-radius: var(--r-lg); background: var(--card-2); }
td > .empty { margin: .4rem 0; }
.empty-ico { width: 44px; height: 44px; margin: 0 auto .75rem; border-radius: 12px; display: grid; place-items: center; background: var(--purple-50); color: var(--purple-600); }
.empty-title { font-family: var(--font-display); font-weight: 650; font-size: 1.02rem; margin: 0 0 .25rem; color: var(--ink); }
.empty-text { color: var(--muted); max-width: 52ch; margin: 0 auto; font-size: .92rem; }
.empty-actions { margin-top: 1rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.empty-actions .btn + .btn { margin-left: 0; }

/* ---------- forms ---------- */
.field { margin-bottom: 1rem; }
.field > input, .field > select, .field > textarea, .field .color-field input { margin-bottom: 0; }
.field > label { margin-bottom: .3rem; }
.field > input, .field > select, .field > textarea { margin-top: 0; }
.hint { display: block; margin: .35rem 0 0; color: var(--muted); font-size: .83rem; font-weight: 400; line-height: 1.45; }
label .opt { color: var(--muted); font-weight: 400; }
.field-error { display: none; margin: .35rem 0 0; color: var(--bad); font-size: .83rem; font-weight: 600; }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--bad); }
input:user-invalid ~ .field-error, textarea:user-invalid ~ .field-error { display: block; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1rem; }
.form-section { border-top: 1px solid var(--line-2); margin-top: 1.1rem; padding-top: 1.1rem; }
.form-section > h3 { margin-bottom: .2rem; }
.form-section > h3 + p { color: var(--muted); font-size: .88rem; margin-bottom: .8rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line-2); }
.form-actions .btn + .btn, .form-actions .btn + form { margin-left: 0; }
.form-actions form { margin: 0; }
.form-actions .spacer { flex: 1; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.form-inline > .field { margin-bottom: 0; flex: 1 1 160px; }
.form-inline input, .form-inline select { margin: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .45rem; }
.choice-grid .choice { margin: 0; }
.choice small { color: var(--muted); font-weight: 400; margin-left: .3rem; }
.check-tools { font-size: .86rem; margin: 0 0 .5rem; }
.check-tools a { font-weight: 600; text-decoration: none; }
.code-box { font: 600 1rem ui-monospace, Consolas, monospace; background: var(--card-2); border: 1px dashed var(--line); padding: .5rem .75rem; border-radius: 8px; word-break: break-all; }

/* ---------- tabs (progressive: without JS every panel shows) ---------- */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin: -.4rem 0 1.25rem; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 480px) { .tabs { flex-wrap: wrap; border-bottom: 0; gap: .25rem; } .tabs .tab { border: 1px solid var(--line); border-radius: 999px; min-height: 40px; padding: .5rem .85rem; margin: 0; } .tabs .tab[aria-selected="true"] { border-color: var(--purple); background: var(--purple-50); } }
.tabs[hidden] { display: none !important; }
.tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: .7rem .95rem; min-height: 44px; font: 600 .93rem var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--ink); background: var(--card-2); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--purple); }
.tab .pill { margin-left: .35rem; }
[data-tab-panel][hidden] { display: none !important; }

/* ---------- dashboard ---------- */
.setup-steps { list-style: none; counter-reset: step; padding: 0; margin: .4rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .6rem; }
.setup-steps li { counter-increment: step; margin: 0; }
.setup-steps a { position: relative; display: block; height: 100%; padding: .85rem .95rem .85rem 3.1rem; border: 1px solid var(--line); background: #fff; border-radius: 12px; text-decoration: none; color: var(--ink); }
.setup-steps a:hover { border-color: var(--purple); color: var(--ink); }
.setup-steps a::before { content: counter(step); position: absolute; left: .9rem; top: .85rem; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--purple-50); color: var(--purple-600); }
.setup-steps strong { display: block; font-weight: 650; font-size: .93rem; }
.setup-steps span { display: block; color: var(--muted); font-size: .83rem; line-height: 1.4; margin-top: .15rem; }
.setup-steps li.done a { background: var(--card-2); }
.setup-steps li.done a::before { content: ""; background: var(--ok); }
.setup-steps li.done a::after { content: ""; position: absolute; left: 1.55rem; top: 1.25rem; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.setup-steps li.done strong { color: var(--muted); }
.setup-steps li.next a { border-color: var(--purple); box-shadow: var(--ring); }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; border-top: 1px solid var(--line-2); }
.link-list li:first-child { border-top: 0; }
.link-list a { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; text-decoration: none; color: var(--ink); }
.link-list a:hover { color: var(--purple-600); }
.link-list a:hover .ico { background: var(--purple-100); }
.link-list .ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--purple-50); color: var(--purple-600); }
.link-list .ico.navy { background: #e8eef9; color: var(--navy-700); }
.link-list .ico.green { background: var(--ok-50); color: var(--ok); }
.link-list .ico.amber { background: var(--warn-50); color: var(--warn); }
.link-list strong { display: block; font-weight: 600; font-size: .93rem; }
.link-list small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.links-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.links-grid > .card { margin: 0; }
.links-grid h2 { font-size: 1rem; margin-bottom: .3rem; }
.stat-link { text-decoration: none; color: inherit; display: block; }
.stat-link:hover { color: inherit; border-color: #cdbfe0; }
.stat-hint { display: block; font-size: .78rem; color: var(--faint); margin-top: .15rem; }

/* ---------- learner home ---------- */
.next-up { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; border: 1px solid #ddd0ea; background: linear-gradient(100deg, #f7f3fb 0%, #fff 65%); }
.next-up .lesson-art { width: 64px; height: 64px; }
.next-up h2 { font-size: 1.2rem; margin: .1rem 0 .25rem; }
.next-up p { margin: 0; color: var(--muted); }
.next-up .btn { min-width: 170px; }
.learn-summary { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .7rem 0 0; color: #d3dcf0; font-size: .92rem; }
.learn-summary strong { color: #fff; }
.lesson-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.lesson-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center; margin: 0; padding: .8rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.lesson-row .lesson-art { width: 46px; height: 46px; border-radius: 12px; }
.lesson-row h3 { margin: 0; font-size: .98rem; }
.lesson-row p { margin: .1rem 0 0; color: var(--muted); font-size: .86rem; }
.lesson-row .row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lesson-row .row-actions form { margin: 0; }
.lesson-row.is-overdue { border-color: #f1c7c2; }
.passed-list summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); font-weight: 650; }
.passed-list summary::-webkit-details-marker { display: none; }
.passed-list summary::after { content: "Show"; color: var(--purple-600); font-size: .86rem; font-weight: 600; }
.passed-list[open] summary::after { content: "Hide"; }
.passed-list[open] summary { margin-bottom: .6rem; }

/* ---------- campaign results ---------- */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.funnel .stat { padding: .85rem 1rem; }
.funnel .stat-num { font-size: 1.6rem; }
.result-key { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .84rem; color: var(--muted); margin-top: .8rem; }

/* ---------- people / customer rows ---------- */
.avatar-xs { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--navy) 0%, var(--purple) 100%); }
.person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.person > span:last-child { min-width: 0; }
.person strong { display: block; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
a.person { text-decoration: none; }
a.person:hover strong { color: var(--purple-600); }
.acc { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; margin-bottom: .6rem; box-shadow: var(--shadow-xs); }
.acc > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) auto; gap: .8rem; align-items: center; padding: .85rem 1.1rem; cursor: pointer; border-radius: var(--r-lg); }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: var(--card-2); }
.acc > summary .acc-toggle { color: var(--purple-600); font-weight: 600; font-size: .86rem; }
.acc > summary .acc-toggle::after { content: attr(data-closed); }
.acc[open] > summary .acc-toggle::after { content: attr(data-open); }
.acc[open] > summary { border-bottom: 1px solid var(--line-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.acc-body { padding: 1.1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.acc-body > section { border: 1px solid var(--line-2); border-radius: var(--r); padding: .9rem 1rem; background: var(--card-2); }
.acc-body h3 { font-size: .93rem; margin-bottom: .55rem; }
.acc-body .choice { background: #fff; }
.acc-body form + form { margin-top: .6rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line-2); }
.toggle-row:first-of-type { border-top: 0; }
.toggle-row form { margin: 0; }
.toggle-row strong { display: block; }
.toggle-row small { color: var(--muted); }

/* ---------- lesson pages on phones: sticky Back / Next ---------- */
.quiz-q { padding: 1rem 0; border-top: 1px solid var(--line-2); }
.quiz-q:first-of-type { border-top: 0; padding-top: .3rem; }
.quiz-q legend, .quiz-q > p:first-child { font-weight: 650; font-size: 1.02rem; padding: 0; margin-bottom: .55rem; }
fieldset.quiz-q { border: 0; border-top: 1px solid var(--line-2); border-radius: 0; margin: 0; padding: 1rem 0; }
fieldset.quiz-q:first-of-type { border-top: 0; }
.quiz-q .choice { padding: .75rem .9rem; min-height: 48px; }
.result-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.result-list li { margin: 0; padding: .85rem 1rem .85rem 2.9rem; border: 1px solid var(--line); border-radius: var(--r); position: relative; background: #fff; }
.result-list li::before { content: ""; position: absolute; left: .95rem; top: .95rem; width: 22px; height: 22px; border-radius: 50%; }
.result-list li.ok::before { background: var(--ok-50); box-shadow: inset 0 0 0 2px var(--ok); }
.result-list li.miss { border-color: #f1c7c2; }
.result-list li.miss::before { background: var(--bad-50); box-shadow: inset 0 0 0 2px var(--bad); }
.result-list strong { display: block; margin-bottom: .2rem; }
.result-list p { margin: .2rem 0 0; font-size: .92rem; }
.result-list .answer { color: var(--ink); }
.quiz-rules { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .55rem; }
.quiz-rules li { position: relative; padding-left: 1.9rem; margin: 0; }
.quiz-rules li::before { content: ""; position: absolute; left: 0; top: .2rem; width: 18px; height: 18px; border-radius: 50%; background: var(--purple-50); box-shadow: inset 0 0 0 1.5px var(--purple); }
.score-big { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.score-big.bad { color: var(--bad); }

@media (max-width: 720px) {
  .lesson-actions { position: sticky; bottom: 0; z-index: 20; margin: 1rem -1rem 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: rgba(244,246,250,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
  .lesson-actions .btn, .lesson-actions button { min-height: 50px; font-size: 1rem; }
  .lesson-actions form { flex: 1; }
  .lesson-actions form .btn, .lesson-actions form button { width: 100%; }
  .lesson-body { font-size: 1.03rem; line-height: 1.65; }
  .lx-art { display: none; }
}

/* ---------- auth / misc ---------- */
.auth-steps { display: flex; gap: .4rem; margin: 0 0 1rem; }
.auth-steps span { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.auth-steps span.on { background: var(--purple); }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 550; display: inline-block; padding: .35rem 0; }
.footer-links a:hover { color: var(--purple-600); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.media-grid .card { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.media-grid img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--card-2); border-radius: 10px; border: 1px solid var(--line-2); width: 100%; }
.media-grid p { margin: 0; overflow-wrap: anywhere; font-size: .85rem; }
.json-editor { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .82rem; min-height: 360px; }

/* ---------- responsive for the components above ---------- */
@media (max-width: 1100px) {
  .links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .split, .split-even { grid-template-columns: 1fr; }
  .acc > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .acc > summary .acc-pills { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) {
  .page-head { margin-bottom: 1.1rem; padding-bottom: .9rem; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > form { flex: 1 1 auto; }
  .page-actions > form .btn { width: 100%; }
  .links-grid, .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-up { grid-template-columns: auto minmax(0, 1fr); }
  .next-up .btn { grid-column: 1 / -1; width: 100%; min-height: 50px; }
  .lesson-row { grid-template-columns: auto minmax(0, 1fr); padding: .8rem .85rem; }
  .lesson-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .lesson-row .row-actions .btn { flex: 1; min-height: 46px; }
  .card-flush > .card-head { padding: 1rem 1.1rem 0; }
  .card-flush table th:first-child, .card-flush table td:first-child { padding-left: 1.1rem; }
  .card-flush table th:last-child, .card-flush table td:last-child { padding-right: 1.1rem; }
  /* Tables marked .table-stack become one card per row, labelled from data-label. */
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead, .table-stack tr.head { display: none; }
  .card-flush .table-stack { padding: 0 1.1rem .4rem; }
  .table-stack tr { border: 1px solid var(--line); border-radius: 12px; padding: .55rem .85rem; margin: 0 0 .6rem; background: #fff; }
  .table-stack tr:nth-child(even) > td, .table-stack tr:hover > td { background: none; }
  .table-stack td, .card-flush .table-stack td:first-child, .card-flush .table-stack td:last-child { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 600; text-align: left; flex: none; }
  .table-stack td:not([data-label])::before, .table-stack td[data-label=""]::before { display: none; }
  .table-stack td.cell-main { display: block; text-align: left; font-size: 1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line-2); margin-bottom: .2rem; }
  .table-stack td.cell-main::before { display: none; }
  .table-stack td.actions { justify-content: flex-end; padding-top: .5rem; }
  .table-stack td:empty { display: none; }
}
.verdict-badge { text-transform: capitalize; letter-spacing: 0; font-weight: 700; font-size: .86rem; }
.group-title { font-size: .98rem; margin: 1.3rem 0 .6rem; }
@media (min-width: 1180px) { .lesson-list.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .learn-top .progress-card { display: none; }
  .learn-top .hero h1 { font-size: 1.4rem; }
  .learn-top .hero > p:not(.learn-summary) { display: none; }
  .learn-summary { flex-direction: column; gap: .2rem; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat { padding: .8rem .9rem; }
}
.form-inline > .field.grow-2 { flex: 2 1 260px; }
.narrow-field { flex: 0 1 90px !important; }
a.tab { text-decoration: none; display: inline-flex; align-items: center; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--purple); }
.text-ok { color: var(--ok); font-weight: 600; }

/* ---------- landing page (2.0) ---------- */
.lp-hero h1 { max-width: 16ch; }
ul.lp-trust { list-style: none; margin: 0 0 3rem; padding: 1rem 0 2.5rem; }
ul.lp-trust li { margin: 0; }
ul.lp-trust li::before { content: "✓"; color: var(--ok); margin-right: .45rem; font-weight: 800; }
.lp-section { margin: 0 0 3.5rem; scroll-margin-top: 80px; }
.lp-section .lp-features { margin-bottom: 0; }
.lp-features h3 { font-size: 1.02rem; }
.lp-steps { list-style: none; counter-reset: lp; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.lp-steps li { counter-increment: lp; margin: 0; position: relative; padding: 1.4rem 1.4rem 1.3rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.lp-steps li::before { content: counter(lp); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; margin-bottom: .8rem; background: var(--brand); color: #fff; font: 700 1rem var(--font-display); }
.lp-steps li:nth-child(2)::before { background: var(--purple-600); }
.lp-steps li:nth-child(3)::before { background: var(--ok); }
.lp-steps h3 { font-size: 1.05rem; }
.lp-steps p { color: var(--muted); font-size: .94rem; margin: 0; }
.lp-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2.5rem; align-items: center; margin: 0 0 3.5rem; padding: 2.2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.lp-split h2 { font-size: clamp(1.4rem, 1.15rem + .8vw, 1.8rem); letter-spacing: -.02em; }
.lp-checks { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.lp-checks li { position: relative; padding-left: 1.8rem; margin: 0; font-weight: 550; }
.lp-checks li::before { content: ""; position: absolute; left: 0; top: .25rem; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-50); box-shadow: inset 0 0 0 1.5px var(--ok); }
.lp-checks li::after { content: ""; position: absolute; left: 6.5px; top: .45rem; width: 4px; height: 8px; border: solid var(--ok); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.lp-doc { position: relative; margin: 0; padding: 1.6rem 1.6rem 1.4rem; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px rgba(14,26,51,.28); transform: rotate(1deg); max-width: 400px; justify-self: center; width: 100%; }
.lp-doc figcaption { position: absolute; top: -11px; right: 1rem; background: var(--purple-50); color: var(--purple-600); font-size: .74rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--purple-100); }
.lp-doc-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; margin: 0 0 .1rem; }
.lp-doc-sub { color: var(--muted); font-size: .82rem; margin: 0 0 .9rem; }
.lp-doc-row { display: flex; justify-content: space-between; padding: .4rem 0; border-top: 1px solid var(--line-2); font-size: .88rem; }
.lp-doc-row strong { font-variant-numeric: tabular-nums; }
.lp-doc-h { font-weight: 650; font-size: .84rem; margin: 1rem 0 .4rem; }
.lp-doc-line { height: 7px; border-radius: 4px; background: var(--line-2); margin: .35rem 0; }
.lp-doc-line.short { width: 62%; }
.lp-faq .faq { max-width: 780px; margin: 0 auto; }
.lp-band { margin-bottom: 0; }
@media (max-width: 960px) {
  .lp-steps { grid-template-columns: 1fr; }
  .lp-split { grid-template-columns: 1fr; padding: 1.4rem; gap: 1.8rem; }
}
.topbar-right .btn + .btn { margin-left: 0; }
@media (max-width: 520px) { .topbar-right .btn.purple { display: none; } }
/* ---------- simulation landing page ---------- */
.sim-page { background: var(--bg); }
.sim-page .topbar { border-bottom: 1px solid var(--line); background: #fff; }
.sim-page .wrap { margin: 0 auto; padding-top: 2rem; }
.sim-card { text-align: center; padding: 2rem 1.6rem; border-top: 4px solid var(--ok); }
.sim-card h1 { max-width: 24ch; margin: 0 auto .6rem; }
.sim-card .lede { color: var(--ink-2); max-width: 54ch; margin: 0 auto; font-size: 1.04rem; }
.sim-badge { width: 60px; height: 60px; margin: 0 auto .9rem; border-radius: 50%; display: grid; place-items: center; background: var(--ok-50); color: var(--ok); }
.sim-badge svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sim-self { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--card-2); box-shadow: none; }
.result-list li::before { display: grid; place-items: center; font-weight: 800; font-size: .78rem; line-height: 1; }
.result-list li.ok::before { content: "✓"; color: var(--ok); }
.result-list li.miss::before { content: "✕"; color: var(--bad); }
.result-list li.flag { border-color: #f1d6b0; }
.result-list li.flag::before { content: "!"; color: var(--warn); background: var(--warn-50); box-shadow: inset 0 0 0 2px var(--warn); }
.result-list li.plain::before { content: counter(list-item); color: var(--purple-600); background: var(--purple-50); box-shadow: none; }
.flash { display: block; }
.flash a { white-space: nowrap; }
@media (max-width: 720px) {
  .table-stack td.cell-main, .card-flush .table-stack td.cell-main:first-child { display: block; text-align: left; }
  .table-stack td.actions, .card-flush .table-stack td.actions:last-child { justify-content: flex-end; }
  .table-stack td[data-label] > .sub, .table-stack td[data-label] > .pill-row { text-align: right; }
}
.narrow-720.m-0, .narrow-420.m-0 { margin-left: 0; margin-right: 0; }
.acc-pad { padding: 1rem 1.1rem; } .acc > summary:has(.acc-pills:empty) { grid-template-columns: minmax(0, 1fr) auto; } .acc-pills:empty { display: none; }
.card { min-width: 0; overflow-wrap: break-word; }
.checklist li, .checklist code { overflow-wrap: anywhere; }
@media (max-width: 720px) { .checklist-2col { columns: 1; } }
@media (max-width: 960px) { .lp-hero { grid-template-columns: minmax(0, 1fr); } .lp-visual .demo-mail { max-width: 100%; } }
@media (max-width: 960px) { .lp-visual .demo-mail, .lp-doc { transform: none; } .lp-visual::before { inset: 0; } }

/* ===== 2.0 R7 fix round: Security Center body, auth pages, field errors, print ===== */
/* Security Center: full-width cards in the host grid, sub-headings, code lists. */
.sc-span { grid-column: 1 / -1; }
.sc-subhead { font-size: .92rem; margin: 1.1rem 0 .45rem; color: var(--ink-2); }
.code-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .88rem; }
.code-list li { margin: 0; overflow-wrap: anywhere; }
.code-list code, code.chip { font-size: .8rem; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 6px; padding: .05rem .4rem; overflow-wrap: anywhere; }
code.chip { display: inline-block; margin: 0 .15rem .25rem 0; }
td code.sub { display: block; margin-top: .2rem; font-size: .76rem; color: var(--muted); background: none; border: 0; padding: 0; }
.finding-more { margin-top: .45rem; }
.finding-more summary { font-size: .84rem; font-weight: 600; color: var(--purple-600); cursor: pointer; }
.finding-detail { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 8px; padding: .6rem .75rem; margin: .5rem 0; max-width: 72ch; max-height: 18rem; overflow: auto; }
.sc-kv { margin-top: .4rem; }
.note.bad .code-list code { background: #fff; }
.edr-agents { margin-bottom: .5rem; }
.status-main .status-action { margin-left: auto; }

/* Auth pages: fields grouped like every other form. */
.auth-fields .field { margin-bottom: .95rem; }
.auth-fields .field > input, .auth-fields .field > select { width: 100%; }
.auth-fields .field-row .field { margin-bottom: .95rem; }
.auth-note { text-align: center; margin: 1.1rem 0 0; }
.auth .kicker { margin-bottom: .25rem; }

/* Server-side field errors (aware/forms.py): always visible, next to the field. */
.field-error.is-server { display: block; }
.field-error.is-server ~ .field-error { display: none; }
[aria-invalid="true"] { border-color: var(--bad) !important; box-shadow: 0 0 0 3px var(--bad-50); }
.form-errors { margin-bottom: 1rem; }
.form-errors ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.form-errors li { margin: .1rem 0; }

/* Error pages. */
.error-card .empty-ico { margin: .2rem auto .9rem; }
.error-card h1 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.75rem); margin: 0 0 .4rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.2rem; }
.error-actions .btn + .btn { margin-left: 0; }
.error-ref { margin: 1.1rem 0 0; }
@media (max-width: 720px) {
  .error-card { margin: 1.25rem auto; padding: 1.8rem 1.1rem; }
  .error-actions .btn { flex: 1 1 100%; }
}

/* Learner home: on phones the "Up next" card already shows the first assignment. */
@media (max-width: 720px) { .lesson-row.same-as-next { display: none; } }

/* Failed-payment banner. */
.flash.flash-bad { background: var(--bad-50); border-color: #f1c7c2; color: #7d1f17; }

/* Printing: every record of the evidence pack, no buttons or tab bars. */
@media print {
  .page-actions, .tabs, .card-head-actions, .acc-toggle, .flash-stack, [data-print] { display: none !important; }
  [data-tab-panel][hidden] { display: block !important; }
  [data-print-expand] details > *, [data-print-expand] details::details-content { display: block; content-visibility: visible; }
  .card, .acc { break-inside: avoid-page; border-color: #bbb; }
  a[href^="http"]::after { content: ""; }
}
@media (max-width: 720px) {
  /* Stacked cells holding lists or long text: label above, value below. */
  .table-stack td.td-block { display: block; text-align: left; }
  .table-stack td.td-block::before { display: block; margin-bottom: .2rem; }
  .table-stack td.td-block code.chip { white-space: normal; }
}
@media (max-width: 720px) {
  .table-stack td.td-block .sub { text-align: left; }
  .sc-kv { grid-template-columns: 1fr; gap: .15rem; }
  .sc-kv dd { margin-bottom: .6rem; }
}

/* ---------- UX review follow-ups ---------- */
/* Staff progress: a person's lessons open as a full-width detail row under their line (finding 14). */
tr.row-detail > td { padding: 0 .75rem .9rem; background: var(--card-2); }
tr.row-detail[hidden] { display: none; }
tr.row-detail .table-compact { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.row-toggle { appearance: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: .3rem .6rem; font: 600 .8rem var(--font); color: var(--ink-2); cursor: pointer; }
.row-toggle:hover { border-color: var(--purple); color: var(--purple-600); }
.row-toggle[aria-expanded="true"] { background: var(--purple-50); border-color: var(--purple); color: var(--purple-600); }
th[aria-sort] button.sort { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; }
th[aria-sort="ascending"] button.sort::after { content: " \2191"; }
th[aria-sort="descending"] button.sort::after { content: " \2193"; }
/* Bulk assignment: name, second line and a state pill on one row. */
.choice-row { gap: .6rem; }
.choice-row .choice-text { display: flex; flex-direction: column; line-height: 1.25; }
.choice-row .choice-text small { margin: 0; }
.choice-pill { margin-left: auto; flex: none; }
fieldset.field { padding: .6rem .8rem .3rem; margin: .8rem 0; }
fieldset.field legend.label { font-weight: 600; font-size: .86rem; color: var(--ink-2); padding: 0 .3rem; }
fieldset.field .choice { align-items: flex-start; }
fieldset.field .choice input { margin-top: .2rem; }
fieldset.field .choice small { display: block; margin: .15rem 0 0; }
/* Risk trend: axis labels and the first/last values. */
.spark-wrap { position: relative; }
.spark-axis { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: .3rem; }
.spark-ends { display: flex; justify-content: space-between; font-size: .84rem; margin-top: .15rem; }
.spark-ends strong { font-family: var(--font-display); }
.risk-spark text { font: 600 9px var(--font); fill: var(--muted); }
/* The lesson table inside a detail row stays a real table on phones too. */
.row-detail .table-compact { display: table; width: 100%; }
.row-detail .table-compact thead { display: table-header-group; }
.row-detail .table-compact tbody { display: table-row-group; }
.row-detail .table-compact tr { display: table-row; border: 0; padding: 0; margin: 0; }
.row-detail .table-compact td, .row-detail .table-compact th { display: table-cell; width: auto; }
.row-detail .table-wrap { overflow-x: auto; }

/* ---- Passkeys (2.2) ---- */
.passkey-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .6rem 0 0; }
.passkey-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.passkey-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line-2); }
.passkey-list li:first-child { border-top: 0; }
.passkey-list strong { display: block; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.passkey-list small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.passkey-list .passkey-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.passkey-list .passkey-remove { grid-column: 1 / -1; }
.passkey-list .passkey-remove .acc { margin: .2rem 0 0; box-shadow: none; }
.passkey-list .passkey-actions form { display: inline; }
.passkey-list .passkey-actions input[name=nickname] { width: 9rem; padding: .35rem .5rem; font-size: .85rem; }
.passkey-choice { display: grid; gap: .6rem; margin: 0 0 1rem; }
.passkey-choice .btn svg { width: 20px; height: 20px; margin-right: .4rem; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.factor-rule { font-size: .88rem; color: var(--ink-2); background: var(--purple-50); border-radius: 10px; padding: .6rem .8rem; margin: 0 0 1rem; }
@media (max-width: 640px) { .passkey-list li { grid-template-columns: 1fr; } .passkey-list .passkey-actions { justify-content: flex-start; } }

/* Planned-maintenance notice (aware.maintenance): every page, signed in or not. */
.maint-banner {
  background: var(--card, #fff); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--warn);
  padding: .75rem 1rem; border-radius: var(--r); margin: 0 0 1rem; box-shadow: var(--shadow); font-weight: 500;
}
.maint-banner p { margin: 0; }
.maint-banner--now { border-left-color: var(--bad); }

/* ---------- dashboard: training at a glance (2.5) ---------- */
.glance-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.4rem; align-items: center; }
.rings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; }
.ring { display: grid; justify-items: center; text-align: center; gap: .25rem; }
.ring svg { width: 112px; height: 112px; }
.ring-track { stroke: var(--line, #dfe5ee); }
.ring-fill { stroke: var(--brand, #355f82); }
.ring.tone-good .ring-fill { stroke: #27a36c; }
.ring.tone-mid .ring-fill { stroke: #6f4f93; }
.ring.tone-low .ring-fill { stroke: #d4932b; }
.ring-pct { font: 700 22px/1 inherit; fill: var(--ink, #14223a); font-family: inherit; }
.trend { margin: 0; }
.trend svg { width: 100%; height: auto; display: block; margin-top: .4rem; }
.trend-area { fill: rgba(111, 79, 147, .14); }
.trend-line { stroke: #6f4f93; }
.trend-dot { fill: #6f4f93; stroke: #fff; stroke-width: 1.5; }
@media (max-width: 760px) { .glance-grid { grid-template-columns: 1fr; } }

/* ---------- certificate shelf on the learner's page (2.5) ---------- */
.shelf { list-style: none; margin: .9rem 0 0; padding: .8rem 0 0; border-top: 1px solid var(--line, #dfe5ee); display: grid; gap: .6rem; }
.medal { display: flex; align-items: center; gap: .7rem; }
.medal svg { width: 34px; height: 42px; flex: none; }
.medal span { display: grid; line-height: 1.25; }
.medal small { color: var(--muted, #5d6b82); }
.medal-ribbon { fill: #c9d1de; } .medal-disc { fill: #e3e8f0; } .medal-ring { stroke: #c9d1de; } .medal-mark { stroke: #8e9ab0; } .medal-lock { fill: #8e9ab0; }
.medal.is-earned .medal-disc { fill: #6f4f93; } .medal.is-earned .medal-ring { stroke: #b69bd3; } .medal.is-earned .medal-mark { stroke: #fff; }
.medal.is-earned .medal-ribbon { fill: #355f82; }
.medal-tone-2.is-earned .medal-disc { fill: #27a36c; } .medal-tone-2.is-earned .medal-ribbon { fill: #1c7a50; }
.medal-tone-3.is-earned .medal-disc { fill: #d4932b; } .medal-tone-3.is-earned .medal-ribbon { fill: #a8711a; }

/* Platform: lesson pictures */
.cover-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px;margin-top:16px}
.cover-card{padding:14px;display:flex;flex-direction:column;gap:10px}
.cover-card img{width:100%;height:auto;border-radius:10px;display:block}
.cover-card h3{font-size:.98rem;margin:0}
.cover-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.cover-form input[type=file]{max-width:100%;font-size:.85rem}

/* ---------- 2.9: tap targets and narrow screens ---------- */
/* Targets at least 24 px (WCAG 2.2, 2.5.8); breadcrumb links get 32 px of height through padding. */
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; padding: .25rem .2rem; border-radius: 6px; }
input[type=checkbox], input[type=radio] { width: 24px; height: 24px; vertical-align: -6px; flex: none; }
label.choice { min-height: 32px; }
/* A mock email never runs off a phone screen: long senders, addresses and subjects wrap. */
.mail-meta { min-width: 0; }
.mail-subject, .mail-meta strong, .mail-meta .muted { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .mail-read { padding: .9rem; min-width: 0; }
  .mail-subject { font-size: 1.1rem; }
}

/* 2.9.1 (minor 19): banners with a server-side dismiss button. */
.banner-dismiss { margin-left: auto; flex: none; }
.banner-dismiss form { margin: 0; display: inline; }

/* 2.9.1 (minor 15): the new-campaign form reads 1, 2, 3 in order on a phone; on wide screens step 3 sits under
   step 1 and the recipient list spans both rows. */
@media (min-width: 961px) {
  .campaign-form .campaign-step-2 { grid-row: span 2; }
}

/* 2.9.1 (minor 21): tap targets on the sign-in pages are at least 32px tall (WCAG 2.2 asks for 24px). */
body.auth .label-row a, body.auth .auth-switch a, body.auth .auth-foot a, body.auth .footer-links a,
body.auth .auth-inner p > a, body.auth .choice a {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 .25rem;
}
body.auth .footer-links { display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
body.auth .choice a { min-height: 24px; padding: 0 .1rem; }

/* ---------- 2.9.2 (QA cosmetics) ---------- */
/* A long legend (the sign-up's health-information question) wraps inside its box, not across the top border. */
fieldset.field > legend { float: left; width: 100%; padding: 0; margin: 0 0 .45rem; font-weight: 600; line-height: 1.4; }
fieldset.field > legend + * { clear: left; }
/* List bullets are small dots, not hollow circles that read as radio buttons. */
.quiz-rules li { padding-left: 1.25rem; }
.quiz-rules li::before { top: .55em; left: .3rem; width: 7px; height: 7px; background: var(--purple); box-shadow: none; }
/* Nothing on a form may widen the page at phone width: grid children may shrink, long options and addresses wrap. */
.split > *, .campaign-form > * { min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
.choice { min-width: 0; flex-wrap: wrap; }
.choice small { overflow-wrap: anywhere; min-width: 0; }
.campaign-form code, .card p code { overflow-wrap: anywhere; }
/* Inline links and small text controls get at least a 24px-tall target (WCAG 2.5.8). */
.note a, .flash a, .hint a, .card-foot-note a, .check-tools a, .lede a, td a, .kv a, p.small a, .muted a {
  display: inline-block; min-height: 24px; line-height: 24px; }
.link-btn { min-height: 24px; }
/* Sortable table headers: a real target height. */
th[aria-sort] button.sort { min-height: 32px; padding: .2rem 0; text-align: inherit; }

/* ---------- 2.9.3 (QA M-6 / M-9) ---------- */
/* Disclosure summaries ("3 recent", "Show ...") and their small text get a 24px-tall target. */
details > summary { min-height: 24px; line-height: 24px; }
summary.small { display: list-item; min-height: 24px; line-height: 24px; }
/* DNS values (TXT @ aware-verify=...) wrap on a phone instead of being cut off. */
td code, .table-stack code, .code-sm { overflow-wrap: anywhere; word-break: break-all; white-space: normal; }
/* A select never runs past its card; its options are kept short in the templates. */
.field select { width: 100%; min-width: 0; }

/* ---------- 2.9.4 (QA m1): tap targets of at least 24px with a margin for rounding ---------- */
/* Banner links, small inline links and disclosure summaries measured 22-23.9px in Chromium: 26px leaves room. */
.note a, .flash a, .hint a, .card-foot-note a, .check-tools a, .lede a, td a, .kv a, p.small a, .muted a {
  min-height: 26px; line-height: 26px; }
details > summary, summary.small, .finding-more summary { min-height: 26px; line-height: 26px; }
/* Landing page and footer links outside buttons (some were 16px tall). */
.lp a:not(.btn), .lp-note a, .lp-trust a, .faq a, .footer-links a {
  display: inline-block; min-height: 26px; line-height: 26px; }
