/* SeatRelist Docs: editorial typography, borderless top-lit frames, signature Cobalt glow */

.docs-main {
  display: grid;
  gap: clamp(3.5rem, 7vw, 6rem);
  padding-top: clamp(2rem, 5vw, 3.75rem);
  padding-bottom: 4.5rem;
}

.docs-section {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

.docs-kicker {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.docs-hero {
  display: grid;
  gap: 1.25rem;
}

.docs-display {
  font-size: clamp(2.5rem, 1.8rem + 3.6vw, 4.75rem);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.048em;
  max-width: 18ch;
}

.docs-hero-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .85rem 2rem;
}

.docs-lead {
  max-width: 54ch;
  color: var(--muted-foreground);
  font-size: 1.05rem;
  line-height: 1.58;
}

.docs-quicklink {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--accent-foreground);
  white-space: nowrap;
}
.docs-quicklink:hover {
  text-decoration: underline;
  text-underline-offset: .22em;
}

/* Interactive Settlement Flow Explorer (signature-glow dark frame) */
.flow-explorer {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.flow-explorer::after {
  bottom: -13rem;
  height: 28rem;
}

.flow-tabs {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  padding: .28rem;
  border-radius: 99rem;
  background: rgb(255 255 255 / .07);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08);
  scrollbar-width: none;
}
.flow-tabs::-webkit-scrollbar { display: none; }

.flow-tab {
  flex: 1 0 auto;
  min-height: 2.4rem;
  padding: .42rem 1rem;
  border: 0;
  border-radius: 99rem;
  background: transparent;
  color: rgb(255 250 245 / .64);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.flow-tab:hover {
  color: #fffaf5;
  background: rgb(255 255 255 / .06);
}
.flow-tab[aria-selected="true"] {
  background: linear-gradient(180deg, var(--primary-hi), var(--primary) 45%);
  color: #fff;
  box-shadow: var(--shadow-gloss);
}

.flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 12.25rem) minmax(0, 1fr) minmax(0, 12.25rem);
  align-items: center;
  gap: 1.35rem;
}

.flow-bank {
  display: grid;
  gap: .55rem;
  align-content: start;
}

.flow-bank .docs-kicker {
  color: rgb(255 250 245 / .5);
}

.flow-options {
  display: grid;
  gap: .35rem;
}

.flow-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .55rem .72rem;
  border: 0;
  border-radius: .95rem;
  background: rgb(255 255 255 / .055);
  color: rgb(255 250 245 / .76);
  font-size: .84rem;
  font-weight: 500;
  text-align: left;
  line-height: 1.25;
  transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.flow-option:hover {
  background: rgb(255 255 255 / .11);
  color: #fffaf5;
}
.flow-option[aria-pressed="true"] {
  background: #fffaf5;
  color: #121111;
  box-shadow: 0 8px 20px -10px rgb(0 0 0 / .65);
}
.flow-option .flow-dot {
  width: .5rem;
  height: .5rem;
  flex: none;
  border-radius: 50%;
  background: var(--cobalt-light);
}
.flow-option[aria-pressed="true"] .flow-dot {
  background: var(--cobalt);
}
.flow-option small {
  display: block;
  font-family: var(--font-mono);
  font-size: .68rem;
  opacity: .72;
}

.flow-stage {
  display: grid;
  gap: .75rem;
  min-width: 0;
  padding-top: .25rem;
}

.flow-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 720 / 260;
}

.flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.flow-arch-lit {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.flow-canvas[data-tone="warn"] .flow-arch-lit {
  stroke: url(#flow-rail-warn);
}
.flow-canvas[data-anim="pulse"] .flow-arch-lit {
  animation: draw-arch .75s var(--ease) both;
}

.flow-rail-arrow {
  stroke: #9bb4ff;
}
.flow-canvas[data-tone="warn"] .flow-rail-arrow {
  stroke: #ffd09b;
}

.flow-pulse-halo {
  fill: #5d80ff;
  opacity: .28;
}
.flow-canvas[data-tone="warn"] .flow-pulse-halo {
  fill: #fda24a;
}

.flow-nodes { display: none; }
.flow-canvas[data-hops="2"] .flow-nodes-2,
.flow-canvas[data-hops="3"] .flow-nodes-3 {
  display: inline;
}
.flow-stem {
  fill: none;
  stroke: rgb(255 250 245 / .22);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 2.5 4.5;
}
.flow-socket-outer {
  fill: #141314;
  stroke: #5d80ff;
  stroke-width: 1.75;
}
.flow-socket-core {
  fill: #fffaf5;
}
.flow-canvas[data-tone="warn"] .flow-socket-outer {
  stroke: #fda24a;
}

@keyframes draw-arch {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes hop-rise {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes hop-drop {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.flow-endpoint {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #1b1a19;
  color: #fffaf5;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 0 0 1px rgb(255 255 255 / .08), 0 10px 24px -8px rgb(0 0 0 / .75);
  transform: translate(-50%, -50%);
}
.flow-endpoint-start { left: 7.8%; }
.flow-endpoint-end { left: 92.2%; }
.flow-endpoint img {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
  border-radius: 50%;
}

.flow-hops {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.flow-hop {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .72rem;
  border-radius: 99rem;
  background: #1c1b1b;
  color: #fffaf5;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 10px 24px -10px rgb(0 0 0 / .78);
  font-size: .76rem;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, 0);
  animation: hop-rise .42s var(--ease) both;
}
.flow-hop-num {
  display: grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
}
.flow-canvas[data-tone="warn"] .flow-hop-num {
  background: #d96b1f;
}
.flow-hop.pos-mid { left: 50%; bottom: 67.5%; }
.flow-hop.pos-left { left: 32%; bottom: 67.5%; }
.flow-hop.pos-right { left: 68%; top: 67.5%; animation-name: hop-drop; animation-delay: .12s; }
.flow-hop.pos-a { left: 27%; bottom: 67.5%; }
.flow-hop.pos-b { left: 50%; top: 67.5%; animation-name: hop-drop; animation-delay: .08s; }
.flow-hop.pos-c { left: 73%; bottom: 67.5%; animation-delay: .16s; }

.flow-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: rgb(255 250 245 / .56);
}
.flow-caption .icon { color: var(--cobalt-light); }

.flow-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.15rem 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / .09);
}

.flow-facts {
  display: grid;
  gap: .55rem;
}

.flow-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.flow-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .72rem;
  border-radius: 99rem;
  background: rgb(255 255 255 / .09);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1);
  color: #fffaf5;
  font-family: var(--font-mono);
  font-size: .74rem;
}
.flow-tag-accent {
  background: rgb(59 98 246 / .28);
  color: #cddaff;
}
.flow-tag-warn {
  background: rgb(253 162 74 / .2);
  color: #ffd09b;
}

.flow-steps-list {
  display: grid;
  gap: .35rem;
  padding: 0;
  list-style: none;
  font-size: .92rem;
  color: rgb(255 250 245 / .9);
}
.flow-steps-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem;
}
.flow-steps-list code {
  padding: .1rem .45rem;
  border-radius: .45rem;
  background: rgb(255 255 255 / .08);
  color: #b7c8ff;
  font-size: .78rem;
}
.flow-note {
  color: rgb(255 250 245 / .62);
  font-size: .85rem;
  line-height: 1.45;
}

.flow-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.flow-cta .button {
  border-radius: 99rem;
}

