.docs-page {
  min-width: 320px;
  background: var(--paper);
}

.docs-masthead .nav-frame {
  width: min(1440px, calc(100% - 72px));
}

.docs-nav-frame .nav-actions {
  min-width: 0;
}

.nav-source {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-source:hover,
.docs-sidebar-nav a:hover,
.docs-toc a:hover,
.docs-app-link:hover {
  color: var(--accent);
}

.docs-page a:focus-visible,
.docs-page button:focus-visible,
.docs-page summary:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

.docs-shell {
  width: min(1440px, calc(100% - 72px));
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(42px, 7vw, 110px);
  margin: 0 auto;
  padding: 66px 0 120px;
}

.docs-sidebar {
  min-width: 0;
  position: sticky;
  top: 104px;
  align-self: start;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 132px);
}

.docs-sidebar-heading {
  display: grid;
  gap: 7px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.docs-sidebar-heading span,
.docs-nav-group p,
.docs-toc > span,
.docs-kicker,
.docs-callout-label,
.docs-ui-example-top,
.docs-receipt-top,
.docs-source-row,
.docs-sidebar-nav a,
.docs-app-link {
  font-family: var(--mono);
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-sidebar-heading span,
.docs-nav-group p,
.docs-toc > span {
  color: var(--faint);
}

.docs-sidebar-heading strong {
  color: var(--ink);
  font-size: 1.06rem;
  letter-spacing: -0.03em;
}

.docs-sidebar-nav {
  min-width: 0;
  display: grid;
  gap: 25px;
  overflow: auto;
  padding-right: 5px;
}

.docs-nav-group {
  display: grid;
  gap: 3px;
}

.docs-nav-group p {
  margin: 0 0 7px;
}

.docs-sidebar-nav a,
.docs-toc a {
  min-width: 0;
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.docs-sidebar-nav a[aria-current="true"],
.docs-toc a[aria-current="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
}

.docs-sidebar-nav a[aria-current="true"]::before,
.docs-toc a[aria-current="true"]::before {
  content: "";
  width: 5px;
  height: 5px;
  display: inline-block;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: currentColor;
}

.docs-app-link {
  margin-top: auto;
  padding: 25px 10px 3px;
  color: var(--muted);
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}

.docs-mobile-nav {
  display: none;
}

.docs-content-wrap {
  min-width: 0;
}

.docs-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 50px;
  align-items: end;
  padding: 12px 0 58px;
  border-bottom: 1px solid var(--line-strong);
}

.docs-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 28px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.docs-kicker .base-dot {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 4px rgb(0 82 255 / 0.09);
}

.docs-header h1 {
  max-width: none;
  margin: 0 0 22px;
  font-size: clamp(3.4rem, 6.8vw, 6.2rem);
  line-height: 0.9;
}

.docs-lede {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.65;
}

.docs-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  margin-top: 32px;
}

.docs-secondary-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-raised);
  font-size: 0.75rem;
  font-weight: 750;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.docs-secondary-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.docs-header-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid var(--line);
}

.docs-header-meta div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px 12px 13px 0;
  border-bottom: 1px solid var(--line);
}

