:root {
  /* Dark web3 premium palette. Token names are unchanged so the whole
     stylesheet re-skins from here; a theme layer at the end of this file
     handles the surfaces that hardcode light colors. */
  --bg: #05070d;
  --bg-2: #080b14;
  --paper: #0b0f1a;
  --paper-strong: #111726;
  --paper-elevated: #151d30;
  --ink: #eef2fb;
  --ink-dim: #cdd7ec;
  --muted: #93a2c2;
  --line: rgba(150, 172, 216, 0.14);
  --line-strong: rgba(150, 172, 216, 0.30);
  --green: #35e6c0;
  --green-soft: rgba(53, 230, 192, 0.13);
  --blue: #7f9dff;
  --blue-soft: rgba(127, 157, 255, 0.14);
  --amber: #f6c15a;
  --amber-soft: rgba(246, 193, 90, 0.14);
  --coral: #ff8474;
  --coral-soft: rgba(255, 132, 116, 0.14);
  --plum: #b49cff;
  --plum-soft: rgba(180, 156, 255, 0.15);
  --cyan: #38d7f0;
  --graphite: #0c1420;
  --glass: rgba(19, 26, 43, 0.66);
  --glass-strong: rgba(23, 31, 51, 0.86);
  --panel: rgba(19, 26, 43, 0.66);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --glow-teal: 0 0 0 1px rgba(53, 230, 192, 0.18), 0 18px 50px rgba(53, 230, 192, 0.12);
  --radius: 12px;
}

::selection {
  background: rgba(53, 230, 192, 0.28);
  color: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(53, 230, 192, 0.12), transparent 60%),
    radial-gradient(1000px 640px at 8% 4%, rgba(127, 157, 255, 0.12), transparent 62%),
    radial-gradient(900px 700px at 50% 118%, rgba(180, 156, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background:
    repeating-linear-gradient(90deg, rgba(150, 172, 216, 0.05) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg, rgba(150, 172, 216, 0.04) 0 1px, transparent 1px 120px);
  mask-image: radial-gradient(120% 100% at 50% 0%, #000 40%, transparent 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 20, 32, 0.92);
  color: #f7fbff;
  box-shadow: 0 12px 40px rgba(16, 24, 32, 0.16);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--green) 0 33%, transparent 34%),
    linear-gradient(315deg, var(--blue) 0 33%, transparent 34%),
    linear-gradient(45deg, var(--amber) 0 22%, transparent 23%),
    #f8fbff;
  box-shadow: inset 0 0 0 1px rgba(12, 20, 32, 0.08), 0 0 22px rgba(8, 169, 196, 0.22);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.top-nav a,
.lesson-index a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.top-nav a {
  color: #bed0df;
}

.top-nav a:hover,
.top-nav a[aria-current="page"],
.lesson-index a:hover {
  color: var(--ink);
  background: var(--paper-strong);
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.author-strip {
  position: sticky;
  top: 63px;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 28px;
  border-bottom: 1px solid rgba(174, 191, 181, 0.5);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.08);
  backdrop-filter: blur(16px);
}

.author-strip-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.author-avatar,
.creator-photo {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(0, 159, 134, 0.2), rgba(51, 95, 246, 0.18)),
    #ffffff;
  color: #0c1420;
  font-weight: 860;
}

.author-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 159, 134, 0.32);
}

.author-avatar img,
.creator-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar span,
.creator-photo span {
  display: none;
}

.author-avatar.fallback span,
.creator-photo.fallback span {
  display: block;
}

.author-strip-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.author-strip-copy small,
.author-strip-line {
  color: var(--muted);
  font-size: 0.84rem;
}

.author-strip-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-strip-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(51, 95, 246, 0.28);
  border-radius: 999px;
  background: var(--blue-soft);
  color: #203db4;
  font-size: 0.88rem;
  font-weight: 780;
}

.author-strip-link svg {
  width: 16px;
  height: 16px;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.84fr);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 63px);
  padding: 72px 7vw 46px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(220, 248, 240, 0.44)),
    repeating-linear-gradient(135deg, rgba(51, 95, 246, 0.06) 0 1px, transparent 1px 22px);
}

.intro-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 780;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 900px;
  font-size: 3.05rem;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.intro-copy > p:not(.eyebrow),
.section-heading p,
.lesson-hero > p,
.course-card p {
  color: var(--muted);
}

.intro-copy > p:not(.eyebrow) {
  max-width: 680px;
  margin: 22px 0 0;
  font-size: 1.08rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 760;
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(24, 32, 27, 0.08);
}

