@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/static/fonts/dm-mono-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --canvas: #160a10;
  --paper: #231018;
  --raised: #2e1720;
  --deep: #1b0b13;
  --ink: #fcf6f2;
  --muted: #c1aeb5;
  --rule: #533340;
  --input-rule: #8b6372;
  --accent: #ee9aaf;
  --mint: #94cece;
  --primary: #8b1235;
  --primary-rule: #bc4666;
  --primary-hover: #aa244b;
  --error: #ffb4c7;
  --warn: #f4c690;
  --display: system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "DM Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 var(--body); }
::selection { color: white; background: #9b3351; }
button, input, textarea, select { font: inherit; }
button, a, select, [type="checkbox"] { cursor: pointer; }
button:disabled, [disabled] { cursor: not-allowed; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.16; letter-spacing: -.035em; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.55rem); font-weight: 450; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; font-weight: 600; }
h3 { font-size: 1.04rem; font-weight: 650; }
p + p { margin-top: .5rem; }
code, pre { font-family: var(--mono); font-size: .83rem; overflow-wrap: anywhere; }
pre { margin: 0; padding: 1rem; background: var(--deep); color: var(--ink); border: 1px solid var(--rule); border-radius: 9px; white-space: pre-wrap; overflow: auto; }
summary { color: var(--accent); font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.stack > * + * { margin-top: .9rem; }
.rows, .columns, .flow { display: grid; gap: 1.75rem; }
.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields, .actions, .labels { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.fields { gap: 1rem; align-items: stretch; }
.fields > * { flex: 1 1 14rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; border-radius: 7px; border: 1px solid var(--rule); padding: .55rem .85rem; background: var(--paper); color: var(--ink); font-weight: 670; line-height: 1.25; text-align: center; text-decoration: none; }
.button:hover:not(:disabled) { border-color: var(--input-rule); background: var(--raised); }
.button.primary { background: var(--primary); color: white; border-color: var(--primary-rule); }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.button.danger { color: var(--error); }
.button:disabled { background: var(--deep); border-color: var(--rule); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 500; padding: .15rem 0; color: var(--muted); line-height: 1.4; }
.pill.good { color: var(--mint); }
.pill.warn { color: var(--warn); }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .85rem; min-height: 4.55rem; padding: .7rem clamp(1rem, 3vw, 2.4rem); background: var(--canvas); border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--body); font-size: 1.32rem; font-weight: 450; letter-spacing: -.055em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand strong { font-weight: 800; }
.brand strong:first-child, .brand-dot { color: var(--accent); }
.brand strong:nth-child(2) { color: var(--mint); }
.top-controls { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
.top select { max-width: min(40vw, 25rem); }
.frame { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: calc(100dvh - 4.55rem); }
.sidebar { padding: 1.8rem 1rem; background: var(--canvas); }
.sidebar nav { display: grid; gap: .28rem; position: sticky; top: 6.1rem; }
.sidebar a { display: flex; align-items: center; gap: .65rem; color: var(--muted); text-decoration: none; padding: .62rem .7rem; border-radius: 7px; font-weight: 620; }
.sidebar a:hover { background: var(--raised); color: var(--ink); }
.sidebar a[aria-current="page"] { background: #2a151e; color: var(--ink); }
.sidebar a span:first-child { display: none; }
.sidebar .nav-section { margin: 1.25rem .7rem .2rem; color: var(--muted); font-size: .74rem; font-weight: 700; }
.workspace { width: min(100%, 1420px); margin: auto; padding: clamp(1rem, 4vw, 3.2rem); align-self: start; }
.workspace { margin-top: 0; }
.page-head { max-width: 72ch; margin-bottom: 2rem; }
.page-head > * + * { margin-top: .55rem; }
.page-head p { font-size: .94rem; }
.card { border-top: 1px solid #3e2630; padding: 1.5rem 0; min-width: 0; overflow-wrap: anywhere; }
.board { color: var(--ink); padding: 1.5rem 0; border-top: 1px solid #3e2630; }

.board p { color: var(--muted); }
.board .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.node { display: block; min-width: 0; padding: .6rem 0; color: var(--ink); text-decoration: none; }
.node:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }

.node strong, .node small { display: block; }
.node strong { font-size: .91rem; font-weight: 550; margin-bottom: .3rem; overflow-wrap: anywhere; }
.node small { color: var(--muted); }
.node-index { display: none; }
.node.complete .node-index { border-color: var(--mint); background: var(--mint); }
.item { padding: .8rem 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.item details { margin-top: .6rem; }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; }
label { display: block; font-weight: 650; }
input:not([type="checkbox"]), textarea, select { width: 100%; margin-top: .25rem; padding: .5rem .64rem; min-height: 2.55rem; background: var(--paper); color: var(--ink); border: 1px solid var(--input-rule); border-radius: 7px; }
.top select { width: auto; margin: 0; border-radius: 7px; }
textarea { min-height: 6.3rem; resize: vertical; }
input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--mint); margin: 0; flex: 0 0 auto; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-weight: 550; }
fieldset { border: 1px solid var(--rule); border-radius: 8px; padding: .7rem; min-width: 0; }
fieldset > label + label { margin-top: .45rem; }
legend { font-weight: 650; }
.form-error { padding: .65rem .8rem; border: 1px solid var(--primary-rule); border-radius: 8px; color: var(--error); background: #361520; }
.notice { position: fixed; z-index: 4; right: 1rem; bottom: 1rem; max-width: min(calc(100% - 2rem), 32rem); background: var(--raised); border: 1px solid var(--input-rule); color: var(--ink); border-radius: 9px; padding: .65rem .9rem; box-shadow: 0 6px 24px #0702058c; pointer-events: none; }
.notice:empty { display: none; }
.chat-message { background: var(--raised); border: 1px solid var(--rule); border-radius: 9px; padding: .85rem; }
.chat-message.user { background: #351421; }
.transcript { max-height: 34rem; overflow: auto; }
.secret { border-color: #557779; background: #1e2728; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .85rem; margin-inline: 0; }
.budget-grid > div { padding: .6rem 0; min-width: 0; }
.budget-grid dt { color: var(--muted); font-size: .83rem; }
.budget-grid dd { margin: .23rem 0 0; font: 400 .92rem/1.6 var(--mono); font-variant-numeric: tabular-nums; }
.skip { position: absolute; z-index: 5; left: 1rem; top: 1rem; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 1080px) {
  .frame { grid-template-columns: 190px minmax(0, 1fr); }
  .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .node:nth-child(2)::after { display: none; }
}
@media (max-width: 720px) {
  .top { position: static; align-items: flex-start; flex-wrap: wrap; }
  .top-controls { justify-content: flex-start; }
  .top select { max-width: 67vw; }
  .frame { display: block; }
  .sidebar { padding: .45rem .65rem; border-right: 0; border-bottom: 1px solid var(--rule); }
  .sidebar nav { display: flex; overflow-x: auto; position: static; }
  .sidebar a { flex: none; white-space: nowrap; }
  .sidebar .nav-section { display: none; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .board .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .board .flow { grid-template-columns: minmax(0, 1fr); }
  .node::after { display: none; }
}

.top-controls .quiet { background: transparent; border-color: transparent; font-weight: 500; color: var(--muted); }
.top-controls .quiet:hover { color: var(--ink); background: transparent; }
.page-head .actions { column-gap: 1rem; }

.welcome, .journey { width: min(100%, 920px); margin-inline: auto; padding: clamp(1.3rem, 5vw, 4rem); }
.welcome-hero { min-height: 23rem; display: flex; flex-direction: column; justify-content: center; padding: clamp(1.4rem, 5vw, 3.4rem); }
.welcome-hero h1 { font-size: clamp(2.65rem, 6.5vw, 4.75rem); max-width: 15ch; font-weight: 350; }
.welcome-hero em { color: var(--accent); font-style: normal; }
.welcome-hero p { max-width: 52ch; font-size: 1.08rem; }
.welcome-hero .actions { margin-top: 1.45rem; }
.welcome-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--rule); }
.welcome-flow > div { padding: 1.25rem 1rem; }
.welcome-flow > div + div { border-inline-start: 1px solid var(--rule); }
.welcome-flow p { font-size: .9rem; }
.journey { width: min(100%, 760px); }
.auth-form { padding-top: clamp(2rem, 7vw, 4.8rem); }
.journey .page-head { margin-bottom: .35rem; }
.auth-form .page-head { margin-bottom: 1.15rem; }
.journey-progress { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.35rem; list-style: none; padding: 0; margin: 0 0 .55rem; }
.journey-progress li { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .82rem; }
.journey-progress li span { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 1px solid var(--rule); border-radius: 50%; font: 400 .75rem var(--mono); }
.journey-progress [aria-current="step"] { color: var(--accent); font-weight: 750; }
.journey-progress [aria-current="step"] span { border-color: var(--accent); }
.journey-progress .done span { color: var(--mint); border-color: var(--mint); }
.text-link { display: inline-block; text-underline-offset: .24em; font-weight: 650; }
.model-choice { display: grid; gap: .6rem; }
.model-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .75rem; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; }
.model-option + .model-option { margin-top: 0; }
.model-option:has(input:checked) { background: var(--raised); border-color: var(--accent); }
.model-option > span > small { display: block; margin-top: .18rem; font-weight: 500; }
.model-option input[type="radio"] { width: 1rem; min-height: 1rem; margin: 0; accent-color: var(--mint); cursor: pointer; }
.model-help { border-inline-start: 2px solid var(--accent); padding: .2rem 0 .4rem .9rem; }
.preparation-list { padding-inline-start: 1.45rem; }
.preparation-list li + li { margin-block-start: .75rem; }
.preparation-list li::marker { color: var(--accent); font-family: var(--mono); }
@media (max-width: 560px) {
  .welcome-hero { min-height: 19rem; }
  .welcome-flow { grid-template-columns: minmax(0, 1fr); }
  .welcome-flow > div + div { border-inline-start: none; border-block-start: 1px solid var(--rule); }
  .model-option { grid-template-columns: auto minmax(0, 1fr); }
  .model-option > .pill { grid-column: 2; justify-self: start; }
}