.docs-header-meta div:nth-child(even) {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.docs-header-meta dt,
.docs-header-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.docs-header-meta dt,
.docs-incident-card dt,
.docs-receipt-grid dt {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.docs-header-meta dd {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
}

.docs-content-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: clamp(34px, 5vw, 76px);
}

.docs-article {
  min-width: 0;
}

.docs-section {
  min-width: 0;
  scroll-margin-top: 105px;
  padding: 76px 0;
  border-bottom: 1px solid var(--line);
}

.docs-section-last {
  border-bottom: 0;
  padding-bottom: 0;
}

.docs-section > h2 {
  max-width: 860px;
  margin: 0 0 24px;
  font-size: clamp(2.25rem, 4.3vw, 4rem);
}

.docs-section > p:not(.section-label):not(.docs-section-lede):not(.docs-muted-note) {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.docs-section-lede {
  max-width: 700px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.docs-section code,
.docs-ui-example code,
.docs-incident-card code,
.docs-alert-card code {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86em;
}

.docs-callout {
  max-width: 780px;
  display: grid;
  gap: 10px;
  margin-top: 32px;
  padding: 20px 22px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
}

.docs-callout p {
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.65;
}

.docs-callout-label {
  color: var(--accent);
}

.docs-callout-neutral {
  border-color: var(--line-strong);
  background: var(--surface);
}

.docs-callout-neutral .docs-callout-label {
  color: var(--muted);
}

.docs-callout-warning {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.docs-callout-warning .docs-callout-label {
  color: var(--amber);
}

.docs-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 42px;
  border: 1px solid var(--line);
  background: var(--line);
}

.docs-flow-step {
  min-width: 0;
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
  padding: 18px;
  background: var(--surface-raised);
}

.docs-flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 1;
  top: 17px;
  right: -10px;
  width: 18px;
  color: var(--accent);
  background: var(--surface-raised);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: center;
}

.docs-flow-step span,
.docs-steps > li > span,
.docs-investigation-flow > li > span,
.docs-architecture-flow span,
.docs-layer-number {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.docs-flow-step strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.docs-flow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.docs-steps,
.docs-investigation-flow,
.docs-limitations,
.docs-inline-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-steps {
  display: grid;
  margin-top: 32px;
  border-top: 1px solid var(--line-strong);
}

.docs-steps > li {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.docs-steps h3,
.docs-investigation-flow strong,
.docs-risk-grid h3,
.docs-architecture-grid h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.docs-steps p,
.docs-investigation-flow p,
.docs-risk-grid p,
.docs-architecture-grid p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.docs-ui-example {
  max-width: 780px;
  margin-top: 34px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: var(--elevation-raised);
}

.docs-ui-example-top,
.docs-receipt-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
}

.docs-status {
  color: var(--accent);
}

.docs-example-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.docs-example-control div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.docs-example-control strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.87rem;
}

.docs-example-control code {
  color: var(--faint);
  font-size: 0.63rem;
}

.docs-example-control a,
.docs-incident-card footer a,
.docs-receipt-footer a,
.docs-alert-card a,
.docs-source-row a {
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.docs-example-control a:hover,
.docs-incident-card footer a:hover,
.docs-receipt-footer a:hover,
.docs-alert-card a:hover,
.docs-source-row a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.docs-ui-example > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.6;
}

.docs-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-raised);
}

.docs-table-wrap:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

.docs-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