.button.primary {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: white;
  box-shadow: 0 12px 28px rgba(0, 159, 134, 0.22);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.icon-button {
  width: 42px;
  padding: 0;
  border-color: var(--line);
}

.button svg,
.icon-button svg,
.feature-list svg,
.back-link svg,
.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.system-map {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(34px, 0.22fr) minmax(0, 1fr) minmax(34px, 0.22fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.map-node {
  min-width: 0;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.map-node span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
  text-transform: uppercase;
}

.map-node strong {
  font-size: 1.02rem;
  line-height: 1.25;
}

.map-node.merchant {
  border-top: 4px solid var(--amber);
}

.map-node.edge {
  border-top: 4px solid var(--blue);
}

.map-node.engine {
  border-top: 4px solid var(--green);
}

.map-node.active-map-node {
  border-color: rgba(47, 111, 228, 0.44);
  box-shadow: 0 12px 28px rgba(47, 111, 228, 0.12);
}

.map-connector {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.map-connector span {
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--coral), transparent);
  animation: packet 2200ms ease-in-out infinite;
}

.map-caption {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

.master-map-band {
  padding: 56px 7vw;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.master-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 42px rgba(24, 32, 27, 0.08);
}

.master-flowline {
  position: absolute;
  top: 44px;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.master-flowline span {
  position: absolute;
  inset: 0 auto 0 -18%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--green), var(--blue), transparent);
  animation: masterPacket 3600ms ease-in-out infinite;
}

.master-column {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.master-column h3 {
  min-height: 30px;
  padding: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  text-transform: uppercase;
}

.master-node {
  min-width: 0;
  min-height: 98px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top-width: 4px;
  border-radius: 8px;
  background: var(--paper-strong);
}

.master-node.product {
  border-top-color: var(--blue);
}

.master-node.risk {
  border-top-color: var(--plum);
}

.master-node.adapter {
  border-top-color: var(--amber);
}

.master-node.ledger {
  border-top-color: var(--green);
}

.master-node.core {
  border-color: rgba(22, 116, 102, 0.52);
  border-top-color: var(--green);
  box-shadow: 0 12px 30px rgba(22, 116, 102, 0.12);
}

.master-node strong,
.master-node span {
  display: block;
}

.master-node span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.master-map-note {
  max-width: 980px;
  margin: 18px 0 0;
  color: var(--muted);
}

.canonical-band {
  padding: 56px 7vw;
  border-bottom: 1px solid var(--line);
}

.canonical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.canonical-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.canonical-card:hover {
  border-color: rgba(22, 116, 102, 0.38);
  background: var(--green-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(24, 32, 27, 0.08);
}

.canonical-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.canonical-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.course-band,
.compare-band {
  padding: 56px 7vw;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading.compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.section-heading p:last-child {
  margin-bottom: 0;
}

.section-heading.compact > .eyebrow,
.section-heading.compact > h2,
.section-heading.compact > p {
  grid-column: 1;
}

.section-toggle {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(174, 191, 181, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 780;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.section-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 159, 134, 0.42);
  background: var(--green-soft);
  color: #075c4f;
}

.section-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 180ms ease;
}

.foldable-ready:not(.is-collapsed) .section-toggle svg {
  transform: rotate(180deg);
}

.foldable-body {
  display: block;
}

.foldable-ready.is-collapsed .foldable-body {
  display: none;
}

.foldable-ready.is-collapsed {
  padding-bottom: 18px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.course-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 430px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.course-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.course-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.course-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 780;
}

.course-kicker.external {
  color: #174276;
  background: var(--blue-soft);
}

.course-kicker.internal {
  color: #0e5e52;
  background: var(--green-soft);
}

.course-kicker.risk {
  color: #5b3b8f;
  background: var(--plum-soft);
}

.course-kicker.cards {
  color: #7a4507;
  background: var(--amber-soft);
}

.course-kicker.kyc {
  color: #174276;
  background: var(--blue-soft);
}

.course-kicker.ops {
  color: #8b332b;
  background: var(--coral-soft);
}

.course-kicker.controls {
  color: #5b3b8f;
  background: var(--plum-soft);
}

.course-kicker.testing {
  color: #174276;
  background: var(--blue-soft);
}

.course-kicker.money {
  color: #0e5e52;
  background: var(--green-soft);
}

.course-kicker.adapter {
  color: #174276;
  background: var(--blue-soft);
}

.course-kicker.fiat {
  color: #0e5e52;
  background: var(--green-soft);
}

.course-kicker.playbook {
  color: #7a4507;
  background: var(--amber-soft);
}

.course-kicker.security {
  color: #8b332b;
  background: var(--coral-soft);
}

.course-kicker.events {
  color: #5b3b8f;
  background: var(--plum-soft);
}

.course-kicker.model {
  color: #0e5e52;
  background: var(--green-soft);
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
}

.feature-list svg {
  margin-top: 3px;
  color: var(--green);
}

.comparison-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-strong);
}

.comparison-row {
  display: grid;
  grid-template-columns: 0.8fr 1.15fr 1.15fr;
  border-top: 1px solid var(--line);
}

.comparison-row:first-child {
  border-top: 0;
}

.comparison-row > div {
  padding: 15px;
  border-left: 1px solid var(--line);
}

.comparison-row > div:first-child {
  border-left: 0;
}

.comparison-row.header {
  color: var(--muted);
  background: #edf0e9;
  font-weight: 780;
}

.lesson-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.lesson-index {
  position: sticky;
  top: 63px;
  min-height: calc(100vh - 63px);
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(232, 237, 255, 0.38)),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(0, 159, 134, 0.045) 34px 35px);
  backdrop-filter: blur(14px);
}

.lesson-index nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.lesson-index a {
  width: 100%;
}

.back-link {
  font-weight: 760;
}

.lesson-content {
  min-width: 0;
  padding: 0 0 56px;
}

.lesson-hero {
  position: relative;
  overflow: hidden;
  padding: 68px 7vw 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(12, 20, 32, 0.96), rgba(13, 46, 61, 0.92) 52%, rgba(38, 30, 77, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 72px);
  color: #f8fbff;
}

.lesson-hero::after {
  content: "";
  position: absolute;
  inset: auto 7vw 0 auto;
  width: min(520px, 44vw);
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber), var(--coral));
  opacity: 0.9;
}

.lesson-hero h1 {
  max-width: 820px;
}

.lesson-hero > p {
  max-width: 760px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  color: #cfe1e4;
}

.lesson-hero .eyebrow {
  color: #7ee6d2;
}

.guidance-panel {
  margin: 24px 7vw 0;
}

.guidance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto;
  gap: 14px;
  align-items: start;
}

.guidance-card,
.info-balloon {
  min-width: 0;
  border: 1px solid rgba(174, 191, 181, 0.68);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(16, 24, 32, 0.08);
  backdrop-filter: blur(12px);
}

