/* ============================================
   ADVANCED MONKEY — COMPONENTS CSS
   Nav, footer, shared UI elements
   ============================================ */

/* ─── NAV ─── */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  height: var(--nav-height);
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  transition: box-shadow var(--transition);
}

.site-nav.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.nav-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--ink); }

.nav-cta {
  font-size: 13px;
  font-weight: 500;
  background: var(--ink);
  color: var(--paper) !important;
  padding: 9px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition);
}
.nav-cta:hover { background: var(--accent) !important; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--faint);
  padding: 24px var(--pad-x);
  z-index: 199;
  flex-direction: column;
  gap: 0;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-size: 16px;
  font-weight: 400;
  color: var(--mid);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--faint);
  transition: color var(--transition);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--ink); }
.nav-drawer .nav-cta {
  margin-top: 16px;
  text-align: center;
  padding: 14px 20px;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ─── FOOTER ─── */
.site-footer {
  background: #0C0B0B;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 48px var(--pad-x) 32px;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.footer-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: white;
  text-decoration: none;
}
.footer-logo span { color: var(--accent); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}
.footer-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition);
}
.footer-links a:hover { color: white; }

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-actions .btn {
  padding: 10px 20px;
  font-size: 12px;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  margin-top: 24px;
}

@media (max-width: 768px) {
  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
}

/* ─── TICKER STRIP ─── */
.ticker {
  background: var(--accent);
  padding: 14px 0;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-flex;
  animation: ticker 28s linear infinite;
}
.ticker-item {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  padding: 0 36px;
}
.ticker-item::after {
  content: '·';
  margin-left: 36px;
  opacity: 0.5;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─── SECTION LABEL + HEADLINE BLOCK ─── */
.section-intro {
  margin-bottom: 56px;
}
.section-intro .label {
  margin-bottom: 16px;
}
.section-intro h2 {
  margin-bottom: 20px;
}
.section-intro .sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--mid);
  max-width: 560px;
  line-height: 1.75;
}
.section-intro.center {
  text-align: center;
}
.section-intro.center .sub {
  margin: 0 auto;
}

/* ─── STAT BLOCK ─── */
.stat-val {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.stat-val span { color: var(--accent); }
.stat-val.lg { font-size: clamp(32px, 4vw, 48px); }
.stat-val.md { font-size: clamp(24px, 3vw, 36px); }
.stat-val.sm { font-size: 24px; }
.stat-key {
  font-size: 12px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.4;
  margin-top: 6px;
}

/* ─── DIVIDER GRID (card borders trick) ─── */
.grid-divided {
  display: grid;
  gap: 1px;
  background: var(--faint);
  border: 1px solid var(--faint);
}
.grid-divided > * {
  background: var(--paper);
  transition: background var(--transition);
}
.grid-divided > *:hover {
  background: var(--warm);
}
.grid-divided.dark {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.07);
}
.grid-divided.dark > * {
  background: var(--ink);
}
.grid-divided.dark > *:hover {
  background: #1a1818;
}

/* ─── SPLIT SECTION (two-col, no gutter) ─── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.split-left {
  padding: var(--pad-section) var(--pad-x);
  border-right: 1px solid var(--faint);
}
.split-right {
  padding: var(--pad-section) var(--pad-x);
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
  .split-left {
    border-right: none;
    border-bottom: 1px solid var(--faint);
  }
}

/* ─── PILL / TAG ─── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid;
}
.tag-dark {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.08);
}
.tag-light {
  background: var(--warm);
  color: var(--mid);
  border-color: var(--faint);
}

/* ─── ARROW LIST ─── */
.arrow-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.arrow-list li {
  font-size: 13px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.6;
  padding-left: 18px;
  position: relative;
}
.arrow-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
  top: 1px;
}

