/* ============================================================
   Te Lo Llevo · Business Documentation
   Shared design system  ·  bilingual ES / EN static site
   Brand: Harbor Navy + Parcel Gold + warm coastal cream
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700;9..144,900&family=Outfit:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand palette */
  --navy:        #0a4d68;
  --navy-deep:   #082b4c;
  --navy-soft:   #1e6b8c;
  --gold:        #f4a300;
  --gold-deep:   #e2a52b;
  --orange:      #e84a27;
  --orange-soft: #f0623f;

  /* Surfaces */
  --bg:           #fff8ec;
  --surface:      #ffffff;
  --surface-warm: #fbf1dc;
  --surface-cool: #eef4f6;
  --border:       #ecdfc4;
  --border-soft:  #f0e3c8;
  --border-cool:  #d9e4ec;

  /* Ink */
  --ink:        #1f1a17;
  --ink-soft:   #423a33;
  --muted:      #6f655c;
  --muted-cool: #5a7184;

  /* Status */
  --ok:    #2f8f5b;
  --ok-bg: #e3f3e9;
  --warn:    #c8800f;
  --warn-bg: #fbeecd;
  --stop:    #c0392b;
  --stop-bg: #f8e1de;
  --info:    #1e6b8c;
  --info-bg: #e2eef3;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(8, 43, 76, 0.06);
  --shadow-md: 0 10px 30px rgba(8, 43, 76, 0.10);
  --shadow-lg: 0 24px 60px rgba(8, 43, 76, 0.16);

  --radius:    16px;
  --radius-lg: 24px;
  --topbar-h:  66px;
  --sidebar-w: 296px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 20px); }

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--surface-warm); }
::-webkit-scrollbar-thumb { background: var(--border-cool); border-radius: 10px; border: 2px solid var(--surface-warm); }
::-webkit-scrollbar-thumb:hover { background: var(--navy-soft); }

img { max-width: 100%; display: block; }
a { color: var(--navy); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand img { height: 36px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.08rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.brand-text span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-spacer { flex: 1; }

.topbar-doc-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
}

/* language toggle */
.lang-toggle {
  display: inline-flex;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}
.lang-toggle a {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 1px;
  padding: 0.36rem 0.78rem;
  border-radius: 100px;
  text-decoration: none;
  color: var(--muted);
  transition: var(--transition);
}
.lang-toggle a:hover { color: var(--navy); }
.lang-toggle a.active { background: var(--navy); color: #fff; }

.menu-btn {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--navy);
  align-items: center;
  justify-content: center;
}

/* ============================================================
   SHELL : sidebar + content
   ============================================================ */
.shell {
  display: flex;
  align-items: flex-start;
  max-width: 1500px;
  margin: 0 auto;
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.6rem 1rem 3rem 1.5rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.sidebar-intro {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.6rem;
  margin-bottom: 1rem;
}

.nav-group { margin-bottom: 1.4rem; }
.nav-group-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gold-deep);
  padding: 0 0.6rem;
  margin-bottom: 0.5rem;
}
.nav-group ul { list-style: none; }
.nav-group li { margin: 1px 0; }
.nav-group a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.46rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 9px;
  transition: var(--transition);
}
.nav-group a:hover { background: var(--surface-warm); color: var(--navy); }
.nav-group a.current {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}
.nav-group a .nav-ix {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  opacity: 0.65;
  min-width: 1.6em;
}
.nav-group a.current .nav-ix { opacity: 0.85; }

/* ---------- content ---------- */
.content {
  flex: 1;
  min-width: 0;
  padding: 2.6rem clamp(1.25rem, 4vw, 4rem) 5rem;
  max-width: 1000px;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb span { color: var(--border-cool); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.page-kicker {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  color: var(--navy-deep);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.1rem);
  font-weight: 900;
  margin-bottom: 0.7rem;
}
.page-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--muted);
  max-width: 64ch;
  margin-bottom: 2.2rem;
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  font-weight: 700;
  margin: 2.8rem 0 1rem;
  padding-top: 0.6rem;
}
h2::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  border-radius: 4px;
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 1.9rem 0 0.7rem;
}
h4 {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--navy);
  margin: 1.4rem 0 0.5rem;
}

.content p { margin-bottom: 1rem; color: var(--ink-soft); }
.content a { color: var(--navy); text-underline-offset: 3px; }
.content a:hover { color: var(--orange); }

.content ul, .content ol { margin: 0 0 1.1rem 1.3rem; }
.content li { margin-bottom: 0.4rem; color: var(--ink-soft); }
.content li::marker { color: var(--gold-deep); }

strong { color: var(--ink); font-weight: 700; }
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.86em;
  background: var(--surface-cool);
  color: var(--navy-deep);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--border-cool);
}