.guidance-card {
  padding: 18px;
}

.guidance-card.primary {
  border-top: 4px solid var(--green);
}

.guidance-card.linked {
  border-top: 4px solid var(--blue);
}

.guidance-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.guidance-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.guidance-links {
  display: grid;
  gap: 8px;
}

.guidance-links a {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 248, 242, 0.72);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.guidance-links a:hover {
  border-color: rgba(47, 111, 228, 0.42);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.guidance-links span {
  color: var(--muted);
  font-size: 0.9rem;
}

.guidance-hint {
  display: flex;
  justify-content: flex-end;
}

.hint-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 5;
}

.hint-trigger {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(201, 121, 8, 0.4);
  border-radius: 999px;
  background: var(--amber-soft);
  color: #7a4507;
  font-weight: 820;
  line-height: 1;
}

.hint-trigger:hover,
.hint-trigger:focus-visible {
  border-color: rgba(201, 121, 8, 0.72);
  background: #fff8e7;
  outline: 0;
}

.hint-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(330px, calc(100vw - 44px));
  padding: 12px;
  border: 1px solid rgba(201, 121, 8, 0.32);
  border-radius: 8px;
  background: #fff8e7;
  box-shadow: 0 14px 32px rgba(24, 32, 27, 0.14);
  color: #5f3a05;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.hint-card strong,
.hint-card span {
  display: block;
}

.hint-card strong {
  margin-bottom: 4px;
  color: #4f3105;
}

.hint-anchor.align-left .hint-card {
  right: auto;
  left: 0;
}

.hint-anchor:hover .hint-card,
.hint-anchor:focus-within .hint-card {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.info-balloon {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  padding: 16px;
  border-color: rgba(201, 121, 8, 0.32);
  background: var(--amber-soft);
}

.info-balloon p {
  margin: 0;
  color: #5f3a05;
}

.info-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--paper-strong);
  color: #7a4507;
  font-weight: 820;
}

.lesson-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.lesson-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #cfe1e4;
  backdrop-filter: blur(10px);
}

.lesson-stats strong {
  color: #ffffff;
}

.lab-section,
.tool-section,
.reference-band,
.glossary-section,
.provider-section {
  margin: 34px 7vw 0;
  padding: 24px;
  border: 1px solid rgba(174, 191, 181, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 250, 0.78)),
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(0, 159, 134, 0.03) 48px 49px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.provider-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(232, 237, 255, 0.38)),
    repeating-linear-gradient(135deg, transparent 0 40px, rgba(51, 95, 246, 0.045) 40px 41px);
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.provider-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 230px;
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 246, 0.9));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.provider-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 228, 0.38);
  background: var(--blue-soft);
  box-shadow: 0 12px 28px rgba(24, 32, 27, 0.08);
}

.provider-label {
  width: fit-content;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #0e5e52;
  font-size: 0.76rem;
  font-weight: 820;
  text-transform: uppercase;
}

.provider-card p,
.provider-card small {
  margin: 0;
  color: var(--muted);
}

.provider-card small {
  font-size: 0.86rem;
}

.provider-link {
  align-self: end;
  margin-top: auto;
  color: var(--green);
  font-weight: 780;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.58fr);
  gap: 26px;
  align-items: center;
  min-height: calc(100vh - 64px);
  padding: 74px 7vw 46px;
  background:
    linear-gradient(135deg, rgba(12, 20, 32, 0.96), rgba(13, 46, 61, 0.92) 54%, rgba(38, 30, 77, 0.9)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 82px);
  color: #f8fbff;
}

.profile-hero .eyebrow {
  color: #7ee6d2;
}

.profile-hero-copy {
  max-width: 940px;
}

.profile-hero-copy p:not(.eyebrow) {
  max-width: 820px;
  color: #cfe1e4;
  font-size: 1.08rem;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.profile-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)),
    repeating-linear-gradient(135deg, transparent 0 34px, rgba(255, 255, 255, 0.06) 34px 35px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}

.profile-photo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 138px;
  height: 138px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(0, 159, 134, 0.28), rgba(51, 95, 246, 0.22)),
    rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 3rem;
  font-weight: 860;
}

.profile-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo span {
  display: none;
}

.profile-photo.fallback span {
  display: block;
}

.profile-card h2,
.profile-card p {
  margin: 0;
}

.profile-card p {
  color: #cfe1e4;
}

.profile-proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-proof-grid span {
  display: grid;
  gap: 2px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #bed0df;
}

.profile-proof-grid strong {
  color: #ffffff;
  font-size: 1.3rem;
}

.profile-band {
  padding: 56px 7vw 0;
}

.service-grid,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.service-card,
.note-card,
.admin-card {
  min-width: 0;
  border: 1px solid rgba(174, 191, 181, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 246, 0.8)),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(0, 159, 134, 0.035) 44px 45px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.service-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 250px;
  padding: 18px;
}

.service-card span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #0c1420;
  color: #9ef2df;
  font-weight: 820;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}

.profile-proof-band {
  padding-top: 64px;
}

.proof-timeline {
  display: grid;
  gap: 12px;
}

.proof-timeline article {
  display: grid;
  grid-template-columns: 160px minmax(0, 0.46fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.proof-timeline span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.proof-timeline p {
  margin: 0;
  color: var(--muted);
}

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.notes-toolbar span {
  color: var(--muted);
}

.note-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 330px;
  padding: 16px;
}

.note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.note-meta span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #075c4f;
  font-weight: 780;
}

.note-card p,
.note-card summary {
  color: var(--muted);
}

.note-card p {
  margin: 0;
}