.docs-table caption {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.docs-table th,
.docs-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.docs-table thead th {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.docs-table tbody tr:last-child th,
.docs-table tbody tr:last-child td {
  border-bottom: 0;
}

.docs-table tbody th {
  width: 25%;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: -0.02em;
}

.docs-table td {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.docs-muted-note {
  max-width: 780px;
  margin: 22px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.6;
}

.docs-incident-card {
  max-width: 780px;
  overflow: hidden;
  margin-top: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: var(--elevation-raised);
}

.docs-incident-card > header,
.docs-incident-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
}

.docs-incident-card > header {
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
}

.docs-incident-card > header div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.docs-risk {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.docs-risk.info {
  color: var(--accent);
  background: var(--accent-soft);
}

.docs-risk.suspicious {
  color: var(--amber);
  background: var(--amber-soft);
}

.docs-risk.high {
  color: var(--red);
  background: var(--red-soft);
}

.docs-incident-title {
  display: grid;
  gap: 10px;
  padding: 28px 20px 24px;
}

.docs-incident-title > span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.docs-incident-title h3 {
  max-width: 600px;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.docs-incident-title p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.6;
}

.docs-incident-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.docs-incident-card dl div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 15px 12px 15px 0;
}

.docs-incident-card dl div + div {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.docs-incident-card dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.docs-incident-card > footer {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.61rem;
}

.docs-investigation-flow {
  max-width: 780px;
  display: grid;
  margin-top: 32px;
  border-top: 1px solid var(--line-strong);
}

.docs-investigation-flow > li {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 20px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.docs-investigation-flow > li:not(:last-child)::after {
  content: "↓";
  position: absolute;
  bottom: -12px;
  left: 16px;
  z-index: 1;
  width: 15px;
  color: var(--accent);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: center;
}

.docs-risk-grid {
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 32px;
}

.docs-risk-grid article {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
}

.docs-risk-grid h3 {
  font-size: 1rem;
}

.docs-risk-grid code {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.58rem;
  overflow-wrap: anywhere;
}

.docs-receipt-card {
  max-width: 780px;
  overflow: hidden;
  margin-top: 34px;
  padding: 21px;
  border: 1px solid #6a9a7f;
  border-radius: 18px;
  color: #e7f5eb;
  background: #0b5038;
  box-shadow: 12px 12px 0 var(--line);
}

.docs-receipt-top {
  color: #a6c8b1;
}

.docs-section .docs-receipt-id {
  display: block;
  margin: 28px 0 22px;
  color: #f2fff5;
  font-family: var(--mono);
  font-size: 0.67rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.docs-receipt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgb(255 255 255 / 0.2);
}

.docs-receipt-grid div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.2);
}

.docs-receipt-grid div:nth-child(3n + 2),
.docs-receipt-grid div:nth-child(3n + 3) {
  padding-left: 12px;
  border-left: 1px solid rgb(255 255 255 / 0.2);
}

.docs-receipt-grid dt {
  color: #9fc2ab;
}

.docs-receipt-grid dd {
  min-width: 0;
  margin: 0;
  color: #f2fff5;
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.docs-receipt-grid code {
  color: inherit;
}

.docs-receipt-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  color: #9fc2ab;
  font-family: var(--mono);
  font-size: 0.59rem;
}

.docs-receipt-footer a {
  color: #b9f1ca;
}

.docs-inline-list {
  max-width: 780px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.63rem;
}

.docs-inline-list li::before {
  content: "✓";
  margin-right: 7px;
  color: var(--accent);
}

.docs-architecture-flow {
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-top: 34px;
  border: 1px solid var(--line);
  background: var(--line);
}

.docs-architecture-flow > div {
  min-width: 0;
  position: relative;
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 164px;
  padding: 16px;
  background: var(--surface-raised);
}

.docs-architecture-flow > div:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 16px;
  right: -10px;
  z-index: 1;
  width: 18px;
  color: var(--accent);
  background: var(--surface-raised);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-align: center;
}

.docs-architecture-flow strong {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.06em;
}

.docs-architecture-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.55;
}