/* One-sentence editorial story with inline protocol pills */
.story-statement {
  max-width: 56rem;
  font-size: clamp(1.55rem, 1.15rem + 1.8vw, 2.55rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -.034em;
}
.story-statement .story-muted {
  color: var(--muted-foreground);
}
.inline-pill {
  display: inline-flex;
  align-items: center;
  gap: .32em;
  margin-inline: .06em;
  padding: .08em .48em .08em .22em;
  border-radius: 99rem;
  background: var(--frame-bg);
  color: var(--foreground);
  box-shadow: var(--frame-shadow);
  font-size: .8em;
  line-height: 1.25;
  vertical-align: .05em;
  white-space: nowrap;
}
.inline-pill img,
.inline-pill .icon {
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  object-fit: contain;
}
.inline-pill .icon { color: var(--accent-foreground); }

/* Editorial Contents directory */
.contents-grid {
  display: grid;
  grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.contents-sticky {
  position: sticky;
  top: 5.5rem;
  display: grid;
  gap: .8rem;
}
.contents-sticky h2,
.docs-heading {
  font-size: clamp(1.9rem, 1.45rem + 1.6vw, 2.7rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.04em;
}
.contents-sticky p {
  color: var(--muted-foreground);
  font-size: .94rem;
  line-height: 1.55;
}
.contents-list {
  display: grid;
  padding: 0;
  list-style: none;
}
.contents-part {
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
}
.contents-part:last-child {
  border-bottom: 1px solid var(--border);
}
.contents-part-head {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .35rem .75rem;
}
.contents-num {
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  transition: color .2s var(--ease);
}
.contents-part:hover .contents-num {
  color: var(--accent-foreground);
}
.contents-title {
  font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.contents-desc {
  grid-column: 2;
  color: var(--muted-foreground);
  font-size: .92rem;
}
.contents-count {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.contents-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .25rem;
  margin-top: .85rem;
  margin-left: 3.5rem;
  font-size: .88rem;
}
.contents-links a {
  color: var(--foreground);
  transition: color .18s var(--ease);
}
.contents-links a:hover {
  color: var(--accent-foreground);
  text-decoration: underline;
  text-underline-offset: .22em;
}
.contents-sep {
  padding-inline: .35rem;
  color: var(--muted-foreground);
  opacity: .55;
}

/* Interactive Desk Anatomy */
.anatomy-grid {
  display: grid;
  grid-template-columns: minmax(0, 27rem) minmax(0, 1fr);
  align-items: center;
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
}

.anatomy-figure {
  display: grid;
  gap: .85rem;
}

.anatomy-stage {
  position: relative;
  isolation: isolate;
}
.anatomy-stage::before {
  position: absolute;
  z-index: -1;
  inset: 1.5rem -.45rem -.75rem;
  border-radius: 999px;
  background: radial-gradient(closest-side, var(--halo-a), var(--halo-b) 60%, transparent);
  filter: blur(44px);
  pointer-events: none;
  content: "";
}

.anatomy-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 0;
  border-radius: 2rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow-float);
}

.anatomy-cover {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: .35rem;
  padding: 1.05rem 1.1rem;
  border-radius: 1.4rem;
  background: var(--spotlight-bg);
  color: #fffaf5;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .12);
}
.anatomy-cover::after {
  position: absolute;
  bottom: -4.5rem;
  left: 50%;
  width: 140%;
  height: 8rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(closest-side, var(--spotlight-glow-a), transparent);
  filter: blur(22px);
  pointer-events: none;
  content: "";
}
.anatomy-cover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: #a5b8ff;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.anatomy-cover strong {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -.035em;
}
.anatomy-cover span.sub {
  font-size: .78rem;
  color: rgb(255 250 245 / .64);
}

.anatomy-tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.anatomy-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding: .65rem .78rem;
  border-radius: 1.05rem;
  background: var(--frame-well);
  font-size: .82rem;
  font-weight: 500;
}
.anatomy-tier.is-active {
  background: var(--brand-surface);
  color: var(--accent-foreground);
  box-shadow: inset 0 0 0 1.5px var(--brand-border);
}

.anatomy-price {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  border-radius: 1.35rem;
  background: var(--frame-well);
}
.anatomy-price strong {
  display: block;
  margin-top: .18rem;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1;
}
.anatomy-token {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem .28rem .32rem;
  border-radius: 99rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow);
  font-family: var(--font-mono);
  font-size: .75rem;
}
.anatomy-token img { width: 1.15rem; height: 1.15rem; border-radius: 50%; }

.anatomy-cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.75rem;
  border-radius: 1.05rem;
  background: linear-gradient(180deg, var(--primary-hi), var(--primary) 45%);
  color: #fff;
  box-shadow: var(--shadow-gloss);
  font-size: .88rem;
  font-weight: 500;
}

.anatomy-standby {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .75rem .9rem;
  border-radius: 1.15rem;
  background: var(--frame-well);
  font-size: .8rem;
}
.anatomy-standby strong { display: block; font-size: .84rem; }
.anatomy-standby span { color: var(--muted-foreground); font-size: .74rem; }
.anatomy-standby-pill {
  padding: .24rem .62rem;
  border-radius: 99rem;
  background: var(--brand-surface);
  color: var(--accent-foreground);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  white-space: nowrap;
}