.note-card summary {
  cursor: pointer;
  font-weight: 780;
}

.note-card details p {
  margin-top: 8px;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.note-tags li {
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(232, 237, 255, 0.78);
  color: #263fa8;
  font-size: 0.78rem;
  font-weight: 780;
}

.profile-cta {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(12, 20, 32, 0.96), rgba(13, 46, 61, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 72px);
  color: #f8fbff;
}

.profile-cta .eyebrow {
  color: #7ee6d2;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.4fr);
  gap: 18px;
  align-items: start;
  padding: 48px 7vw;
}

.admin-card {
  padding: 20px;
}

.is-hidden {
  display: none !important;
}

.note-form,
.note-form label {
  display: grid;
  gap: 8px;
}

.note-form {
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
  gap: 12px;
}

.note-form input,
.note-form textarea,
.note-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(174, 191, 181, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.note-form textarea {
  min-height: 110px;
  resize: vertical;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
  min-height: 0;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid rgba(0, 159, 134, 0.28);
  border-radius: 8px;
  background: var(--green-soft);
  color: #075c4f;
  font-weight: 780;
}

.form-status {
  min-height: 28px;
  margin: 0;
  color: var(--muted);
}

.form-status.success {
  color: #075c4f;
}

.form-status.error {
  color: #8f2f23;
}

.admin-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.wizard-band {
  padding: 58px 7vw 24px;
}

.creator-band {
  padding: 34px 7vw 0;
}

.creator-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(280px, 0.5fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(174, 191, 181, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(220, 248, 240, 0.54)),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(51, 95, 246, 0.04) 44px 45px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.creator-photo-wrap {
  display: grid;
  place-items: center;
}

.creator-photo {
  width: clamp(112px, 14vw, 170px);
  height: clamp(112px, 14vw, 170px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(0, 159, 134, 0.3),
    0 18px 42px rgba(16, 24, 32, 0.16);
  font-size: clamp(2rem, 5vw, 3.7rem);
}

.creator-copy {
  min-width: 0;
}

.creator-copy h2 {
  max-width: 820px;
}

.creator-copy > p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
}

.creator-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.creator-tags span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(232, 237, 255, 0.82);
  color: #263fa8;
  font-size: 0.84rem;
  font-weight: 780;
}

.creator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.creator-proof {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(12, 20, 32, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 20, 32, 0.94), rgba(17, 31, 45, 0.9)),
    repeating-linear-gradient(135deg, transparent 0 34px, rgba(255, 255, 255, 0.06) 34px 35px);
  color: #f8fbff;
}

.creator-proof span {
  color: #7ee6d2;
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.creator-proof p {
  margin: 0;
  color: #cfe1e4;
}

.wizard-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(174, 191, 181, 0.68);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 237, 255, 0.46)),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(0, 159, 134, 0.04) 42px 43px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.wizard-column,
.wizard-results {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.wizard-step,
.wizard-results {
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.wizard-step-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.persona-grid {
  display: grid;
  gap: 10px;
}

.persona-option {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 78px;
  padding: 13px;
  border: 1px solid rgba(174, 191, 181, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.persona-option:hover,
.persona-option.active {
  transform: translateY(-1px);
  border-color: rgba(0, 159, 134, 0.42);
  background:
    linear-gradient(135deg, rgba(220, 248, 240, 0.9), rgba(232, 237, 255, 0.68));
  box-shadow: 0 10px 24px rgba(16, 24, 32, 0.08);
}

.persona-option span {
  font-weight: 820;
}

.persona-option small {
  color: var(--muted);
}

.need-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.need-option {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(174, 191, 181, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 780;
}

.need-option:hover,
.need-option.active {
  border-color: rgba(51, 95, 246, 0.38);
  background: var(--blue-soft);
  color: #203db4;
}

.wizard-results {
  position: sticky;
  top: 88px;
}

.wizard-result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wizard-result-topline span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(232, 237, 255, 0.78);
  color: #263fa8;
  font-size: 0.8rem;
  font-weight: 780;
}

.wizard-results > p {
  margin: 0;
  color: var(--muted);
}

.wizard-path {
  display: grid;
  gap: 9px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.wizard-path-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 246, 0.92));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.wizard-path-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 159, 134, 0.38);
  box-shadow: 0 10px 24px rgba(16, 24, 32, 0.08);
}

.path-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #0c1420;
  color: #9ef2df;
  font-weight: 820;
}

.path-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.path-group {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 820;
  text-transform: uppercase;
}

.path-body > span:not(.path-group),
.path-body small {
  color: var(--muted);
}

.path-body small {
  font-size: 0.82rem;
}

.wizard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-filter-status {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  margin-top: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(0, 159, 134, 0.28);
  border-radius: 999px;
  background: var(--green-soft);
  color: #075c4f;
  font-size: 0.86rem;
  font-weight: 780;
}

.course-card.filtered-out {
  display: none;
}

.glossary-console {
  display: grid;
  gap: 14px;
}

.glossary-search {
  max-width: 420px;
}

.glossary-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.glossary-tags button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(174, 191, 181, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 780;
}

.glossary-tags button.active,
.glossary-tags button:hover {
  border-color: rgba(51, 95, 246, 0.38);
  background: var(--blue-soft);
  color: #203db4;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.glossary-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 260px;
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 246, 0.92)),
    repeating-linear-gradient(135deg, transparent 0 28px, rgba(8, 169, 196, 0.04) 28px 29px);
  overflow: hidden;
}

.glossary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), var(--blue), var(--amber));
}

.glossary-glyph {
  display: grid;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 159, 134, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 159, 134, 0.16) 0 50%, transparent 51%),
    linear-gradient(315deg, rgba(51, 95, 246, 0.16) 0 50%, transparent 51%),
    rgba(255, 255, 255, 0.86);
}

