.gate { display: grid; grid-template-columns: .9fr 1fr; gap: 48px; align-items: center; padding: 70px 0 90px; }
.gate .lede { margin: 18px 0 26px; }
.gate-print { aspect-ratio: .9; }
@media (max-width: 860px) { .gate { grid-template-columns: 1fr; padding-top: 40px; } .gate-print { aspect-ratio: 1.4; } }

.app { display: grid; grid-template-columns: 290px 1fr; gap: 28px; padding: 40px 0 80px; align-items: start; }
@media (max-width: 900px) { .app { grid-template-columns: 1fr; padding-top: 28px; } }
.side { position: sticky; top: 90px; display: grid; gap: 12px; }
@media (max-width: 900px) { .side { position: static; } }
.credits { background: var(--deep); color: var(--paper); border-radius: var(--r-card); padding: 18px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.credits small { display: block; font-size: 13px; color: rgba(243, 239, 228, .6); }
.credits b { font-size: 40px; font-weight: 620; letter-spacing: -.04em; line-height: 1; }
.credits .btn-ink { background: var(--paper); color: var(--deep); }
.new { border: 0; border-radius: 16px; padding: 14px 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-align: left; font-weight: 600; cursor: pointer; }
.new::before { content: "+"; margin-right: 10px; color: var(--blue); }
.new:hover, .new[aria-current] { box-shadow: inset 0 0 0 1.5px var(--blue); }
.list { display: grid; gap: 6px; }
.ag { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; border: 0; background: transparent; border-radius: 16px; padding: 10px; text-align: left; cursor: pointer; }
.ag:hover { background: var(--paper-2); }
.ag[aria-current] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.ag .av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 650; color: var(--paper); background: var(--blue); }
.ag b { display: block; font-weight: 600; line-height: 1.2; }
.ag span { font-size: 13px; color: var(--mute); }
.side-foot { padding: 4px 6px; }

.main { min-width: 0; }
.panel { background: var(--card); border-radius: 26px; box-shadow: 0 0 0 1px var(--line); padding: clamp(18px, 3vw, 32px); }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.02; }
.panel .sub { color: var(--ink-2); margin: 8px 0 0; }
.head { display: flex; justify-content: space-between; gap: 16px; align-items: start; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.tag { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--wash); color: var(--deep); font-weight: 500; }
.tag.off { background: var(--paper-2); color: var(--mute); }

.composer textarea { width: 100%; min-height: 120px; border: 0; outline: 0; resize: vertical; background: var(--paper); border-radius: 18px; padding: 16px; font-size: 18px; line-height: 1.45; margin: 18px 0 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }

.form { display: grid; gap: 16px; margin-top: 22px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form .two { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; border: 0; outline: 0; background: var(--paper); border-radius: 12px; padding: 11px 13px; font-size: 15px; box-shadow: inset 0 0 0 1px transparent; }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: inset 0 0 0 1.5px var(--blue); }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field small { display: block; color: var(--mute); font-size: 13px; margin-top: 5px; }
.kits { display: flex; flex-wrap: wrap; gap: 8px; }
.kit { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; background: var(--paper); cursor: pointer; font-size: 14px; user-select: none; }
.kit input { accent-color: var(--blue); margin: 0; }
.kit:has(input:checked) { background: var(--wash); color: var(--deep); font-weight: 600; }
.needs { background: #f6edd4; border-radius: 14px; padding: 12px 14px; font-size: 14px; color: #5a4614; }
.needs ul { margin: 6px 0 0; padding-left: 18px; }

.tabs { display: flex; gap: 4px; background: var(--paper-2); border-radius: 999px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto; margin: 22px 0 0; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--deep); box-shadow: 0 1px 2px rgba(11, 29, 58, .12); }

.rows { display: grid; margin-top: 16px; }
.r { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; }
.r:hover { background: rgba(220, 229, 239, .35); }
.r b { font-weight: 600; display: block; }
.r span { font-size: 13px; color: var(--mute); }
.st { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.st.done { background: #dcebdf; color: var(--ok); }
.st.failed, .st.declined { background: #f3dcd8; color: var(--bad); }
.st.stopped { background: #f6edd4; color: #6b5214; }
.empty { padding: 30px 4px 10px; color: var(--mute); }

.log { display: grid; gap: 8px; margin-top: 16px; }
.step { border-radius: 14px; background: var(--paper); padding: 12px 14px; font-size: 14px; }
.step.say { background: transparent; box-shadow: inset 0 0 0 1px var(--line); white-space: pre-wrap; }
.step .tl { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.step .tl .mono { font-weight: 400; color: var(--mute); }
.step pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.45 var(--mono); color: var(--ink-2); max-height: 220px; overflow: auto; }
.step.bad { box-shadow: inset 3px 0 0 var(--bad); }

.md { line-height: 1.6; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { letter-spacing: -.02em; margin: 1.2em 0 .4em; line-height: 1.15; }
.md h1 { font-size: 26px; } .md h2 { font-size: 21px; } .md h3 { font-size: 17px; }
.md p { margin: .6em 0; }
.md ul, .md ol { padding-left: 1.3em; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--paper); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--paper); padding: 12px; border-radius: 12px; overflow: auto; }
.md a { color: var(--blue); }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.md td, .md th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }

.chat { display: grid; gap: 10px; margin-top: 16px; max-height: 460px; overflow: auto; padding: 4px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 18px; font-size: 15px; white-space: pre-wrap; }
.msg.user { justify-self: end; background: var(--deep); color: var(--paper); border-bottom-right-radius: 6px; }
.msg.assistant { justify-self: start; background: var(--paper); border-bottom-left-radius: 6px; }
.say-box { display: flex; gap: 8px; margin-top: 12px; }
.say-box input { flex: 1; border: 0; outline: 0; background: var(--paper); border-radius: 999px; padding: 12px 16px; font-size: 15px; }

.task { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 4px; border-top: 1px solid var(--line); }
.task input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); }
.task.done b { text-decoration: line-through; color: var(--mute); }
.task p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); white-space: pre-wrap; }
.icon-btn { border: 0; background: none; color: var(--mute); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.icon-btn:hover { color: var(--bad); background: var(--paper); }

.burnbox { display: grid; gap: 14px; }
.stepper { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; align-items: center; }
.stepper button { height: 46px; border: 0; border-radius: 14px; background: var(--paper); font-size: 22px; cursor: pointer; }
.stepper input { height: 46px; text-align: center; border: 0; border-radius: 14px; background: var(--paper); font-size: 22px; font-weight: 650; outline: 0; }
.kv { display: grid; gap: 6px; font-size: 14px; background: var(--paper); border-radius: 14px; padding: 12px 14px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv span { color: var(--mute); }
.progress { font-size: 14px; color: var(--blue); font-weight: 600; min-height: 20px; }
details.more summary { cursor: pointer; font-size: 14px; color: var(--ink-2); }
details.more .say-box input { border-radius: 12px; font-family: var(--mono); font-size: 13px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.field label.kit { display: inline-flex; margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); }
#picker { z-index: 90; }
.burnbox .progress:empty, .burnbox .err:empty { display: none; }