.anatomy-footer-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.anatomy-mini {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .62rem .75rem;
  border-radius: 1.05rem;
  background: var(--frame-well);
  font-size: .76rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.anatomy-mini .icon { color: var(--accent-foreground); }

/* Interactive numbered pins (pure CSS positions, zero inline styles) */
.anatomy-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--foreground);
  color: var(--background);
  box-shadow: 0 0 0 3px var(--background), 0 6px 14px -4px rgb(0 0 0 / .45);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  transform: translate(-50%, -50%);
  transition: transform .22s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.anatomy-pin.is-lit,
.anatomy-pin:hover,
.anatomy-pin:focus-visible {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgb(59 98 246 / .32), 0 8px 20px -4px rgb(59 98 246 / .6);
  transform: translate(-50%, -50%) scale(1.22);
}

.pin-1 { left: 95%; top: 9%; }
.pin-2 { left: 6%; top: 34%; }
.pin-3 { left: 56%; top: 51%; }
.pin-4 { left: 91%; top: 65%; }
.pin-5 { left: 94%; top: 76%; }
.pin-6 { left: 45%; top: 92%; }
.pin-7 { left: 94%; top: 92%; }

.anatomy-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted-foreground);
}

.anatomy-key {
  display: grid;
  padding: 0;
  list-style: none;
}
.anatomy-key li {
  border-top: 1px solid var(--border);
}
.anatomy-key li:last-child {
  border-bottom: 1px solid var(--border);
}
.anatomy-row {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .15rem .75rem;
  padding: .9rem .5rem;
  border-radius: .85rem;
  transition: background .2s var(--ease);
}
.anatomy-row.is-lit,
.anatomy-row:hover {
  background: var(--frame-well);
}
.anatomy-row-num {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  transition: color .2s var(--ease);
}
.anatomy-row.is-lit .anatomy-row-num,
.anatomy-row:hover .anatomy-row-num {
  color: var(--accent-foreground);
}
.anatomy-row-title {
  display: block;
  font-size: 1rem;
  font-weight: 500;
}
.anatomy-row-desc {
  display: block;
  margin-top: .12rem;
  color: var(--muted-foreground);
  font-size: .875rem;
  line-height: 1.4;
}
.anatomy-row .icon {
  align-self: center;
  color: var(--muted-foreground);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.anatomy-row.is-lit .icon,
.anatomy-row:hover .icon {
  color: var(--accent-foreground);
  transform: translateX(3px);
}

/* Architectural System Blueprint Figure */
.blueprint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.blueprint-frame {
  overflow: hidden;
  border: 0;
  border-radius: 1.75rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow-float);
}

.blueprint-svg {
  display: block;
  width: 100%;
  height: auto;
}

.blueprint-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem 1.75rem;
  margin-top: 1rem;
  color: var(--muted-foreground);
  font-size: .88rem;
  line-height: 1.45;
}
.blueprint-legend-item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.blueprint-step-badge {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  margin-top: .08rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
}

/* Full Documentation Reader Workspace */
.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 16.5rem) minmax(0, 1fr);
  gap: 1.75rem clamp(1.5rem, 3.5vw, 3rem);
  align-items: start;
}

.reader-sidebar {
  position: sticky;
  top: 5.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: 1.15rem;
  border: 0;
  border-radius: 1.65rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow);
  max-height: calc(100dvh - 6.5rem);
  overflow: hidden;
}

.reader-search {
  position: relative;
  flex: none;
}
.reader-search .icon {
  position: absolute;
  top: 50%;
  left: .85rem;
  color: var(--muted-foreground);
  transform: translateY(-50%);
  pointer-events: none;
}
.reader-search .control {
  min-height: 2.55rem;
  padding-inline-start: 2.4rem;
  font-size: .86rem;
}