.lead-anchor { scroll-margin-top: calc(var(--topbar-h) + 24px); }

/* ============================================================
   HERO BLOCK (top of a page)
   ============================================================ */
.hero-card {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 2.4rem;
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(244,163,0,0.32), transparent 70%);
}
.hero-card h1 { color: #fff; position: relative; }
.hero-card .page-kicker { color: var(--gold); }
.hero-card p { color: rgba(255,255,255,0.88); position: relative; }
.hero-card strong { color: #fff; }
.hero-card a { color: var(--gold); }

/* ============================================================
   CALLOUTS
   ============================================================ */
.callout {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  margin: 1.4rem 0;
  border: 1px solid;
  font-size: 0.95rem;
}
.callout .ic { font-size: 1.15rem; flex-shrink: 0; line-height: 1.5; }
.callout p { margin: 0; }
.callout p + p { margin-top: 0.5rem; }
.callout strong { display: block; margin-bottom: 0.15rem; }

.callout.info  { background: var(--info-bg); border-color: #bcd9e4; color: #194b5e; }
.callout.tip   { background: var(--ok-bg);   border-color: #b9ddc6; color: #1f6b43; }
.callout.warn  { background: var(--warn-bg); border-color: #ecd49a; color: #8a5a09; }
.callout.stop  { background: var(--stop-bg); border-color: #e7b6b0; color: #8f291f; }
.callout.gold  { background: var(--surface-warm); border-color: var(--gold); color: var(--ink-soft); }

/* ============================================================
   CARDS & GRIDS
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0;
}
.card-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--gold); }
.card .card-ic {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
  display: block;
}
.card h3, .card h4 { margin-top: 0; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.card p { font-size: 0.9rem; margin-bottom: 0; color: var(--muted); }
.card .card-link {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--navy);
  text-decoration: none;
}
.card .card-link:hover { color: var(--orange); }
.card.is-link { cursor: pointer; }

/* persona card accent */
.card.persona { border-top: 4px solid var(--gold); }

/* feature/quiet panel */
.panel {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 1.5rem 0;
}
.panel.cool { background: var(--surface-cool); border-color: var(--border-cool); }
.panel > :last-child { margin-bottom: 0; }

/* ============================================================
   STAT STRIP
   ============================================================ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.6rem 0;
}
.stat-strip .stat {
  background: var(--surface);
  padding: 1.2rem 1.1rem;
  text-align: center;
}
.stat-strip .stat b {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.85rem;
  color: var(--navy);
  line-height: 1;
}
.stat-strip .stat span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius); border: 1px solid var(--border); }
table.doc {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface);
  min-width: 480px;
}
table.doc th {
  background: var(--navy-deep);
  color: #fff;
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
table.doc td {
  padding: 0.66rem 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  vertical-align: top;
}
table.doc tr:nth-child(even) td { background: var(--surface-warm); }
table.doc tr:hover td { background: var(--surface-cool); }
table.doc code { font-size: 0.8rem; }

/* ============================================================
   PILLS / BADGES / TAGS
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}
.pill.ok   { background: var(--ok-bg);   color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.stop { background: var(--stop-bg); color: var(--stop); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.navy { background: var(--navy); color: #fff; }
.pill.gold { background: var(--surface-warm); color: var(--gold-deep); border: 1px solid var(--gold); }
.pill.plain{ background: var(--surface-cool); color: var(--muted-cool); }

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 1.2rem; }

/* ============================================================
   STEPS  (numbered procedures)
   ============================================================ */
.steps { counter-reset: step; list-style: none; margin: 1.5rem 0 1.5rem 0 !important; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.3rem 3.1rem;
  margin: 0 !important;
  border-left: 2px solid var(--border);
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0.2rem; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -17px; top: -2px;
  width: 32px; height: 32px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 0 0 4px var(--bg);
}
.steps > li h4 { margin-top: 0; margin-bottom: 0.25rem; }
.steps > li p:last-child { margin-bottom: 0; }
.steps.gold > li::before { background: var(--gold-deep); }

/* ============================================================
   TIMELINE  (order lifecycle / state machine)
   ============================================================ */
.timeline { list-style: none; margin: 1.6rem 0 !important; }
.timeline > li {
  position: relative;
  padding: 0 0 1.5rem 2.4rem;
  margin: 0 !important;
  border-left: 2px solid var(--border-cool);
}
.timeline > li:last-child { border-left-color: transparent; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -8px; top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--gold);
}
.timeline > li .tl-state {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.timeline > li .tl-body { font-size: 0.92rem; color: var(--muted); }

/* ============================================================
   USER STORY CARD
   ============================================================ */
.story {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 1.05rem 1.2rem;
  margin: 0.9rem 0;
  box-shadow: var(--shadow-sm);
}
.story .story-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--orange);
  letter-spacing: 0.5px;
}
.story p { margin: 0.3rem 0 0; font-size: 0.95rem; }
.story .story-as { color: var(--navy); font-weight: 700; }
.story .story-crit {
  margin-top: 0.6rem;
  font-size: 0.84rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
}

/* ============================================================
   USE CASE ROW
   ============================================================ */
.uc {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin: 0.55rem 0;
  background: var(--surface);
}
.uc .uc-num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
  background: var(--surface-cool);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
  flex-shrink: 0;
}
.uc .uc-body { flex: 1; min-width: 0; }
.uc .uc-body b { font-size: 0.96rem; color: var(--ink); }
.uc .uc-body p { margin: 0.15rem 0 0; font-size: 0.86rem; color: var(--muted); }

/* ============================================================
   FAQ accordion
   ============================================================ */
.faq-item {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin: 0.6rem 0;
  background: var(--surface);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-deep);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.faq-q::after { content: "+"; font-size: 1.4rem; color: var(--gold-deep); transition: var(--transition); }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 1.2rem; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.open .faq-a { padding: 0 1.2rem 1.1rem; max-height: 1200px; }
.faq-a p:last-child { margin-bottom: 0; }

/* ============================================================
   GLOSSARY definition list
   ============================================================ */
.glossary { margin: 1.5rem 0; }
.glossary dt {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--navy-deep);
  margin-top: 1.2rem;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.glossary dt .gl-orig {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.5rem;
}
.glossary dd { margin: 0.2rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }

.alpha-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 1.2rem 0 2rem;
}
.alpha-index a {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 0.82rem;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--navy);
  background: var(--surface);
}
.alpha-index a:hover { background: var(--navy); color: #fff; }

/* ============================================================
   FLOW DIAGRAM (boxes + arrows)
   ============================================================ */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.55rem;
  margin: 1.6rem 0;
}
.flow .node {
  background: var(--surface);
  border: 1px solid var(--border-cool);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-deep);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 110px;
}
.flow .node small { font-weight: 400; color: var(--muted); font-size: 0.74rem; }
.flow .node.accent { background: var(--navy); color: #fff; border-color: var(--navy); }
.flow .node.accent small { color: rgba(255,255,255,0.75); }
.flow .node.gold { background: var(--surface-warm); border-color: var(--gold); }
.flow .arrow { display: flex; align-items: center; color: var(--gold-deep); font-weight: 800; }

/* ============================================================
   PAGER (prev / next)
   ============================================================ */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}