/* ─── PAGE HERO (inner pages) ─── */
.page-hero {
  padding-top: calc(var(--nav-height) + var(--pad-section));
  padding-bottom: var(--pad-section);
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  background: var(--ink);
}
.page-hero .label { color: rgba(255,255,255,0.4); }
.page-hero h1 { color: white; margin-bottom: 20px; }
.page-hero .sub {
  font-size: 18px;
  font-weight: 300;
  color: rgba(255,255,255,0.5);
  max-width: 560px;
  line-height: 1.75;
}

/* ─── QUOTE BLOCK ─── */
.quote-block {
  padding: 36px;
  border-left: 3px solid var(--accent);
  background: var(--warm);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.quote-block p {
  font-size: 16px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.8;
  font-style: italic;
}
.quote-block cite {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--mid);
  font-style: normal;
  font-weight: 500;
}

/* ─── CTA BAND ─── */
.cta-band {
  background: var(--ink);
  padding: 96px var(--pad-x);
  text-align: center;
}
.cta-band h2 { color: white; max-width: 680px; margin: 20px auto; }
.cta-band .sub {
  font-size: 17px;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.75;
}
.cta-band .btns {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.cta-band .note {
  margin-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  font-style: italic;
}

/* ─── THEME SWITCHER ─── */
.theme-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform var(--transition);
}
.theme-trigger:hover { transform: scale(1.2); }
.theme-trigger-dot {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transition: background var(--transition);
}

#theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: var(--paper);
  border-left: 1px solid var(--faint);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  overflow-y: auto;
}
#theme-panel.open { transform: translateX(0); }

.theme-panel-inner {
  padding: 32px 24px;
}

.theme-panel-header {
  position: relative;
  margin-bottom: 32px;
}
.theme-panel-header .label {
  margin-bottom: 10px;
}
.theme-panel-header h3 {
  font-size: 20px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.theme-panel-header p {
  font-size: 13px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.6;
}

.theme-panel-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--warm);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  font-size: 18px;
  color: var(--mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.theme-panel-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theme-card {
  background: var(--warm);
  border: 2px solid var(--faint);
  border-radius: var(--radius);
  padding: 16px 12px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--accent); }

.theme-swatches {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.theme-swatches span {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
}

.theme-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--mid);
  font-family: var(--font-head);
  letter-spacing: 0.02em;
}

/* Custom colour pickers */
.theme-custom {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--faint);
}

.theme-section-head {
  margin-bottom: 20px;
}
.theme-section-head .label {
  margin-bottom: 8px;
}
.theme-section-head p {
  font-size: 13px;
  color: var(--mid);
  font-weight: 300;
}

.theme-color-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--warm);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  transition: background var(--transition);
}
.theme-color-row:hover { background: var(--faint); }

.theme-color-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
}

.theme-color-input {
  width: 40px;
  height: 28px;
  border: 1px solid var(--faint);
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  background: var(--paper);
}

/* ─── SERVICE PAGE: PROCESS STEPS ─── */
.sd-steps { grid-template-columns: repeat(4, 1fr); }
.sd-step { padding: 36px 28px; }
.sd-step-num {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.sd-step h3 { font-size: 18px; margin-bottom: 10px; }
.sd-step p { font-size: 14px; color: var(--mid); font-weight: 300; line-height: 1.7; }

/* ─── SERVICE PAGE: PLAIN CARDS ─── */
.sd-card { padding: 32px 28px; }
.sd-card-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}
.sd-card h3 { font-size: 17px; margin-bottom: 10px; }
.sd-card p { font-size: 14px; color: var(--mid); font-weight: 300; line-height: 1.7; }