.glossary-card p,
.glossary-card dl,
.glossary-card dd {
  margin: 0;
}

.glossary-card p,
.glossary-card dd {
  color: var(--muted);
}

.glossary-card dl {
  display: grid;
  gap: 9px;
}

.glossary-card dt {
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.flow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.segmented,
.control-group,
.filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button,
.filter-pills button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--muted);
  font-weight: 760;
}

.segmented button.active,
.filter-pills button.active {
  border-color: rgba(22, 116, 102, 0.38);
  background: var(--green-soft);
  color: #0e5e52;
}

.flow-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.flow-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--step-count), minmax(140px, 1fr));
  gap: 10px;
  min-height: 156px;
  padding: 20px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(12, 20, 32, 0.94), rgba(17, 31, 45, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(255, 255, 255, 0.06) 44px 45px),
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(8, 169, 196, 0.08) 44px 45px);
  overflow-x: auto;
}

.flow-progress {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 64px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.flow-progress span {
  display: block;
  width: var(--flow-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber));
  transition: width 260ms ease;
}

.flow-node {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  min-width: 138px;
  padding: 0 8px;
  text-align: center;
}

.node-marker {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #cfe1e4;
  font-weight: 820;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.flow-node.done .node-marker {
  border-color: var(--green);
  background: rgba(0, 159, 134, 0.2);
  color: #95f2df;
}

.flow-node.active .node-marker {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  animation: activeNode 1200ms ease-in-out infinite;
}

.flow-node button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: inherit;
}

.flow-node strong {
  display: block;
  margin-top: 6px;
  line-height: 1.2;
  color: #f8fbff;
}

.flow-node span {
  display: block;
  color: #b9cad3;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.flow-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1fr);
  gap: 18px;
}

.explain-panel,
.code-panel {
  min-width: 0;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.08);
}

.explain-panel {
  padding: 20px;
}

.step-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #744403;
  font-weight: 780;
  font-size: 0.82rem;
}

.endpoint-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px 0 12px;
}

.method {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 6px;
  color: white;
  font-weight: 820;
  font-size: 0.78rem;
}

.method.get {
  background: var(--blue);
}

.method.post {
  background: var(--green);
}

.method.webhook {
  background: var(--plum);
}

.method.inbound {
  background: var(--coral);
}

.endpoint-path {
  overflow-wrap: anywhere;
  font-weight: 780;
}

.status-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.status-trail span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef1ea;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-trail span.active {
  background: var(--green-soft);
  color: #0d5a4e;
  font-weight: 780;
}

.flow-hint-row {
  display: flex;
  margin-top: 12px;
}

.flow-hint .hint-trigger {
  width: 28px;
  height: 28px;
}

.code-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.code-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0c1420;
}

.code-tabs span {
  padding: 10px 12px;
  color: #bed0df;
  font-weight: 780;
  font-size: 0.86rem;
}

.code-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 320px;
}

.code-card {
  min-width: 0;
  border-left: 1px solid var(--line);
}