.pager a {
  flex: 1;
  max-width: 48%;
  text-decoration: none;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: var(--transition);
}
.pager a:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.pager a.next { text-align: right; margin-left: auto; }
.pager .pager-dir {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.pager .pager-title { display: block; font-weight: 700; color: var(--navy); margin-top: 0.2rem; }

/* ============================================================
   "ON THIS PAGE" mini toc (optional inline)
   ============================================================ */
.minitoc {
  background: var(--surface-cool);
  border: 1px solid var(--border-cool);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.8rem 0;
}
.minitoc strong {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-cool);
  display: block;
  margin-bottom: 0.5rem;
}
.minitoc ul { list-style: none; margin: 0 !important; columns: 2; }
.minitoc li { margin-bottom: 0.25rem; }
.minitoc a { font-size: 0.9rem; text-decoration: none; color: var(--navy); }
.minitoc a:hover { color: var(--orange); }

/* ============================================================
   DRIVER / BACKDROP for mobile sidebar
   ============================================================ */
.backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(8, 43, 76, 0.4);
  z-index: 150;
}
.backdrop.show { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.doc-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.7);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.84rem;
}
.doc-footer a { color: var(--gold); text-decoration: none; }
.doc-footer .foot-brand {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  color: #fff;
  font-size: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .menu-btn { display: inline-flex; }
  .topbar-doc-label { display: none; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    height: auto;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow-lg);
    width: min(310px, 84vw);
    flex-basis: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding-top: 2rem; }
  .minitoc ul { columns: 1; }
  /* lock the page behind the open drawer so only the sidebar scrolls */
  body.nav-open { overflow: hidden; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 1rem; gap: 0.6rem; }
  .brand-text span { display: none; }
  .pager { flex-direction: column; }
  .pager a, .pager a.next { max-width: 100%; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  h2 { margin-top: 2rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .topbar, .sidebar, .pager, .menu-btn, .backdrop, .doc-footer { display: none !important; }
  .content { max-width: 100%; padding: 0; }
  .card, .callout, .panel { box-shadow: none; }
  a { color: var(--ink); }
}