/* ─── FAQ (details/summary, no JS) ─── */
.faq-list {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  background: var(--paper);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 20px 24px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-a {
  padding: 0 24px 22px;
  font-size: 15px;
  color: var(--mid);
  font-weight: 300;
  line-height: 1.75;
}

/* ─── SERVICE LINK CARDS ─── */
.svc-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.svc-link {
  display: block;
  padding: 26px 28px;
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.svc-link:hover { background: var(--warm); border-color: var(--mid); }
.svc-link h3 { font-size: 16px; margin-bottom: 8px; }
.svc-link p { font-size: 13px; color: var(--mid); font-weight: 300; line-height: 1.65; margin-bottom: 14px; }
.svc-link-cta { font-size: 13px; font-weight: 500; color: var(--accent); }

/* ─── FOOTER SERVICE LINKS ─── */
.footer-services {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-services a {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition);
}
.footer-services a:hover { color: white; }

@media (max-width: 900px) {
  .sd-steps { grid-template-columns: 1fr 1fr; }
  .svc-links { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sd-steps { grid-template-columns: 1fr; }
}

/* ─── NAV DROPDOWN ─── */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--nav-height);
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-caret {
  font-size: 9px;
  color: var(--accent);
  transition: transform var(--transition);
}
.nav-dropdown:hover .nav-caret,
.nav-dropdown:focus-within .nav-caret { transform: translateY(1px); }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: -18px;
  min-width: 250px;
  padding: 10px 0;
  background: var(--paper);
  border: 1px solid var(--faint);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-links .nav-dropdown-menu a {
  display: block;
  padding: 9px 18px;
}
.nav-links .nav-dropdown-menu a:hover {
  background: var(--warm);
  color: var(--ink);
}

/* Mobile drawer sub-links */
.nav-drawer-sub {
  padding-left: 18px !important;
  font-size: 14px !important;
}

/* ─── STICKY-STEPS PROCESS (answer framework) ───
   Scroll narrative for "How It Works" sections: step text scrolls
   left while a sticky panel right swaps an artefact per step.
   Markup lives per page; behaviour in main.js (initStickySteps).
   Mobile ≤860px: panel hidden, artefacts inlined into their step. */

.ss-section {
  --sec-bg:   var(--paper);
  --panel-bg: var(--warm);
  --chip-bg:  var(--paper);
  background: var(--sec-bg);
  transition: background-color .8s ease;
}
.ss-section.alt {
  --sec-bg:   var(--warm);
  --panel-bg: var(--paper);
  --chip-bg:  var(--warm);
}
.ss-section.bg-warm-base {
  --sec-bg:   var(--warm);
  --panel-bg: var(--paper);
  --chip-bg:  var(--warm);
}
.ss-section.bg-warm-base.alt {
  --sec-bg:   var(--paper);
  --panel-bg: var(--warm);
  --chip-bg:  var(--paper);
}

.ss-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

/* Left: scrolling steps */
.ss-steps { position: relative; }
.ss-step {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}

/* staged reveal driven by scroll thresholds (see main.js phases) */
.ss-step > * {
  opacity: .25;
  transform: translateY(12px);
  transition: opacity .45s ease, transform .45s ease;
}
.ss-step.show-q .ss-q,
.ss-step.show-q .ss-q-text { opacity: 1; transform: none; }
.ss-step.show-a .ss-num,
.ss-step.show-a .ss-title,
.ss-step.show-a .ss-desc { opacity: 1; transform: none; }

.ss-q {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 10px;
}
.ss-q-text {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  color: var(--mid);
  line-height: 1.45;
  margin-bottom: 28px;
  max-width: 26em;
}
.ss-step.show-q .ss-q-text { color: var(--ink); }
.ss-num {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: 6px;
}
.ss-title {
  font-size: clamp(24px, 2.6vw, 34px);
  margin-bottom: 14px;
}
.ss-desc {
  font-size: 16px;
  color: var(--mid);
  max-width: 30em;
}

/* progress rail */
.ss-rail {
  position: sticky;
  top: 50vh;
  float: left;
  margin-left: -34px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
}
.ss-rail span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--faint);
  transition: background .3s ease, transform .3s ease;
}
.ss-rail span.on { background: var(--accent); transform: scale(1.25); }