.code-card:first-child {
  border-left: 0;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.code-head strong {
  font-size: 0.86rem;
}

.copy-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.copy-code svg {
  width: 15px;
  height: 15px;
}

pre {
  margin: 0;
  min-height: 278px;
  max-height: 420px;
  padding: 14px;
  overflow: auto;
  background:
    linear-gradient(180deg, #0c1420, #111927),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, 0.04) 27px 28px);
  color: #e8f5ee;
  font-size: 0.82rem;
  line-height: 1.55;
}

.endpoint-tools {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.endpoint-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.endpoint-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 159, 134, 0.34);
  box-shadow: 0 12px 28px rgba(16, 24, 32, 0.08);
}

.endpoint-card p {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.endpoint-card .tag {
  justify-self: start;
  color: #0e5e52;
  background: var(--green-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 780;
}

.accordion-list {
  display: grid;
  gap: 10px;
}

.accordion-item {
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 820;
}

.accordion-trigger svg {
  width: 18px;
  height: 18px;
  transition: transform 180ms ease;
}

.accordion-item.open .accordion-trigger svg {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 0 16px 16px;
  color: var(--muted);
}

.accordion-item.open .accordion-body {
  display: block;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-card {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.quiz-card h3 {
  font-size: 1rem;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
}

.choice:hover {
  border-color: var(--line-strong);
}

.choice.correct {
  border-color: rgba(22, 116, 102, 0.42);
  background: var(--green-soft);
}

.choice.incorrect {
  border-color: rgba(217, 94, 79, 0.38);
  background: var(--coral-soft);
}

.choice-letter {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf0e9;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.quiz-feedback {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
}

.quiz-feedback.good {
  color: #0d5a4e;
}

.quiz-feedback.missed {
  color: #8f2f23;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reference-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(174, 191, 181, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 248, 246, 0.9));
}

.reference-card h3 {
  margin-bottom: 12px;
}

.token-list {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.token-list li {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(232, 237, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 7vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-footer a {
  color: var(--green);
  font-weight: 780;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes packet {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(340%);
  }
}

@keyframes masterPacket {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(680%);
  }
}

@keyframes activeNode {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 1100px) {
  .intro-band {
    grid-template-columns: 1fr;
  }

  .profile-hero,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .service-grid,
  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .creator-proof {
    grid-column: 1 / -1;
  }

  .wizard-shell {
    grid-template-columns: 1fr;
  }

  .wizard-results {
    position: static;
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .master-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .master-flowline {
    display: none;
  }

  .guidance-grid {
    grid-template-columns: 1fr 1fr auto;
  }

  .guidance-hint {
    justify-content: flex-start;
  }

  .flow-detail {
    grid-template-columns: 1fr;
  }

  .code-stack {
    grid-template-columns: 1fr;
  }

  .code-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .code-card:first-child {
    border-top: 0;
  }

  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .author-strip {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding-left: 22px;
    padding-right: 22px;
  }

  .author-strip-line {
    white-space: normal;
  }

  .intro-band,
  .profile-hero,
  .profile-band,
  .creator-band,
  .wizard-band,
  .master-map-band,
  .canonical-band,
  .course-band,
  .compare-band {
    padding-left: 22px;
    padding-right: 22px;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.62rem;
  }

  .course-grid,
  .endpoint-grid,
  .quiz-grid,
  .service-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .proof-timeline article {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .comparison-row {
    grid-template-columns: 1fr;
  }

  .comparison-row > div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .comparison-row > div:first-child {
    border-top: 0;
  }

  .lesson-layout {
    display: block;
  }

  .lesson-index {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lesson-index nav {
    display: flex;
    flex-wrap: wrap;
  }

  .lesson-index a {
    width: auto;
  }

  .lesson-hero,
  .lab-section,
  .tool-section,
  .reference-band,
  .glossary-section,
  .provider-section {
    margin-left: 22px;
    margin-right: 22px;
  }

  .lesson-hero {
    margin: 0;
    padding-left: 22px;
    padding-right: 22px;
  }

  .wizard-band {
    padding-top: 34px;
  }

  .endpoint-tools {
    grid-template-columns: 1fr;
  }

  .map-row {
    grid-template-columns: 1fr;
  }

  .map-connector {
    height: 36px;
    width: 4px;
    justify-self: center;
  }

  .map-connector span {
    inset: -40% 0 auto 0;
    width: 100%;
    height: 42%;
    background: linear-gradient(180deg, transparent, var(--coral), transparent);
  }

  .master-map {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .master-node {
    min-height: auto;
  }

  .guidance-panel {
    margin-left: 22px;
    margin-right: 22px;
  }

  .guidance-grid {
    grid-template-columns: 1fr;
  }

  .guidance-hint {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .site-header {
    padding: 14px 16px;
  }

  .creator-card {
    grid-template-columns: 1fr;
  }

  .profile-proof-grid {
    grid-template-columns: 1fr;
  }

  .creator-photo-wrap {
    justify-content: start;
  }

  .creator-card {
    padding: 16px;
  }

  .intro-band {
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: 1.92rem;
  }

  .lab-section,
  .tool-section,
  .reference-band,
  .glossary-section,
  .provider-section {
    padding: 16px;
  }

  .wizard-shell,
  .wizard-step,
  .wizard-results {
    padding: 14px;
  }

  .wizard-path {
    max-height: none;
  }

  .section-heading.compact {
    grid-template-columns: 1fr;
  }

  .section-toggle {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: 8px;
  }

  .flow-toolbar {
    align-items: stretch;
  }

  .segmented,
  .control-group {
    width: 100%;
  }

  .segmented button,
  .control-group .button {
    flex: 1 1 auto;
  }

  .flow-visual {
    padding-left: 14px;
    padding-right: 14px;
  }

  .flow-progress {
    left: 22px;
    right: 22px;
  }

  .reference-grid {
    grid-template-columns: 1fr;
  }
}

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

/* =====================================================================
   DARK WEB3 THEME LAYER
   Re-skins surfaces that hardcode light colors and adds the new blog UI.
   These rules intentionally live last so equal-specificity selectors win.
   ===================================================================== */

html {
  color-scheme: dark;
}

/* Brand wordmark: "Stable" in ink, "Peg" in the teal accent. */
.brand-name {
  font-weight: 820;
  letter-spacing: -0.01em;
}

.brand-accent {
  color: var(--green);
}

h1,
h2 {
  letter-spacing: -0.02em;
}

.eyebrow {
  color: var(--green);
  letter-spacing: 0.14em;
}

/* --- Header + nav --- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 13, 22, 0.92), rgba(9, 13, 22, 0.78));
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.author-strip {
  border-bottom: 1px solid var(--line);
  background: var(--glass-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.author-strip-link {
  border-color: var(--blue-soft);
  background: var(--blue-soft);
  color: var(--blue);
}

/* --- Buttons --- */
.button,
.icon-button {
  color: var(--ink);
  background: var(--glass);
  border-color: var(--line);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #04121a;
  box-shadow: 0 14px 34px rgba(53, 230, 192, 0.28);
}

.button.primary:hover {
  box-shadow: 0 18px 44px rgba(53, 230, 192, 0.38);
}

.button.secondary {
  border-color: var(--line);
  background: var(--glass);
}

/* --- Surfaces / cards (glass) --- */
.service-card,
.note-card,
.admin-card,
.creator-card,
.wizard-shell,
.wizard-step,
.wizard-results,
.glossary-card,
.endpoint-card,
.accordion-item,
.quiz-card,
.reference-card,
.explain-panel,
.code-panel,
.system-map,
.master-map,
.proof-timeline article,
.persona-option,
.wizard-path-card {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
}

.master-node,
.map-node,
.canonical-card,
.course-card,
.comparison-table {
  background: var(--paper-strong);
  border-color: var(--line);
}

.service-card:hover,
.note-card:hover,
.endpoint-card:hover,
.wizard-path-card:hover,
.canonical-card:hover {
  border-color: rgba(53, 230, 192, 0.34);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(53, 230, 192, 0.14);
}

.proof-timeline article {
  box-shadow: none;
}

/* --- Section toggle / segmented / filter pills --- */
.section-toggle,
.glossary-tags button {
  border-color: var(--line);
  background: var(--glass);
  color: var(--muted);
}

.section-toggle:hover {
  border-color: rgba(53, 230, 192, 0.42);
  background: var(--green-soft);
  color: var(--green);
}

.segmented button.active,
.filter-pills button.active {
  border-color: rgba(53, 230, 192, 0.42);
  background: var(--green-soft);
  color: var(--green);
}

.need-option:hover,
.need-option.active,
.glossary-tags button.active,
.glossary-tags button:hover {
  border-color: rgba(127, 157, 255, 0.42);
  background: var(--blue-soft);
  color: var(--blue);
}

.persona-option:hover,
.persona-option.active {
  border-color: rgba(53, 230, 192, 0.42);
  background: linear-gradient(135deg, rgba(53, 230, 192, 0.14), rgba(127, 157, 255, 0.12));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.need-option {
  border-color: var(--line);
  background: var(--glass);
  color: var(--muted);
}

/* --- Pills / tags / chips text on dark --- */
.note-tags li,
.creator-tags span,
.wizard-result-topline span,
.token-list li {
  background: var(--blue-soft);
  color: var(--blue);
}

.note-meta span,
.admin-session-row,
.course-filter-status {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(53, 230, 192, 0.28);
}

.status-trail span,
.choice-letter,
.comparison-row.header {
  background: rgba(150, 172, 216, 0.10);
  color: var(--muted);
}

.status-trail span.active {
  background: var(--green-soft);
  color: var(--green);
}

.step-label {
  background: var(--amber-soft);
  color: var(--amber);
}

/* Course kickers: readable accent text on translucent chips */
.course-kicker.external,
.course-kicker.kyc,
.course-kicker.testing,
.course-kicker.adapter {
  color: var(--blue);
}

.course-kicker.internal,
.course-kicker.money,
.course-kicker.fiat,
.course-kicker.model {
  color: var(--green);
}

.course-kicker.risk,
.course-kicker.controls,
.course-kicker.events {
  color: var(--plum);
}

.course-kicker.cards,
.course-kicker.playbook {
  color: var(--amber);
}

.course-kicker.ops,
.course-kicker.security {
  color: var(--coral);
}

/* --- Status text colors --- */
.form-status.success,
.quiz-feedback.good {
  color: var(--green);
}

.form-status.error,
.quiz-feedback.missed {
  color: var(--coral);
}

/* --- Forms --- */
.note-form input,
.note-form textarea,
.note-form select,
.field-select,
.field-search input {
  border: 1px solid var(--line-strong);
  background: rgba(6, 10, 18, 0.6);
  color: var(--ink);
}

.note-form input::placeholder,
.note-form textarea::placeholder,
.field-search input::placeholder {
  color: rgba(147, 162, 194, 0.7);
}

.note-form input:focus,
.note-form textarea:focus,
.note-form select:focus,
.field-select:focus,
.field-search:focus-within {
  outline: none;
  border-color: rgba(53, 230, 192, 0.55);
  box-shadow: 0 0 0 3px rgba(53, 230, 192, 0.15);
}

/* --- Intro band + lesson index gradients --- */
.intro-band {
  background:
    radial-gradient(900px 500px at 78% 0%, rgba(53, 230, 192, 0.12), transparent 60%),
    radial-gradient(760px 520px at 0% 20%, rgba(127, 157, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

.lesson-index {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 15, 26, 0.9), rgba(8, 11, 20, 0.8));
}

.master-map-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

/* --- Empty state --- */
.empty-state {
  border: 1px dashed var(--line-strong);
  background: var(--glass);
  color: var(--muted);
}

/* =====================================================================
   BLOG / FIELD NOTES UX
   ===================================================================== */

.notes-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(16px);
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(6, 10, 18, 0.55);
  color: var(--muted);
}

.field svg {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex: 0 0 auto;
}

.field-search {
  min-width: 220px;
}

.field-search input {
  border: 0;
  background: transparent;
  outline: none;
  min-height: 40px;
  width: 100%;
  color: var(--ink);
}

.field-select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  font-weight: 640;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2335e6c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.notes-count {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.notes-count strong {
  color: var(--ink);
}

.note-card {
  position: relative;
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.note-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--green), var(--blue));
  opacity: 0.7;
}

.note-card:hover {
  transform: translateY(-3px);
}

.note-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(53, 230, 192, 0.28);
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.note-domain svg {
  width: 13px;
  height: 13px;
}

.note-card h3 {
  cursor: pointer;
}

.note-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: auto 0 0;
  padding: 8px 12px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  color: var(--ink);
  font-weight: 720;
  font-size: 0.88rem;
  transition: border-color 180ms ease, transform 180ms ease;
}

.note-open:hover {
  transform: translateY(-1px);
  border-color: rgba(53, 230, 192, 0.5);
  color: var(--green);
}

.note-open svg {
  width: 16px;
  height: 16px;
}

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.pager button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  min-width: 40px;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  color: var(--ink);
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.pager button svg {
  width: 16px;
  height: 16px;
}

.pager button:hover:not([disabled]) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.pager button.active {
  border-color: rgba(53, 230, 192, 0.5);
  background: var(--green-soft);
  color: var(--green);
}

.pager button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager .pager-gap {
  color: var(--muted);
  padding: 0 2px;
}

/* Reader modal */
.note-reader[hidden] {
  display: none;
}

.note-reader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  animation: readerFade 180ms ease;
}

@keyframes readerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.note-reader-panel {
  position: relative;
  width: min(700px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 28px clamp(20px, 4vw, 36px) 32px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--paper-elevated), var(--paper-strong));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}

.note-reader-panel .note-meta {
  margin-bottom: 14px;
}

.note-reader-panel h2 {
  margin: 12px 0 8px;
  font-size: 1.6rem;
}

.note-reader-body {
  margin: 14px 0 0;
  color: var(--ink-dim);
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.note-reader-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  color: var(--ink);
}

.note-reader-close:hover {
  border-color: var(--line-strong);
  color: var(--coral);
}

.note-reader-close svg {
  width: 18px;
  height: 18px;
}

/* =====================================================================
   ADMIN: writer + manager
   ===================================================================== */

.domain-field .domain-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.domain-field .domain-add.is-hidden {
  display: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manage-panel {
  margin-top: 22px;
}

.manage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.manage-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 2px;
}

.manage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
}

.manage-item-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.manage-item-title {
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.manage-item-meta .badge-draft {
  color: var(--amber);
  border: 1px solid var(--amber-soft);
  background: var(--amber-soft);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 720;
}

.manage-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--glass);
  color: var(--muted);
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
  border-color: var(--line-strong);
}

.icon-btn.danger:hover {
  color: var(--coral);
  border-color: rgba(255, 132, 116, 0.5);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.editing-banner {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 8px 12px;
  border: 1px solid rgba(127, 157, 255, 0.3);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 0.86rem;
}

.editing-banner.is-active {
  display: flex;
}

.editing-banner button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 620px) {
  .notes-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .field-search,
  .field-select {
    width: 100%;
  }
}

/* =====================================================================
   FIXES + NAV/MOBILE UX (appended last so these win)
   ===================================================================== */

/* Cross-link + hint cards were still light-on-light on the dark theme. */
.guidance-card,
.info-balloon {
  border-color: var(--line);
}

.guidance-links a {
  background: rgba(6, 10, 18, 0.5);
  border-color: var(--line);
}

.guidance-links a strong {
  color: var(--ink);
}

.guidance-links a:hover {
  border-color: rgba(127, 157, 255, 0.45);
  background: var(--blue-soft);
}

.hint-trigger {
  color: var(--amber);
}

.hint-trigger:hover,
.hint-trigger:focus-visible {
  background: var(--amber-soft);
}

.hint-card {
  border-color: var(--line-strong);
  background: var(--paper-elevated);
  color: var(--ink-dim);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.hint-card strong {
  color: var(--ink);
}

/* Anchor jumps clear the sticky header, and the landed section flashes so it
   is obvious the content changed. */
html {
  scroll-padding-top: 96px;
}

@keyframes targetPulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 230, 192, 0); }
  25% { box-shadow: 0 0 0 3px rgba(53, 230, 192, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(53, 230, 192, 0); }
}

.lesson-content section:target,
.wizard-band:target,
.course-band:target {
  animation: targetPulse 1.6s ease;
  border-radius: 14px;
}

/* ---- Collapsible lesson sidebar: icon rail that expands on hover/focus/pin ---- */
@media (min-width: 861px) {
  .lesson-layout {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .lesson-index {
    position: sticky;
    top: 63px;
    width: 76px;
    overflow: hidden;
    z-index: 26;
    padding: 18px 10px;
    background: linear-gradient(180deg, #0a0e18, #080b14);
    border-right: 1px solid var(--line);
    transition: width 0.2s ease, box-shadow 0.2s ease;
  }

  .lesson-index:hover,
  .lesson-index:focus-within,
  .lesson-index.is-pinned {
    width: 252px;
    overflow: visible;
    box-shadow: 26px 0 70px rgba(0, 0, 0, 0.5);
  }

  .lesson-index nav {
    margin-top: 8px;
  }

  .lesson-index .back-link,
  .lesson-index nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    white-space: nowrap;
    padding: 10px 14px;
    border-radius: 10px;
  }

  .lesson-index .back-link svg,
  .lesson-index nav a svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }

  .lesson-index .nav-label {
    opacity: 0;
    transition: opacity 0.16s ease;
  }

  .lesson-index:hover .nav-label,
  .lesson-index:focus-within .nav-label,
  .lesson-index.is-pinned .nav-label {
    opacity: 1;
  }

  .lesson-index-toggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 34px;
    margin: 0 0 8px 4px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--glass);
    color: var(--muted);
    transition: color 0.16s ease, border-color 0.16s ease;
  }

  .lesson-index-toggle:hover {
    color: var(--green);
    border-color: rgba(53, 230, 192, 0.4);
  }

  .lesson-index-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* On mobile the sidebar is a horizontal chip nav; the toggle is not needed. */
@media (max-width: 860px) {
  .lesson-index-toggle {
    display: none;
  }

  .lesson-index nav a,
  .lesson-index .back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }

  .lesson-index nav a svg,
  .lesson-index .back-link svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
  }
}

/* ---- Mobile: stop the intro / hero from eating a full screen before the
   valuable content, and trim the supplementary "about" blocks. ---- */
@media (max-width: 860px) {
  .profile-hero {
    min-height: auto;
    padding-top: 40px;
    padding-bottom: 32px;
  }

  .intro-band {
    min-height: auto;
    padding-top: 44px;
  }

  .lesson-hero {
    padding-top: 40px;
    padding-bottom: 30px;
  }

  .creator-band {
    padding-top: 24px;
  }

  .author-strip {
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

@media (max-width: 620px) {
  .profile-hero {
    padding-top: 28px;
  }

  .lesson-hero {
    padding-top: 28px;
  }

  .creator-proof {
    display: none;
  }
}

/* Profile photo is a full-scene selfie: bias the circular crop down toward
   the face rather than the centre (the scenery). Tune the % if needed. */
.profile-photo img,
.author-avatar img,
.creator-photo img {
  object-position: center 74%;
}
