/* Verity: launch form, desk page, 404. Builds on site.css tokens. Motion is transform/opacity only. */

/* ---------- launch form ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding: clamp(32px, 6vw, 72px) 0 clamp(56px, 8vw, 110px); }
@media (max-width: 900px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-grid h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem); margin: 14px 0 0; }
.form-lede { margin: 16px 0 34px; }
.field { display: grid; gap: 7px; margin: 0 0 20px; min-width: 0; }
.field label, .field legend { font-weight: 550; font-size: 0.9rem; color: var(--ink); padding: 0; }
.field small { color: var(--ink-3); font-size: 0.8rem; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03);
  font: 16px/1.4 var(--body); color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: rgba(255, 255, 255, 0.22); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--glass); background: rgba(168, 210, 220, 0.04); box-shadow: 0 0 0 3px var(--glass-dim); }
.ticker-in { position: relative; }
.ticker-in span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--mono); color: var(--fee); pointer-events: none; }
.ticker-in input { padding-left: 30px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }
fieldset.field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.opts { display: grid; gap: 10px; margin-top: 4px; }
.field label.opt, .opt { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.field label.opt:hover, .opt:hover { border-color: var(--line-2); background: var(--panel-2); }
.opt:has(input:checked) { border-color: rgba(168, 210, 220, 0.55); background: var(--glass-dim); box-shadow: 0 0 0 1px rgba(168, 210, 220, 0.25) inset, 0 18px 40px -26px rgba(168, 210, 220, 0.5); }
.opt:has(input:focus-visible) { outline: 2px solid var(--fee); outline-offset: 2px; }
.field label.opt { padding: 16px; font-size: 1rem; font-weight: 400; }
.opt input { margin: 2px 0 0; accent-color: var(--glass); width: 18px; height: 18px; }
.opt b { display: block; font-weight: 580; letter-spacing: -0.01em; }
.opt span { color: var(--ink-2); font-size: 0.88rem; display: block; margin-top: 2px; }
.opt em { font-style: normal; font: 0.76rem/1.5 var(--mono); color: var(--ink-3); display: block; margin-top: 8px; }
.err { color: var(--cost); font-size: 0.9rem; min-height: 1.3em; margin-top: 10px; }
.form-grid .btn { width: 100%; }
@media (min-width: 560px) { .form-grid .btn { width: auto; min-width: 200px; } }
.inline-cost { margin: -4px 0 20px; padding: 13px 15px; border-radius: 12px; background: var(--fee-dim); border: 1px solid rgba(226, 180, 92, 0.22); font-size: 0.88rem; color: var(--ink-2); }
.inline-cost b { color: var(--fee-2); font-family: var(--mono); font-weight: 550; }
.side { align-self: stretch; }
.side .pane { position: sticky; top: 84px; }
.side .pane { padding: 24px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -40px #000; display: grid; gap: 10px; }
.side .pane h3 { font-size: 1.4rem; letter-spacing: -0.03em; }
.side .rows { margin-top: 10px; }
.side .hint { color: var(--ink-3); font-size: 0.82rem; margin-top: 8px; }
@media (max-width: 900px) { .side { display: none; } }
@media (min-width: 901px) { .inline-cost { display: none; } }
@media (max-width: 380px) { dl.rows > div { flex-wrap: wrap; } }

/* ---------- desk page ---------- */
.back { display: inline-flex; gap: 6px; font-size: 0.86rem; text-decoration: none; color: var(--ink-3); transition: color 0.2s, transform 0.25s var(--ease); width: fit-content; }
.back:hover { color: var(--ink); transform: translateX(-3px); }
.desk-head { padding: clamp(26px, 4vw, 48px) 0 clamp(22px, 3vw, 34px); display: grid; gap: 12px; justify-items: start; }
.desk-head h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem); line-height: 0.95; }
.desk-head h1 .tk { font-family: var(--mono); font-weight: 500; letter-spacing: -0.06em; color: var(--ink); font-feature-settings: "tnum" 1; }
.desk-name { font: 500 1.05rem/1.35 var(--body); color: var(--ink-2); }
.desk-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--ink-2); font-size: 0.9rem; max-width: 100%; }
.desk-meta > * { min-width: 0; }
.desk-meta code { overflow-wrap: anywhere; }
.desk-head .lede { margin-top: 4px; }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: clamp(56px, 8vw, 110px); }
.desk-grid > div { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 960px) {
  .desk-grid { grid-template-columns: minmax(0, 1fr); }
  .desk-grid > div { display: contents; }
  .desk-grid [aria-labelledby="h-now"] { order: 1; }
  .desk-grid [aria-labelledby="h-led"] { order: 2; }
  .desk-grid [aria-labelledby="h-out"] { order: 3; }
  .desk-grid #d-log { order: 4; }
}
#desk .card { padding: clamp(18px, 3vw, 28px); animation: rise 0.8s var(--ease) both; min-width: 0; }
#desk .card:nth-child(2) { animation-delay: 0.08s; }
#desk .card:nth-child(3) { animation-delay: 0.16s; }
.desk-grid > div:last-child .card { animation-delay: 0.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card h2 { font-size: 1.3rem; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 4px; }
.card .sub { color: var(--ink-3); font-size: 0.85rem; margin-bottom: 18px; max-width: 60ch; }
.now { display: grid; gap: 8px; }
.now .kick { font: 500 0.72rem/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.now .task { font: 520 1.15rem/1.35 var(--display); letter-spacing: -0.02em; color: var(--ink); overflow-wrap: anywhere; }

/* status strip: an instrument light, glowing softly in its state color */
.status { --c: var(--ink-3); position: relative; display: grid; gap: 6px; padding: 16px 18px 16px 20px; border-radius: 14px; margin-bottom: 18px; overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 11%, transparent), rgba(255, 255, 255, 0.015) 70%);
  border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  box-shadow: 0 0 40px -18px var(--c); }