/* Right: sticky artefact panel */
.ss-visual {
  position: sticky;
  top: 11vh;
  height: 78vh;
  display: flex;
  align-items: center;
}
.ss-art {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.ss-art.in {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ss-art-card {
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 36px);
  box-shadow: 0 2px 20px rgba(0,0,0,.06);
  transition: background-color .8s ease;
}
.ss-art-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 22px;
}
.ss-art-cap {
  margin-top: 22px;
  font-size: 13px;
  font-style: italic;
  color: var(--mid);
}

/* icon tiles */
.ss-tile {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ss-tile svg { width: 18px; height: 18px; fill: var(--paper); }
.ss-tile.hot svg { fill: var(--accent); }
.ss-tile.sm { width: 32px; height: 32px; }
.ss-tile.sm svg { width: 15px; height: 15px; }
.ss-tile.draft {
  background: transparent;
  border: 1.5px solid var(--ink);
}
.ss-tile.draft svg { fill: var(--ink); }

/* status pill (live system) */
.ss-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 18px;
}
.ss-pill .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--paper);
}
.ss-pill em { font-style: normal; color: var(--accent); font-weight: 500; }

/* flow nodes (design + build artefacts) */
.ss-node {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--chip-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: background-color .8s ease;
}
.ss-node b {
  display: block;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}
.ss-node small {
  display: block;
  font-size: 12.5px;
  color: var(--mid);
}
.ss-node.draft {
  background: transparent;
  border: 1.5px dashed var(--faint);
}
.ss-node-link {
  text-align: center;
  color: var(--faint);
  font-size: 15px;
  line-height: 1;
  padding: 7px 0;
  user-select: none;
}

/* findings rows (diagnose artefact) */
.ss-find {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--faint);
}
.ss-find:last-of-type { border-bottom: 0; }
.ss-find .fk {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
}
.ss-find .fk small { display: block; font-size: 12px; color: var(--mid); }
.ss-find .fv {
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.ss-find .fv.hot { color: var(--accent); }

/* handover pack (doc thumb + checklist) */
.ss-ho-grid {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: center;
}
.ss-ho-doc {
  background: var(--chip-bg);
  border: 1px solid var(--faint);
  border-radius: var(--radius);
  padding: 22px 18px;
  transition: background-color .8s ease;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 20px rgba(0,0,0,.06);
}
.ss-ho-doc .ln {
  height: 7px;
  border-radius: 2px;
  background: var(--faint);
  margin-bottom: 9px;
}
.ss-ho-doc .ln.t { background: var(--ink); width: 70%; height: 9px; margin-bottom: 14px; }
.ss-ho-doc .ln.w60 { width: 60%; }
.ss-ho-doc .ln.w80 { width: 80%; }
.ss-ho-doc .tag {
  margin-top: auto;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mid);
}
.ss-ho-list { list-style: none; }
.ss-ho-list li {
  position: relative;
  padding: 11px 0 11px 28px;
  font-size: 14.5px;
  color: var(--mid);
}
.ss-ho-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}
.ss-ho-list b { font-weight: 500; color: var(--ink); }