.reader-nav {
  display: grid;
  gap: .85rem;
  min-height: 0;
  overflow-y: auto;
  padding: .25rem .45rem 1rem 0;
  margin-right: -.45rem;
  overscroll-behavior: contain;
  mask-image: linear-gradient(to bottom, transparent 0, #000 .45rem, #000 calc(100% - 1.5rem), transparent 100%);
}

.reader-nav::-webkit-scrollbar,
.doc-table-wrap::-webkit-scrollbar,
.doc-code pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.reader-nav::-webkit-scrollbar-track,
.doc-table-wrap::-webkit-scrollbar-track,
.doc-code pre::-webkit-scrollbar-track,
.reader-nav::-webkit-scrollbar-corner,
.doc-table-wrap::-webkit-scrollbar-corner,
.doc-code pre::-webkit-scrollbar-corner {
  background: transparent;
}
.reader-nav::-webkit-scrollbar-button,
.doc-table-wrap::-webkit-scrollbar-button,
.doc-code pre::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.reader-nav::-webkit-scrollbar-thumb,
.doc-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgb(18 17 17 / .22);
  background-clip: padding-box;
}
:root[data-theme="dark"] .reader-nav::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .doc-table-wrap::-webkit-scrollbar-thumb,
.doc-code pre::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgb(255 255 255 / .22);
  background-clip: padding-box;
}
.reader-nav::-webkit-scrollbar-thumb:hover,
.doc-table-wrap::-webkit-scrollbar-thumb:hover,
.doc-code pre::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hi);
  background-clip: padding-box;
}
@supports not selector(::-webkit-scrollbar) {
  .reader-nav,
  .doc-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgb(18 17 17 / .18) transparent;
  }
  :root[data-theme="dark"] .reader-nav,
  :root[data-theme="dark"] .doc-table-wrap,
  .doc-code pre {
    scrollbar-width: thin;
    scrollbar-color: rgb(255 255 255 / .16) transparent;
  }
}

.reader-group {
  display: grid;
  gap: .2rem;
}
.reader-group-label {
  padding: .2rem .55rem;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.reader-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding: .42rem .65rem;
  border-radius: .75rem;
  color: var(--muted-foreground);
  font-size: .86rem;
  font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.reader-link:hover {
  background: var(--frame-well);
  color: var(--foreground);
}
.reader-link[aria-current="location"] {
  background: var(--brand-surface);
  color: var(--accent-foreground);
}

.reader-empty {
  padding: 1.25rem;
  border-radius: 1.35rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow);
  color: var(--muted-foreground);
  font-size: .92rem;
}

.reader-articles {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
}

.doc-article {
  display: grid;
  gap: 1.2rem;
  min-width: 0;
  padding: clamp(1.35rem, 3.2vw, 2.25rem);
  border: 0;
  border-radius: 1.85rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow);
  scroll-margin-top: 5.25rem;
}

.doc-article-head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.doc-article-head h2 {
  margin-top: .35rem;
  font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -.038em;
  line-height: 1.1;
}
.doc-article-head p.doc-summary {
  margin-top: .45rem;
  max-width: 60ch;
  color: var(--muted-foreground);
  font-size: .95rem;
  line-height: 1.55;
}

.doc-copy-md {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.15rem;
  padding: .3rem .78rem;
  border: 0;
  border-radius: 99rem;
  background: var(--frame-well);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: .72rem;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.doc-copy-md:hover {
  background: var(--brand-surface);
  color: var(--accent-foreground);
}

.doc-sub {
  display: grid;
  gap: .75rem;
  padding-top: .5rem;
  scroll-margin-top: 5.5rem;
}
.doc-sub + .doc-sub {
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.doc-sub h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.025em;
}
.doc-sub p,
.doc-sub li {
  max-width: 66ch;
  color: var(--muted-foreground);
  font-size: .93rem;
  line-height: 1.62;
}
.doc-sub strong {
  color: var(--foreground);
  font-weight: 600;
}
.doc-sub ul,
.doc-sub ol {
  display: grid;
  gap: .48rem;
  padding-left: 1.25rem;
}
.doc-sub a {
  color: var(--accent-foreground);
  text-decoration: underline;
  text-underline-offset: .2em;
}
.doc-sub code {
  padding: .12rem .38rem;
  border-radius: .4rem;
  background: var(--frame-well);
  color: var(--foreground);
  font-size: .82em;
}

/* Ticket Lifecycle Pill Strip */
.lifecycle-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  padding: .9rem 1rem;
  border-radius: 1.25rem;
  background: var(--frame-well);
}
.state-node {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .3rem .72rem;
  border-radius: 99rem;
  background: var(--frame-bg);
  box-shadow: var(--frame-shadow);
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  color: var(--foreground);
}
.state-node .status-dot { width: .45rem; height: .45rem; }
.lifecycle-arrow {
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: .78rem;
}