.status::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); box-shadow: 0 0 14px var(--c); }
.status .word { display: flex; align-items: center; gap: 10px; font: 560 1.3rem/1.2 var(--display); letter-spacing: -0.02em; color: var(--c); }
.status .word::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 10px currentColor; }
.status.working { --c: var(--ok); }
.status.working .word::before { animation: pulse 1.6s ease-in-out infinite; }
.status.waiting { --c: var(--glass); }
.status.paused { --c: var(--cost); }
.status.off { --c: var(--ink-3); }
.status.off .word { color: var(--ink-2); }
.status.off .word::before { box-shadow: none; }
.status p { color: var(--ink-2); font-size: 0.9rem; max-width: 62ch; }
.status .bal { font: 0.8rem/1.4 var(--mono); font-feature-settings: "tnum" 1; color: var(--ink-3); margin-top: 4px; }

/* run log */
.run-pick { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--ink-3); margin-bottom: 8px; max-width: 100%; }
.run-pick select { flex: 0 1 auto; min-width: 0; min-height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); font: 0.8rem var(--mono); padding: 0 12px; color: var(--ink); color-scheme: dark; text-overflow: ellipsis; }
.run-pick select:focus { outline: none; border-color: var(--glass); box-shadow: 0 0 0 3px var(--glass-dim); }
.feed { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.feed::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line-2), var(--line)); }
.feed li { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 8px 0; font-size: 0.88rem; line-height: 1.5; animation: feed-in 0.45s var(--ease) both; }
@keyframes feed-in { from { opacity: 0; transform: translateY(6px); } }
.feed li .ic { width: 23px; height: 23px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-2); display: grid; place-items: center; font: 600 0.62rem/1 var(--mono); color: var(--ink-3); z-index: 1; }
.feed li.task .ic { color: var(--ink-2); }
.feed li.tool_call .ic, .feed li.tool_result .ic { border-color: rgba(168, 210, 220, 0.5); color: var(--glass); }
.feed li.model .ic { border-color: rgba(224, 122, 95, 0.5); color: var(--cost); }
.feed li.error .ic { border-color: var(--cost); color: var(--cost); background: var(--cost-dim); }
.feed li.output .ic { background: var(--fee-dim); border-color: rgba(226, 180, 92, 0.55); color: var(--fee); }
.feed li.end .ic { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.feed li.end { padding-top: 12px; }
.feed .what { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.feed .what b { font-weight: 560; color: var(--ink); }
.feed .what code { font: 0.76rem/1.5 var(--mono); font-feature-settings: "tnum" 1; }
.feed .what .muted { font-size: 0.82rem; }
.feed pre { font: 0.76rem/1.55 var(--mono); color: var(--ink-2); margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 160px; overflow: auto; }
.feed .t { color: var(--ink-3); font: 0.72rem var(--mono); font-feature-settings: "tnum" 1; margin-left: 8px; }
.feed details summary { cursor: pointer; color: var(--glass); font-size: 0.8rem; margin-top: 3px; min-height: 28px; display: flex; align-items: center; }

/* output (markdown) */
.output { font-size: 0.96rem; line-height: 1.65; color: var(--ink-2); overflow-wrap: anywhere; }
.output h4 { font: 580 1.1rem/1.3 var(--display); letter-spacing: -0.02em; color: var(--ink); margin: 18px 0 6px; }
.output h4:first-child { margin-top: 0; }
.output ul { padding-left: 1.2em; margin: 8px 0; }
.output li { margin: 3px 0; }
.output li::marker { color: var(--ink-3); }
.output p + p { margin-top: 10px; }
.output strong, .output b { color: var(--ink); font-weight: 560; }

/* ledger */
.ledger-bar { display: grid; gap: 7px; margin: 4px 0 18px; }
.ledger-bar .lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: var(--ink-2); margin-top: 6px; }
.ledger-bar .lbl:first-child { margin-top: 0; }
.ledger-bar .lbl span:last-child { font-family: var(--mono); font-feature-settings: "tnum" 1; color: var(--ink); }
.ledger-bar .track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); position: relative; overflow: hidden; }
.ledger-bar .track b { position: absolute; inset: 0; width: 100%; transform: scaleX(0); border-radius: 999px; transform-origin: left; transition: transform 1s var(--ease); }
.ledger-bar .in b { background: linear-gradient(90deg, #b88a36, var(--fee-2)); box-shadow: 0 0 14px rgba(226, 180, 92, 0.45); }
.ledger-bar .out b { background: linear-gradient(90deg, #b5543b, var(--cost)); box-shadow: 0 0 14px rgba(224, 122, 95, 0.35); }
.balance { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 0 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.86rem; }
.balance .v { font: 500 clamp(1.7rem, 1.2rem + 1.6vw, 2.2rem)/1 var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.04em; color: var(--ink); }
.balance .v.neg { color: var(--cost); }
table.entries { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-top: 16px; }
table.entries td { padding: 11px 0; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); overflow-wrap: anywhere; }
table.entries td:last-child { text-align: right; font-family: var(--mono); font-feature-settings: "tnum" 1; white-space: nowrap; padding-left: 12px; }
table.entries td[colspan] { white-space: normal; text-align: left; font-family: var(--body); padding-left: 0; color: var(--ink-3); }
table.entries .when { color: var(--ink-3); font: 0.72rem/1.5 var(--mono); display: block; margin-top: 2px; }
table.entries a { color: var(--ink-2); }
.plus { color: var(--fee); }
.minus { color: var(--cost); }

/* ---------- 404 / no desk ---------- */
.notfound { padding: clamp(72px, 14vw, 160px) 0; display: grid; gap: 18px; justify-items: start; }
.notfound h1 { font-size: clamp(2.4rem, 1.4rem + 4.6vw, 4.6rem); max-width: 14ch; }
.notfound .btn { margin-top: 8px; }
.notfound .eyebrow { color: var(--fee); }

@media (prefers-reduced-motion: reduce) {
  #desk .card, .feed li { animation: none; }
  .status.working .word::before { animation: none; }
  .ledger-bar .track b { transition: none; }
}