/* mobile: no sticky panel — artefacts inlined into their step (main.js) */
@media (max-width: 860px) {
  .ss-wrap { grid-template-columns: 1fr; gap: 0; }
  .ss-visual { display: none; }
  .ss-step .ss-art {
    position: static;
    inset: auto;
    margin-top: 30px;
    opacity: .25;
    transform: translateY(12px);
    pointer-events: auto;
  }
  .ss-step .ss-art.in { opacity: 1; transform: none; }
  .ss-art-card { padding: 18px; }
  .ss-art-cap { margin-top: 12px; }
  .ss-step { min-height: 65vh; }
  .ss-rail { display: none; }
  .ss-ho-grid { grid-template-columns: 1fr; }
  .ss-ho-doc { max-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .ss-step > *, .ss-art, .ss-rail span,
  .ss-section, .ss-art-card, .ss-node, .ss-ho-doc, .ss-visual { transition: none; }
  .ss-step > *, .ss-art { transform: none; }
}

/* collapsible variant: compact grid by default, a toggle swaps in the
   full step-by-step walkthrough (used on the homepage) */
.ss-section.ss-collapsible:not(.ss-expanded) .ss-wrap { display: none; }
.ss-section.ss-collapsible.ss-expanded .ss-compact { display: none; }
.ss-toggle-row { margin-top: 36px; }
.ss-section.ss-collapsible:not(.ss-expanded) .ss-collapse-row { display: none; }

/* ============================================
   CHATBOT WIDGET
   Toggleable popup, bottom-right. Markup is built and injected on every page
   by js/main.js (initChatbot), the same way the nav, footer and theme panel
   are. Talks to /api/chat.php. Uses the design tokens — no hard-coded colours.
   ============================================ */

/* Launcher button — fixed bottom-right */
.cbot-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(17, 16, 16, 0.22);
  transition: transform var(--transition), background var(--transition);
}
.cbot-launcher:hover { background: #a83d10; transform: translateY(-2px); }
.cbot-launcher svg { width: 26px; height: 26px; display: block; }
.cbot-launcher .cbot-ic-close { display: none; }
.cbot-launcher.open .cbot-ic-open { display: none; }
.cbot-launcher.open .cbot-ic-close { display: block; }

/* Panel */
.cbot-panel {
  position: fixed;
  right: 24px;
  bottom: 94px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 130px);
  background: var(--paper);
  border: 1px solid var(--faint);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(17, 16, 16, 0.25);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.cbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.cbot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--ink);
  color: #fff;
}
.cbot-head-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.cbot-head-txt { flex: 1; min-width: 0; }
.cbot-head-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}
.cbot-head-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
}
.cbot-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.cbot-close:hover { color: #fff; }

/* Message list */
.cbot-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.cbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.cbot-msg.bot {
  align-self: flex-start;
  background: var(--warm);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.cbot-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.cbot-msg.error {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--faint);
  color: var(--mid);
  font-size: 13.5px;
}
.cbot-msg a { color: inherit; text-decoration: underline; }
.cbot-msg.bot a { color: var(--accent); }

/* Rendered Markdown inside bot replies — kept tight for the small bubble */
.cbot-msg.bot strong { font-weight: 600; }
.cbot-msg.bot ul,
.cbot-msg.bot ol { margin: 6px 0; padding-left: 20px; }
.cbot-msg.bot li { margin: 2px 0; }
.cbot-msg.bot li::marker { color: var(--accent); }

/* Typing indicator */
.cbot-typing { display: flex; gap: 4px; align-items: center; }
.cbot-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mid);
  opacity: 0.5;
  animation: cbotBlink 1.2s infinite ease-in-out both;
}
.cbot-typing span:nth-child(2) { animation-delay: 0.18s; }
.cbot-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes cbotBlink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 0.9; transform: translateY(-3px); }
}

/* Quick-reply chips (first message) */
.cbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 4px;
}
.cbot-chip {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--faint);
  border-radius: 20px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.cbot-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Input row */
.cbot-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--faint);
  background: var(--paper);
}
.cbot-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--faint);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  max-height: 110px;
  transition: border-color var(--transition);
}
.cbot-input:focus { outline: none; border-color: var(--accent); }
.cbot-send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.cbot-send:hover:not(:disabled) { background: #a83d10; }
.cbot-send:disabled { opacity: 0.4; cursor: default; }
.cbot-send svg { width: 18px; height: 18px; }

.cbot-disclaimer {
  font-size: 10.5px;
  color: var(--mid);
  text-align: center;
  padding: 0 14px 10px;
  line-height: 1.4;
}

/* Mobile */
@media (max-width: 480px) {
  .cbot-panel {
    right: 12px;
    left: 12px;
    bottom: 86px;
    width: auto;
    max-width: none;
    height: calc(100vh - 110px);
  }
  .cbot-launcher { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .cbot-panel, .cbot-launcher, .cbot-close, .cbot-send, .cbot-chip { transition: none; }
  .cbot-typing span { animation: none; }
}