/* Tables */
.doc-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 1.25rem;
  background: var(--frame-well);
  padding: .25rem;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  line-height: 1.48;
}
.doc-table th,
.doc-table td {
  padding: .72rem .85rem;
  text-align: left;
  vertical-align: top;
}
.doc-table th {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.doc-table tbody tr:first-child td { border-top: 0; }
.doc-table td:first-child {
  color: var(--foreground);
  font-weight: 500;
  white-space: nowrap;
}
.doc-table code {
  background: var(--frame-bg);
}

.http-method {
  display: inline-block;
  min-width: 3.1rem;
  margin-right: .4rem;
  padding: .12rem .4rem;
  border-radius: .4rem;
  background: var(--brand-surface);
  color: var(--accent-foreground);
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
}
.http-method.m-post { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.http-method.m-put { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.http-method.m-del { background: color-mix(in srgb, var(--destructive) 16%, transparent); color: var(--destructive); }

/* Code blocks with copy button */
.doc-code {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background: var(--spotlight-bg);
  color: #fffaf5;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1);
}
.doc-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem .9rem;
  border-bottom: 1px solid rgb(255 255 255 / .08);
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgb(255 250 245 / .54);
}
.doc-code-copy {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .22rem .6rem;
  border: 0;
  border-radius: 99rem;
  background: rgb(255 255 255 / .09);
  color: #fffaf5;
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: none;
  letter-spacing: 0;
  transition: background .18s var(--ease);
}
.doc-code-copy:hover {
  background: rgb(255 255 255 / .18);
}
.doc-code pre {
  margin: 0;
  padding: 1rem 1.05rem;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.62;
  color: #eaeef9;
}
.doc-code pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.doc-callout {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .95rem 1.05rem;
  border-radius: 1.25rem;
  background: var(--brand-surface);
  color: var(--foreground);
  font-size: .9rem;
  line-height: 1.52;
}
.doc-callout .icon {
  margin-top: .18rem;
  color: var(--accent-foreground);
}

/* Closing Banner */
.docs-close {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.25rem;
  padding-top: 2.75rem;
  border-top: 1px solid var(--border);
}
.docs-close-mark {
  position: absolute;
  top: -.75rem;
  right: 0;
  font-size: clamp(9rem, 16vw, 15rem);
  font-weight: 600;
  line-height: .9;
  letter-spacing: -.06em;
  color: var(--foreground);
  opacity: .05;
  user-select: none;
  pointer-events: none;
}
.docs-close h2 {
  position: relative;
  max-width: 20ch;
  font-size: clamp(1.9rem, 1.45rem + 1.8vw, 2.85rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.04em;
}
.docs-close-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.docs-close-actions .button {
  border-radius: 99rem;
}

@media (max-width: 62rem) {
  .flow-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow-stage { order: -1; padding-top: 1rem; }
  .flow-options { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
  .contents-grid,
  .anatomy-grid,
  .reader-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .contents-sticky,
  .reader-sidebar {
    position: static;
    max-height: none;
  }
  .reader-nav {
    overflow-y: visible;
    padding: 0;
    margin-right: 0;
    mask-image: none;
  }
  .anatomy-card { max-width: 27rem; margin-inline: auto; width: 100%; }
}

@media (max-width: 44rem) {
  .flow-tab {
    padding: .38rem .78rem;
    font-size: .8rem;
  }
  .flow-stage {
    padding-top: .5rem;
  }
  .flow-summary {
    grid-template-columns: minmax(0, 1fr);
  }
  .blueprint-legend {
    grid-template-columns: minmax(0, 1fr);
  }
  .contents-links {
    margin-left: 0;
  }
  .flow-hop {
    font-size: .68rem;
    padding: .22rem .54rem;
  }
  .flow-hop.pos-mid,
  .flow-hop.pos-left,
  .flow-hop.pos-a,
  .flow-hop.pos-c { bottom: 64.5%; }
  .flow-hop.pos-right,
  .flow-hop.pos-b { top: 64.5%; }
  .flow-endpoint {
    width: 2.3rem;
    height: 2.3rem;
  }
  .doc-table td:first-child {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-svg .flow-pulse,
  .blueprint-svg circle[data-motion] {
    display: none;
  }
}
