@font-face {
  font-family: Inter;
  src: url("inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("plex-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #111017;
  --surface: #181720;
  --surface-high: #211e2c;
  --text: #f8f7fc;
  --muted: #c9c4d4;
  --accent: #d4baff;
  --line: #8f78be;
  --border: #635676;
  --ink: #151321;
  --light: #f9f8fe;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 67% 5%, #22193252 0%, transparent 33rem),
    repeating-linear-gradient(119deg, transparent 0 43px, #b394f404 52px, transparent 69px 125px),
    var(--background);
  color: var(--text);
  font: 400 1rem/1.52 Inter, system-ui, sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #bd9aff; outline-offset: 4px; }
[hidden] { display: none !important; }

h1, h2, h3, p, ol, ul, dl, dd, pre { margin: 0; }
h1, h2, h3 { font-weight: 750; line-height: 1.03; letter-spacing: -.045em; }
h2 { font-size: clamp(1.9rem, 3.3vw, 3.05rem); }
h3 { font-size: 1.12rem; letter-spacing: -.025em; }
p { text-wrap: pretty; }

.wrap { width: min(100% - var(--gutter) * 2, 1220px); margin-inline: auto; }
.section-line { border-top: 1px solid var(--line); }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  display: inline-block;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skip-link { position: fixed; z-index: 10; left: 1rem; top: 1rem; transform: translateY(-200%); background: #e5d7ff; color: var(--ink); padding: .6rem 1rem; border-radius: .4rem; }
.skip-link:focus { transform: none; }

.topbar {
  min-height: 4.8rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  position: relative;
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.brand { display: inline-flex; width: fit-content; align-items: center; gap: .65rem; white-space: nowrap; font-size: 1.55rem; line-height: 1; font-weight: 700; letter-spacing: -.05em; }
.brand img { width: 2.05rem; height: auto; }
.main-nav { display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.main-nav a { padding-block: .65rem; }
.main-nav a:hover, .footer nav a:hover, .footer nav button:hover { color: var(--accent); }

.button {
  border: 1px solid #c1a3ff;
  border-radius: .48rem;
  color: #110b1c;
  background:
    repeating-linear-gradient(95deg, transparent 0 18px, #fff1 23px, transparent 33px),
    linear-gradient(102deg, #a080fa, #ba9bff 51%, #a180f2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 2.75rem;
  padding: .53rem 1rem;
  font-weight: 680;
  line-height: 1.15;
  box-shadow: inset 0 1px 0 #fff3, 0 3px 10px #08061129;
  transition: filter .18s, transform .18s, box-shadow .18s;
}
.button:hover { filter: brightness(1.14); box-shadow: 0 0 1rem #c193ff38; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .65; cursor: progress; }
.button-top { justify-self: end; min-width: 9.1rem; font-size: .92rem; }
.nav-toggle { display: none; }

.hero { position: relative; overflow: clip; isolation: isolate; }
.hero-grid {
  position: absolute;
  inset: auto -35% -1rem;
  z-index: -1;
  height: 10rem;
  background-image: linear-gradient(#a075eea8 1px, transparent 1px), linear-gradient(90deg, #a075eea8 1px, transparent 1px);
  background-size: 100% 2.7rem, 4.5rem 100%;
  transform: perspective(12rem) rotateX(44deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(transparent, #000 73%);
  opacity: .82;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, .99fr) minmax(0, 2.07fr);
  align-items: center;
  gap: clamp(1.25rem, 3.1vw, 2.7rem);
  padding-block: clamp(3rem, 5.8vw, 5.35rem) clamp(3rem, 5.4vw, 4.85rem);
}
.eyebrow { color: var(--accent); font: 400 clamp(.78rem, 1.4vw, 1rem)/1.3 var(--mono); margin-bottom: 1.25rem; }
h1 { font-size: clamp(2.6rem, 4.2vw, 4.2rem); line-height: .99; letter-spacing: -.066em; }
.hero-description { margin-top: 1.15rem; color: var(--muted); }
.button-hero { margin-top: 1.55rem; padding-inline: 1.35rem; min-height: 3rem; }

.workbench {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, .28fr) minmax(0, .72fr);
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid #9d86c5;
  border-radius: .8rem;
  overflow: hidden;
  background: #16151dee;
  box-shadow: 0 20px 48px #08050b55, inset 0 1px 0 #fff1;
}
.file-tree { padding: .85rem .55rem; border-right: 1px solid #454051; color: #e4deec; font-family: var(--mono); font-size: clamp(.65rem, 1vw, .84rem); }
.file-tree > div { min-width: 0; min-height: 2rem; padding-inline: .42rem; display: flex; align-items: center; gap: .45rem; border-radius: .25rem; white-space: nowrap; }
.file-tree .icon { inline-size: .96rem; block-size: .96rem; }
.tree-folder { gap: .25rem !important; }
.tree-expander { inline-size: .65rem !important; }
.file-tree .tree-file { padding-inline-start: 1.66rem; }
.tree-file.is-current { background: linear-gradient(110deg, #6952aa, #4f3e82); color: #fff; }
.editor { min-width: 0; }
.editor-tabs { display: flex; align-items: end; gap: .16rem; min-width: 0; min-height: 3.2rem; padding: .55rem .6rem 0; border-bottom: 1px solid #454051; overflow-x: auto; }
.editor-tab { padding: .55rem .7rem .6rem; border: 0; border-radius: .4rem .4rem 0 0; background: transparent; color: #c0b5cf; white-space: nowrap; font: 400 clamp(.66rem, 1.12vw, .87rem)/1.15 var(--mono); }
.editor-tab[aria-selected="true"] { color: #fff; background: linear-gradient(100deg, #665194, #48375f); box-shadow: inset 0 1px 0 #fff2; }
.editor-tab:hover { color: #fff; }
.editor-tab:focus-visible { outline-offset: -3px; }
.editor-body { min-height: 15rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(6.3rem, .49fr); }
.code-example { padding: .95rem .75rem .9rem 1rem; min-width: 0; overflow-x: auto; }
.code-lines { counter-reset: code; list-style: none; padding: 0; font: 400 clamp(.7rem, 1.16vw, .92rem)/1.59 var(--mono); }
.code-lines li { display: flex; white-space: pre; min-height: 1.59em; min-width: max-content; }
.code-lines li::before { counter-increment: code; content: counter(code); color: #a49bae; text-align: right; font-size: .86em; margin-right: 1.05em; flex: 0 0 1.15em; }
.code-lines code { font: inherit; }
.syntax-keyword { color: #f395e8; }
.syntax-call { color: #ffe3a5; }
.syntax-string { color: #ffa7a2; }
.syntax-number { color: #b9e8ac; }
.receipt {
  container-type: inline-size;
  min-width: 0;
  margin: .7rem .7rem .7rem 0;
  padding: clamp(.62rem, 1.05vw, .95rem);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "mark tag" "amount amount" "state state";
  align-items: center;
  align-content: space-between;
  gap: .65rem .35rem;
  border: 1px solid #775ca2;
  border-radius: .65rem;
  background:
    repeating-radial-gradient(circle at 108% -8%, transparent 0 18px, #dbc3ff14 18px 19px, transparent 19px 32px),
    radial-gradient(ellipse at 100% 0%, #694597a8, transparent 78%),
    linear-gradient(150deg, #2d2044, #21192f 72%);
  box-shadow: inset 0 1px 0 #e2c9ff26, 0 6px 18px #09051138;
  color: #fbf6ff;
}
.receipt-mark {
  grid-area: mark;
  inline-size: 2.1rem;
  block-size: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid #cdb5fa9e;
  border-radius: .64rem;
  background: linear-gradient(135deg, #f0e3ff, #be9bed);
  color: #342050;
  box-shadow: 0 0 1.15rem #b48bf254;
}
.receipt-mark .icon { inline-size: 1.29rem; block-size: 1.29rem; stroke-width: 2.35; }
.receipt-tag {
  grid-area: tag;
  justify-self: end;
  padding: .17rem .36rem;
  border: 1px solid #bda2e65c;
  border-radius: .3rem;
  background: #332447a1;
  color: #efe0ff;
  font: 400 .64rem/1.25 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.receipt-amount {
  grid-area: amount;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .2rem .38rem;
  color: #f2e4ff;
  font-weight: 760;
  font-size: clamp(1.28rem, 23cqw, 2.55rem);
  line-height: .97;
  letter-spacing: -.068em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.receipt-currency { color: #d1b8ea; font: 400 .65rem/1 var(--mono); letter-spacing: .04em; }
.receipt-state {
  grid-area: state;
  width: 100%;
  border-top: 1px solid #9a77c166;
  padding-top: .6rem;
  color: #f2e7fb;
  font-size: clamp(.71rem, 1vw, .86rem);
  font-weight: 630;
  line-height: 1.28;
  letter-spacing: -.022em;
}
.editor-status { grid-column: 1/-1; min-width: 0; display: flex; align-items: center; padding: .6rem .9rem; color: #dcd3e7; border-top: 1px solid #454051; font: 400 clamp(.61rem, 1.1vw, .8rem)/1.2 var(--mono); }
.editor-status span { display: inline-flex; align-items: center; gap: .5rem; padding-inline: .85rem; border-left: 1px solid #5b5069; white-space: nowrap; }
.editor-status span:first-child { padding-left: 0; border-left: 0; }
.editor-status i { inline-size: .65rem; block-size: .65rem; border-radius: 50%; background: #a47df6; }

.stages { padding: 2rem 0 2.25rem; }
.stage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; padding: 0; margin-top: 1.45rem; }
.stage-grid li { position: relative; padding-inline: clamp(.8rem, 2.25vw, 1.75rem); border-left: 1px solid #51435f; }
.stage-grid li:first-child { border: 0; padding-left: .4rem; }
.stage-grid li:last-child { padding-right: 0; }
.stage-heading { display: flex; gap: .7rem; align-items: center; }
.stage-heading .icon { color: var(--accent); inline-size: 2rem; block-size: 2rem; }
.stage-grid p { margin-top: .45rem; color: var(--muted); font-size: .94rem; max-width: 15rem; }
.stage-grid li:not(:last-child) p { padding-right: 1.2rem; }
.stage-arrow { position: absolute; right: .6rem; top: 45%; color: var(--accent); inline-size: 1.1rem; block-size: 1.1rem; }

.light-panel { color-scheme: light; background: linear-gradient(110deg, #fff, #f6f4fb 92%); color: var(--ink); border: 1px solid #fff; border-radius: .85rem; box-shadow: 0 3px 18px #0806112e; }
.policy-panel { display: grid; grid-template-columns: minmax(0, .87fr) minmax(0, 1fr) minmax(0, .82fr); gap: clamp(.85rem, 2.25vw, 2rem); padding: clamp(1.05rem, 2.7vw, 2.05rem); margin-bottom: 1.55rem; align-items: stretch; }
.policy-copy { padding: .35rem 1rem .4rem 0; border-right: 1px solid #cdc5df; }
.policy-copy h2 { font-size: clamp(1.85rem, 3.15vw, 2.8rem); }
.policy-copy p { margin-top: .8rem; max-width: 17.5rem; color: #333043; }
.policy-json { min-width: 0; border: 1px solid #c6bfdd; border-radius: .55rem; background: #f8f7fc; padding: .7rem .55rem; overflow-x: auto; }
.policy-json .code-lines { font-size: clamp(.72rem, 1.27vw, .96rem); line-height: 1.46; }
.policy-json li::before { color: #635c77; }
.json-key { color: #a62b4a; }
.json-number { color: #1c6847; }
.json-bool { color: #6541bb; }
.policy-summary { padding: .95rem; border-radius: .6rem; background: linear-gradient(135deg, #e8ddfd, #e0d5f8); }
.policy-summary h3, .settlement-card h3 { font-size: clamp(1.18rem, 1.9vw, 1.55rem); font-weight: 800; }
.policy-summary h3 { padding-bottom: .55rem; border-bottom: 1px solid #bcb0d7; }
.policy-summary ul { margin-top: .55rem; padding: 0; list-style: none; display: grid; gap: .5rem; }
.policy-summary li { display: flex; align-items: start; gap: .55rem; font-size: .91rem; }
.policy-summary .icon { stroke-width: 2; }

.split-section { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.68fr); gap: clamp(1.15rem, 3.2vw, 3rem); align-items: start; padding-block: 1.85rem; }
.section-copy { padding-top: .22rem; }
.section-copy h2 { font-size: clamp(1.9rem, 3.1vw, 2.75rem); }
.settlement, .exceptions { grid-template-columns: minmax(0, .93fr) minmax(0, 1.57fr); }
.section-copy p { margin-top: .8rem; max-width: 26ch; color: var(--muted); }
.task-card, .control-card, .resource-card, .exception-table, .log-window { background: linear-gradient(120deg, #1d1b26, #16151e); border: 1px solid var(--border); border-radius: .72rem; }
.task-card { min-width: 0; padding: .9rem 1.05rem; }
.task-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .85rem; padding-bottom: .9rem; }
.task-icon { inline-size: 2.75rem; block-size: 2.75rem; display: grid; place-items: center; color: var(--accent); background: #30283d; border-radius: .45rem; }
.task-icon .icon { inline-size: 1.45rem; block-size: 1.45rem; }
.task-copy p { margin-top: .23rem; color: var(--muted); font-size: .85rem; }
.run-button { min-width: 7.5rem; font-size: .88rem; }
.run-button .icon { inline-size: 1rem; block-size: 1rem; }
.expense-table { width: 100%; font-size: .9rem; border-spacing: 0; }
.expense-table :is(th, td) { padding: .59rem .6rem; text-align: left; }
.expense-table thead th { color: #ddd6e8; font-size: .8rem; font-weight: 500; border-top: 1px solid #625671; }
.expense-table :is(th, td):last-child { text-align: right; white-space: nowrap; }
.expense-table tbody th { font-weight: 600; text-align: left; }
.expense-table tbody th span { display: inline-flex; align-items: center; gap: .65rem; }
.expense-table tbody :is(td, th) { border-top: 1px solid #413a4c; }
.expense-table tbody td { color: #d5cfe0; }
.expense-table tbody td:last-child { font-family: var(--mono); color: var(--text); }
.expense-table .icon { color: var(--accent); }
.expense-table tfoot :is(th, td) { background: #353047; border-block: 1px solid #584d6d; font-weight: 700; }
.expense-table tfoot th { border-left: 1px solid #584d6d; border-radius: .35rem 0 0 .35rem; }
.expense-table tfoot td { border-right: 1px solid #584d6d; border-radius: 0 .35rem .35rem 0; font-size: 1rem; }
.task-message { padding: .65rem .15rem .1rem; font-size: .89rem; color: #d2befa; }
.task-message[data-tone="hold"] { color: #ffdbad; }

.controls { padding-block: 1.75rem; }
.controls-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, .88fr) minmax(0, 1.19fr) minmax(0, .8fr); gap: .85rem; margin-top: 1rem; align-items: start; }
.controls-grid > p { color: var(--muted); max-width: 25ch; padding-right: .3rem; }
.control-card { min-width: 0; padding: .85rem; min-height: 6rem; }
.control-card > label, .control-label { display: block; font-size: .9rem; line-height: 1.2; font-weight: 650; margin-bottom: .66rem; }
.currency-input, .allowlist summary { display: flex; align-items: center; gap: .45rem; min-width: 0; min-height: 2.5rem; padding: .2rem .62rem; border: 1px solid #887b9b; border-radius: .4rem; color: var(--text); background: #2a2634; }
.currency-input:focus-within { outline: 2px solid #b590f2; outline-offset: 2px; }
.currency-input input { width: 100%; min-height: 2rem; color: inherit; padding: 0; outline: 0; border: 0; background: transparent; appearance: textfield; }
.currency-input input::-webkit-inner-spin-button, .currency-input input::-webkit-outer-spin-button { appearance: none; }
.field-error { color: #ffc8b8; font-size: .82rem; margin-top: .45rem; }
.allowlist { position: relative; }
.allowlist summary { list-style: none; cursor: pointer; justify-content: space-between; font-size: .85rem; }
.allowlist summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.allowlist summary .icon { inline-size: .9rem; block-size: .9rem; }
.allowlist[open] summary .icon { transform: rotate(180deg); }
.allowlist-options { position: absolute; z-index: 2; right: 0; left: 0; top: calc(100% + .35rem); padding: .4rem; border: 1px solid #887b9b; background: #211d2d; border-radius: .42rem; box-shadow: 0 .65rem 1.75rem #080611b3; }
.allowlist-options label { min-height: 2.45rem; display: flex; align-items: center; gap: .55rem; padding-inline: .35rem; cursor: pointer; border-radius: .25rem; font-size: .88rem; }
.allowlist-options label:hover { background: #342a47; }
.allowlist-options input { accent-color: #b498f7; inline-size: 1rem; block-size: 1rem; }
.switch-row { display: flex; align-items: center; gap: .65rem; min-height: 2.5rem; font-size: .88rem; }
.switch { display: flex; align-items: center; border: 1px solid #876ab2; border-radius: 2rem; background: #31253f; inline-size: 3.15rem; block-size: 1.6rem; padding: .14rem; transition: background .18s; }
.switch span { inline-size: 1.2rem; block-size: 1.2rem; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch[aria-checked="true"] { background: #ad83f4; }
.switch[aria-checked="true"] span { transform: translateX(1.48rem); }

.settlement-card { padding: 1rem 1.3rem; }
.settlement-card h3 { padding-bottom: .7rem; border-bottom: 1px solid #d1c8e0; }
.settlement-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-block: .95rem; border-bottom: 1px solid #d1c8e0; }
.settlement-metrics div { display: flex; flex-direction: column-reverse; min-width: 0; padding-left: clamp(.6rem, 2vw, 1.35rem); border-left: 1px solid #c1b5d5; }
.settlement-metrics div:first-child { border: 0; padding-left: .2rem; }
.settlement-metrics dd { color: #623dd2; font-size: clamp(1.55rem, 3.4vw, 2.65rem); line-height: 1; font-weight: 790; letter-spacing: -.05em; }
.settlement-metrics dt { font-weight: 650; line-height: 1.2; margin-top: .2rem; }
.settlement-card > p { color: #60566e; margin-top: .65rem; font-size: .87rem; }
.exception-table { overflow: hidden; }
.exception-table div { display: grid; grid-template-columns: 1fr 1fr; }
.exception-table div + div { border-top: 1px solid #645673; }
.exception-table :is(dt,dd) { padding: .62rem 1rem; }
.exception-table dt { display: flex; align-items: center; gap: .7rem; font-weight: 650; }
.exception-table dt .icon { color: var(--accent); inline-size: 1.5rem; block-size: 1.5rem; }
.exception-table dd { border-left: 1px solid #645673; color: var(--muted); font-size: .92rem; }

.developer-band {
  color: #171022;
  background:
    repeating-linear-gradient(104deg, transparent 0 68px, #d9ccfc32 72px, transparent 103px),
    linear-gradient(90deg, #b696f4, #c6adff 44%, #b49af0);
}
.developer-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1.85rem; padding-block: 1.05rem; }
.developer-heading p { border-left: 1px solid #675483; padding: .35rem 0 .35rem 1.85rem; font-weight: 550; }
.resource-grid { gap: 1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-block: 1.35rem; }
.resource-card { padding: 1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .85rem; min-height: 7rem; color: var(--text); text-align: left; transition: background .18s, border-color .18s; }
.resource-card:hover { background: #282035; border-color: #b69be0; }
.resource-card .icon { color: var(--accent); inline-size: 2rem; block-size: 2rem; }
.resource-card strong { display: block; font-size: 1.02rem; font-weight: 690; }
.resource-card small { display: block; margin-top: .35rem; color: var(--muted); font-size: .87rem; line-height: 1.4; }
.log-section { padding-block: 1.3rem 1.5rem; }
.log-window { margin-top: .9rem; padding: .7rem .8rem; max-height: 12.5rem; overflow: auto; scrollbar-color: #aa79ef #2b2338; }
.event-log { counter-reset: events; padding: 0; list-style: none; font: 400 .83rem/1.55 var(--mono); }
.event-log li { display: grid; grid-template-columns: 1.65rem 5.4rem minmax(10rem, .64fr) minmax(0, 1fr); gap: .65rem; padding: .15rem .3rem; color: #e6deee; }
.event-log li::before { content: counter(events, decimal-leading-zero); counter-increment: events; color: #a59bb7; }
.event-log time { color: var(--accent); }
.event-log strong { font-weight: 400; }
.event-log span { border-left: 1px solid #625671; padding-left: .75rem; color: #d6c9e6; overflow-wrap: anywhere; }

.faq { padding-block: 1.25rem 1.75rem; }
.faq h2 { margin-bottom: .8rem; }
.faq details { border: 1px solid #79698c; border-radius: .52rem; background: linear-gradient(100deg, #1d1a27, #17151e); }
.faq details + details { margin-top: .48rem; }
.faq summary { min-height: 2.9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; padding: .5rem .92rem; font-weight: 650; }
.faq summary:hover { color: var(--accent); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { color: var(--muted); padding: .05rem .92rem .85rem; max-width: 73ch; }
.footer { padding-block: 1.5rem 1.8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer .brand { font-size: 1.28rem; }
.footer .brand img { width: 1.7rem; }
.footer nav { display: flex; gap: 1rem; align-items: center; }
.footer nav > * { padding: .15rem 0; border: 0; background: transparent; color: var(--muted); font-size: .88rem; }
.footer nav > * + * { padding-left: 1rem; border-left: 1px solid #7d6e91; }

.doc-dialog { background: #1e192b; color: var(--text); border: 1px solid #a38ac7; border-radius: .85rem; padding: 0; width: min(36rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); box-shadow: 0 24px 80px #08050dd9; }
.doc-dialog::backdrop { background: #0b0813bd; backdrop-filter: blur(4px); }
.dialog-inner { padding: clamp(1.1rem, 4vw, 1.85rem); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-header h2 { font-size: clamp(1.65rem, 5vw, 2.4rem); }
.close-dialog { display: grid; place-items: center; border-radius: .4rem; border: 1px solid #756290; color: var(--text); background: #302542; inline-size: 2.75rem; block-size: 2.75rem; }
#dialog-content { color: var(--muted); }
#dialog-content > * + * { margin-top: .9rem; }
#dialog-content pre { font: 400 .82rem/1.55 var(--mono); color: #e9d8ff; background: #130f1d; border: 1px solid #625171; border-radius: .55rem; padding: .8rem; overflow: auto; }
#dialog-content code { font: inherit; }

@media (max-width: 1080px) {
  .hero-inner { grid-template-columns: minmax(0, .9fr) minmax(0, 1.85fr); }
  .workbench { grid-template-columns: minmax(0, .26fr) minmax(0, .74fr); }
  .file-tree .tree-file { padding-inline-start: 1.2rem; }
  .editor-body { min-height: 13.9rem; }
  .stage-grid li { padding-inline: .95rem; }
  .stage-arrow { right: .35rem; }
}

@media (max-width: 850px) {
  .hero-inner { grid-template-columns: minmax(0, .8fr) minmax(0, 1.55fr); }
  .desktop-break { display: none; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .file-tree { display: none; }
  .code-example { padding-inline: .7rem .45rem; }
  .policy-panel { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); align-items: stretch; }
  .policy-summary { grid-column: 1/-1; }
  .policy-summary ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr) minmax(0, .85fr); }
  .controls-grid > p { grid-column: 1/-1; max-width: none; }
  .section-copy h2, .developer-heading h2 { font-size: clamp(1.82rem, 4vw, 2.4rem); }
}

@media (max-width: 640px) {
  :root { --gutter: clamp(1rem, 4.6vw, 1.5rem); }
  .topbar { min-height: 4.2rem; grid-template-columns: 1fr auto auto; gap: .6rem; }
  .brand { font-size: 1.25rem; gap: .42rem; }
  .brand img { width: 1.65rem; }
  .button-top { font-size: .77rem; min-width: 0; min-height: 2.5rem; padding-inline: .72rem; }
  .nav-toggle { display: grid; place-items: center; inline-size: 2.5rem; block-size: 2.5rem; border: 1px solid var(--border); border-radius: .45rem; color: var(--text); background: #201a2a; }
  .main-nav { display: none; position: absolute; inset: calc(100% + .4rem) 0 auto; padding: .35rem; background: #201a2b; border: 1px solid #8e70b6; border-radius: .55rem; box-shadow: 0 8px 24px #08051196; }
  .main-nav.is-open { display: grid; gap: 0; }
  .main-nav a { padding: .62rem .75rem; border-radius: .25rem; }
  .main-nav a:hover { background: #37274b; }

  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 1.7rem; padding-block: 2.65rem 2.1rem; }
  h1 { font-size: clamp(2.65rem, 10.2vw, 4.15rem); max-width: 10ch; }
  .desktop-break { display: none; }
  .eyebrow { margin-bottom: .78rem; font-size: .78rem; }
  .hero-description { margin-top: .8rem; }
  .button-hero { margin-top: 1.1rem; }
  .hero-grid { bottom: -1.4rem; transform: perspective(11rem) rotateX(40deg); }
  .editor-tabs { min-height: 2.75rem; gap: .12rem; padding-top: .35rem; }
  .editor-tab { font-size: .76rem; padding-inline: .55rem; min-height: 2.3rem; }
  .editor-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .code-example { min-height: 11.15rem; padding: .7rem .65rem; }
  .code-lines { font-size: .8rem; }
  .receipt {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "mark state amount" "mark tag amount";
    gap: .27rem .64rem;
    margin: 0 .6rem .6rem;
    padding: .56rem .68rem;
    min-height: 3.55rem;
  }
  .receipt-mark { inline-size: 1.97rem; block-size: 1.97rem; border-radius: .56rem; }
  .receipt-mark .icon { inline-size: 1.13rem; block-size: 1.13rem; }
  .receipt-state { padding: 0; border: 0; font-size: .81rem; align-self: end; }
  .receipt-tag { justify-self: start; align-self: start; font-size: .58rem; padding: .08rem .26rem; }
  .receipt-amount { justify-content: end; gap: .2rem; font-size: clamp(1.12rem, 5.65vw, 1.62rem); }
  .receipt-currency { font-size: .55rem; }
  .editor-status { padding: .54rem .68rem; }
  .editor-status span { padding-inline: .57rem; }

  .stages { padding-block: 1.4rem 1.6rem; }
  .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: .95rem; margin-top: .95rem; }
  .stage-grid li { padding: .12rem .85rem; }
  .stage-grid li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stage-grid li:nth-child(even) { padding-right: 0; }
  .stage-grid li:not(:last-child) p { padding-right: 0; }
  .stage-grid p { font-size: .87rem; }
  .stage-arrow { display: none; }
  .stage-heading .icon { inline-size: 1.55rem; block-size: 1.55rem; }
  .stage-heading { gap: .45rem; }
  .stage-heading h3 { font-size: 1.02rem; }

  .policy-panel { grid-template-columns: minmax(0,1fr); padding: .95rem; gap: .8rem; margin-bottom: 1.2rem; }
  .policy-copy { border: 0; padding: .05rem .1rem .15rem; }
  .policy-copy h2 { max-width: 13ch; }
  .policy-copy p { margin-top: .5rem; }
  .policy-summary ul { grid-template-columns: minmax(0, 1fr); gap: .34rem; }
  .policy-json .code-lines { font-size: .82rem; }

  .split-section { grid-template-columns: minmax(0,1fr); gap: .9rem; padding-block: 1.25rem; }
  .section-copy p { max-width: 37ch; margin-top: .48rem; }
  .task-card { padding: .68rem .7rem; }
  .task-header { gap: .55rem; padding-bottom: .6rem; }
  .task-icon { width: 2.25rem; height: 2.25rem; }
  .task-copy h3 { font-size: 1rem; }
  .task-copy p { font-size: .75rem; }
  .run-button { min-width: 0; min-height: 2.7rem; padding-inline: .55rem; font-size: .76rem; gap: .22rem; }
  .run-button .icon { inline-size: .8rem; block-size: .8rem; }
  .expense-table { font-size: .82rem; }
  .expense-table :is(td,th) { padding: .46rem .25rem; }
  .expense-table thead th { font-size: .73rem; }
  .expense-table tbody th span { gap: .24rem; }
  .expense-table .icon { inline-size: .85rem; block-size: .85rem; }
  .expense-table tfoot th { padding-left: .45rem; }
  .expense-table tfoot td { padding-right: .45rem; }

  .controls { padding-block: 1.25rem; }
  .controls-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; margin-top: .6rem; }
  .control-card { padding: .68rem; min-height: 5.5rem; }
  .allowlist-card { grid-row: 3; grid-column: 1/-1; }
  .allowlist-options { position: static; margin-top: .35rem; box-shadow: none; }
  .settlement-card { padding: .85rem; }
  .settlement-metrics dt { font-size: .85rem; }
  .exception-table :is(dt,dd) { padding: .57rem .62rem; font-size: .84rem; }
  .exception-table dt { gap: .38rem; }
  .exception-table dt .icon { inline-size: 1.15rem; block-size: 1.15rem; }

  .developer-heading { grid-template-columns: minmax(0,1fr); gap: .4rem; padding-block: .85rem; }
  .developer-heading p { border: 0; padding: 0; font-size: .9rem; }
  .resource-grid { grid-template-columns: minmax(0,1fr); gap: .55rem; padding-block: .85rem; }
  .resource-card { min-height: auto; padding: .78rem; gap: .65rem; }
  .resource-card .icon { inline-size: 1.6rem; block-size: 1.6rem; }
  .resource-card small { margin-top: .18rem; }
  .log-section { padding-block: 1rem 1.15rem; }
  .log-window { padding: .45rem; max-height: 13rem; }
  .event-log { font-size: .74rem; }
  .event-log li { grid-template-columns: minmax(3.9rem, auto) minmax(0, 1fr); gap: .03rem .42rem; padding: .28rem .32rem; }
  .event-log li + li { border-top: 1px solid #3e344a; }
  .event-log li::before { display: none; }
  .event-log span { grid-column: 2; padding-left: 0; border: 0; }
  .faq { padding-block: 1rem 1.2rem; }
  .faq summary { min-height: 2.85rem; font-size: .91rem; padding-inline: .72rem; }
  .faq details p { font-size: .9rem; padding-inline: .72rem; }
  .footer { flex-direction: column; align-items: start; gap: .7rem; padding-block: 1rem 1.25rem; }
  .footer nav { flex-wrap: wrap; gap: .55rem; }
  .footer nav > * { font-size: .8rem; }
  .footer nav > * + * { padding-left: .55rem; }
}

@media (max-width: 365px) {
  .topbar { gap: .45rem; }
  .brand { font-size: 1.1rem; }
  .brand img { width: 1.45rem; }
  .editor-status span { padding-inline: .42rem; }
  .expense-table thead th:last-child span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