.docs-architecture-grid {
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.docs-architecture-grid article {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
}

.docs-layer-number {
  color: var(--accent);
}

.docs-architecture-grid h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.docs-source-row {
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.docs-alert-card {
  max-width: 610px;
  display: grid;
  gap: 10px;
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: var(--elevation-raised);
}

.docs-alert-card > div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.docs-alert-card strong {
  color: var(--ink);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.docs-alert-card p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.docs-alert-card a {
  width: fit-content;
  margin-top: 7px;
}

.docs-limitations {
  max-width: 780px;
  display: grid;
  margin-top: 32px;
  border-top: 1px solid var(--line-strong);
}

.docs-limitations li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.docs-limitations strong {
  color: var(--ink);
}

.docs-faq {
  max-width: 780px;
  margin-top: 32px;
  border-top: 1px solid var(--line-strong);
}

.docs-faq details {
  border-bottom: 1px solid var(--line);
}

.docs-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  list-style: none;
}

.docs-faq summary::-webkit-details-marker {
  display: none;
}

.docs-faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 400;
}

.docs-faq details[open] summary::after {
  content: "−";
}

.docs-faq p {
  max-width: 680px;
  margin: -2px 0 20px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.docs-faq a {
  color: var(--accent);
  font-weight: 750;
}

.docs-toc {
  min-width: 0;
  position: sticky;
  top: 110px;
  align-self: start;
  display: grid;
  gap: 3px;
  padding-top: 76px;
}

.docs-toc > span {
  display: block;
  margin-bottom: 12px;
}

.docs-toc a {
  padding: 6px 8px;
  font-size: 0.62rem;
}

.docs-footer .footer-inner {
  width: min(1440px, calc(100% - 72px));
}

html[data-theme="dark"] .docs-sidebar-nav a[aria-current="true"],
html[data-theme="dark"] .docs-toc a[aria-current="true"] {
  background: var(--accent-soft);
}

html[data-theme="dark"] .docs-example-control {
  background: var(--surface);
}

html[data-theme="dark"] .docs-receipt-card {
  box-shadow: 12px 12px 0 #273229;
}

@media (max-width: 1180px) {
  .docs-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-shell {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 34px;
  }

  .docs-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .docs-header-meta {
    max-width: 460px;
  }

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

  .docs-flow-step:not(:last-child)::after {
    display: none;
  }

  .docs-architecture-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .docs-architecture-flow > div:not(:last-child)::after {
    display: none;
  }

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

@media (max-width: 760px) {
  .docs-masthead .nav-frame,
  .docs-shell,
  .docs-footer .footer-inner {
    width: min(100% - 36px, 1440px);
  }

  .docs-sidebar {
    display: none;
  }

  .docs-shell {
    display: block;
    padding-top: 30px;
  }

  .docs-mobile-nav {
    display: block;
    margin-bottom: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-raised);
  }

  .docs-mobile-nav summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    color: var(--ink);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    list-style: none;
  }

  .docs-mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .docs-mobile-nav[open] summary {
    border-bottom: 1px solid var(--line);
  }

  .docs-mobile-nav nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    padding: 10px;
  }

  .docs-mobile-nav a {
    padding: 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.72rem;
    text-decoration: none;
  }

  .docs-mobile-nav a[aria-current="true"] {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 800;
  }

  .docs-content-grid {
    display: block;
  }

  .docs-section {
    padding: 62px 0;
  }

  .docs-section-last {
    padding-bottom: 0;
  }
}

@media (max-width: 560px) {
  .docs-masthead .nav-frame,
  .docs-shell,
  .docs-footer .footer-inner {
    width: min(100% - 28px, 1440px);
  }

  .docs-nav-frame .nav-source {
    display: none;
  }

  .docs-header {
    padding-bottom: 42px;
  }

  .docs-header h1 {
    font-size: clamp(3rem, 15vw, 4.4rem);
  }

  .docs-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .docs-header-actions > * {
    width: 100%;
  }

  .docs-header-meta {
    grid-template-columns: 1fr 1fr;
  }

  .docs-flow,
  .docs-architecture-flow,
  .docs-architecture-grid,
  .docs-risk-grid {
    grid-template-columns: 1fr;
  }

  .docs-flow-step,
  .docs-architecture-flow > div {
    min-height: auto;
  }

  .docs-example-control,
  .docs-incident-card > footer,
  .docs-receipt-footer,
  .docs-source-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-incident-card dl,
  .docs-receipt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-incident-card dl div:nth-child(3),
  .docs-receipt-grid div:nth-child(3n + 1) {
    padding-left: 0;
    border-left: 0;
  }

  .docs-incident-card dl div:nth-child(3),
  .docs-incident-card dl div:nth-child(4),
  .docs-receipt-grid div:nth-child(3),
  .docs-receipt-grid div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .docs-receipt-grid div:nth-child(3n + 2),
  .docs-receipt-grid div:nth-child(3n + 3) {
    padding-left: 0;
    border-left: 0;
  }

  .docs-receipt-grid div:nth-child(even) {
    padding-left: 12px;
    border-left: 1px solid rgb(255 255 255 / 0.2);
  }

  .docs-incident-card > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-mobile-nav nav {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .docs-page * {
    transition-duration: 0.01ms !important;
  }
}
