:root {
  --cream: #f6f1e8; --cream-2: #efe8dc; --paper: #fffdf8; --ink: #1d1813; --ink-2: #4a4239; --muted: #8b8176;
  --line: #e5dccd; --line-2: #d6cab7;
  --mint: #7fd1a6; --green: #13714b; --green-soft: #e3efe5;
  --red: #c23f2b; --red-soft: #f7e2db; --amber: #956708; --amber-soft: #f6ecd6;
  --blue: #3b57b8; --blue-soft: #ecf0fb;
  --display: "Faculty Glyphic", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --frame: 1180px;
  --shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 30px 60px -36px rgba(40, 26, 10, .45), 0 2px 6px -2px rgba(40, 26, 10, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #15120e; --cream-2: #1b1712; --paper: #201b15; --ink: #f2ebe0; --ink-2: #cdc3b5; --muted: #998f82;
    --line: #2f2820; --line-2: #3b3329; --green: #5cc994; --green-soft: #142a1f; --red: #ff8b77; --red-soft: #321a14;
    --amber: #f1c35b; --amber-soft: #2b2312; --blue: #93a8ff; --blue-soft: #1a2038;
    --shadow: 0 30px 60px -36px rgba(0,0,0,.8);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
.frame { max-width: var(--frame); margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.pad { padding-left: 56px; padding-right: 56px; }
@media (max-width: 760px) { .pad { padding-left: 18px; padding-right: 18px; } .frame { border: 0; } }
.muted { color: var(--muted); }
.mono-sm { font-family: var(--mono); font-size: 12.5px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--green); letter-spacing: .01em; display: inline-flex; gap: 8px; align-items: center; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.error { color: var(--red); font-weight: 600; margin: 14px 0 0; }

/* nav */
.nav-wrap { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--cream) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 24px; }
.brand svg { width: 30px; height: 30px; color: var(--ink); }
.nav-right { display: flex; gap: 18px; align-items: center; font-size: 14px; color: var(--ink-2); }
.nav-right a { text-decoration: none; }
.chip { font: 500 12px/1 var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--muted); background: var(--paper); }
.chip:empty { display: none; }

/* buttons */
.cta, .send { display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; font: 600 15px/1 var(--sans); color: var(--cream); background: var(--ink); border-radius: 999px; padding: 13px 18px 13px 22px; text-decoration: none; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 10px 24px -12px rgba(29,24,19,.6); transition: transform .2s, box-shadow .2s; }
.cta svg, .send svg { width: 18px; height: 18px; transition: transform .25s; }
.cta:hover, .send:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 16px 30px -14px rgba(29,24,19,.7); }
.cta:hover svg { transform: translateX(3px); }
.send:hover svg { transform: translateY(-2px); }
.cta:disabled, .send:disabled { opacity: .6; cursor: progress; transform: none; }
.ghost { display: inline-flex; align-items: center; gap: 8px; font: 500 14px/1 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; cursor: pointer; text-decoration: none; transition: border-color .2s; }
.ghost:hover { border-color: var(--line-2); }
.ghost.small { padding: 7px 11px; font-size: 13px; }
.link-btn { border: 0; background: none; padding: 0; font: 500 15px/1.5 var(--sans); color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.link-btn:hover { text-decoration-color: var(--ink); }

/* composer */
.compose-sec { border-bottom: 1px solid var(--line); background: radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--paper) 70%, transparent), transparent); }
.compose-sec .frame { padding-top: 76px; padding-bottom: 76px; text-align: center; }
.compose-sec h1 { font-family: var(--display); font-weight: 400; font-size: clamp(38px, 5.4vw, 62px); line-height: 1.05; letter-spacing: -0.01em; margin: 14px 0 14px; }
.lede { color: var(--muted); font-size: 17px; max-width: 54ch; margin: 0 auto 36px; }
.composer { max-width: 760px; margin: 0 auto; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 22px 22px 16px; }
.sentence { font-size: 20px; line-height: 2.1; color: var(--muted); }
.sentence .w { white-space: nowrap; }
.slot { font: 500 19px/1.2 var(--sans); color: var(--ink); background: var(--cream); border: 1px dashed var(--line-2); border-radius: 10px; padding: 6px 10px; margin: 0 4px; outline: none; transition: border-color .2s, background .2s; vertical-align: baseline; }
.slot:focus, .slot:focus-within { border-style: solid; border-color: var(--ink); background: var(--paper); }
.slot.url, .slot.what { field-sizing: content; max-width: 100%; }
.slot.url { min-width: 250px; font-family: var(--mono); font-size: 16px; }
.slot.what { min-width: 220px; }
.slot.filled { border-style: solid; background: var(--paper); }
.select-slot { display: inline-block; padding: 0 4px; }
.select-slot select { font: 500 18px/1.2 var(--sans); color: var(--green); background: transparent; border: 0; padding: 6px 4px; outline: none; cursor: pointer; }
.composer-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.clock-chips { display: flex; gap: 6px; flex-wrap: wrap; max-width: 520px; }
.cchip { font: 500 12px/1 var(--mono); border: 1px solid var(--line); background: var(--cream); color: var(--ink-2); border-radius: 7px; padding: 6px 8px; display: inline-flex; gap: 6px; align-items: center; }
.cchip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.cchip.add { cursor: pointer; background: transparent; border-style: dashed; color: var(--muted); }
.cchip.add:hover { color: var(--ink); border-color: var(--ink); }
.send-row { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.estimate { font: 500 12px/1.3 var(--mono); color: var(--muted); text-align: right; }
.clock-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.clock-panel-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.clocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 760px) { .clocks { grid-template-columns: 1fr 1fr; } .sentence { font-size: 18px; } }
.clock { text-align: left; cursor: pointer; border: 1px solid var(--line); background: var(--cream); border-radius: 12px; padding: 10px 12px; color: var(--ink); font: inherit; transition: border-color .2s, background .2s; }
.clock .city { font-weight: 600; font-size: 14px; }
.clock .when { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.clock .why { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.clock[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.clock:disabled { opacity: .4; cursor: not-allowed; }
.suggest { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 22px auto 0; max-width: 760px; }
.suggest button { font: 500 14px/1 var(--sans); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; cursor: pointer; color: var(--ink-2); transition: border-color .2s, color .2s; }
.suggest button:hover { border-color: var(--ink); color: var(--ink); }
.demo-line { margin-top: 30px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: 15px; }

/* results */
.results-sec { border-bottom: 1px solid var(--line); }
.results-sec .frame { padding-top: 56px; padding-bottom: 64px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.results-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.1; margin: 10px 0 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status { font: 500 12.5px/1.4 var(--mono); color: var(--muted); min-height: 18px; margin-bottom: 14px; }
.summary { display: flex; gap: 16px; font-weight: 600; margin: 2px 0 12px; flex-wrap: wrap; font-size: 14px; }
.s-pass { color: var(--green); } .s-fail { color: var(--red); } .s-unk { color: var(--amber); } .s-run { color: var(--blue); }
.gridrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.grid-label { font-family: var(--display); font-size: 24px; margin: 30px 0 8px; }
.cell { border-radius: 14px; border: 1px solid var(--line); background: var(--paper); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform .2s, border-color .3s, box-shadow .3s; text-align: left; font: inherit; color: inherit; padding: 0; }
.cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cell .thumb { height: 116px; background-color: #fff; background-repeat: no-repeat; background-size: 240% auto; background-position: 46% 0; border-bottom: 1px solid var(--line); }
.cell .thumb.empty { background: linear-gradient(110deg, var(--cream-2) 30%, var(--paper) 50%, var(--cream-2) 70%) 0 0 / 300% 100%; }
.cell.running .thumb.empty { animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.cell .body { padding: 11px 13px 13px; }
.cell .place { font-weight: 600; font-size: 14px; }
.cell .time { font: 500 11px/1.4 var(--mono); color: var(--muted); }
.cell .v { margin-top: 9px; font: 700 10.5px/1 var(--mono); letter-spacing: .1em; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.cell .v::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cell .line { font-size: 12.5px; margin-top: 6px; line-height: 1.4; color: var(--ink-2); }
.cell .line.bad { color: var(--red); }
.cell .live { font-size: 12px; color: var(--blue); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell.running { border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.cell.running .v { color: var(--blue); }
.cell.running .v::before { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.cell.pass { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.cell.pass .v { color: var(--green); }
.cell.pass .body { background: linear-gradient(180deg, var(--green-soft), transparent 70%); }
.cell.fail { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.cell.fail .v { color: var(--red); }
.cell.fail .body { background: linear-gradient(180deg, var(--red-soft), transparent 75%); }
.cell.unknown .v { color: var(--amber); }
.cell .disagree { font-size: 11.5px; margin-top: 7px; font-weight: 600; color: var(--amber); }
.flowname { font: 500 12px/1 var(--mono); color: var(--muted); margin: 16px 0 8px; }
.spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.policy { margin-top: 16px; font: 500 12.5px/1.4 var(--mono); color: var(--muted); }
.policy b.fail { color: var(--red); } .policy b.pass { color: var(--green); }

.fixbox { margin-top: 26px; display: flex; justify-content: space-between; gap: 20px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; flex-wrap: wrap; box-shadow: var(--shadow); }
.fixbox > div:first-child { max-width: 640px; }
.fixbox h3 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0 0 4px; }
.fixbox p { color: var(--muted); margin: 0; font-size: 14px; }
.fix-own-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.attempt { border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-top: 20px; background: var(--paper); }
.attempt h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0 0 10px; }
.agent-text { white-space: pre-wrap; background: var(--cream); border-radius: 12px; padding: 13px 15px; font-size: 14px; color: var(--ink-2); }
pre.diff { background: #1d1813; color: #e8e1d6; border-radius: 12px; padding: 14px; overflow-x: auto; font: 12.5px/1.6 var(--mono); margin: 12px 0 0; }
pre.diff .add { color: #82dcae; } pre.diff .del { color: #ff9b88; } pre.diff .hunk { color: #8c8174; }
.final { font-family: var(--display); font-size: 28px; }
.final.green { color: var(--green); } .final.amber { color: var(--amber); }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding-top: 26px; padding-bottom: 40px; }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; width: min(600px, 100vw); height: 100vh; background: var(--paper); border-left: 1px solid var(--line); z-index: 30; overflow-y: auto; padding: 24px; box-shadow: -30px 0 60px -40px rgba(0,0,0,.4); }
.scrim { position: fixed; inset: 0; background: rgba(29, 24, 19, .35); backdrop-filter: blur(2px); z-index: 25; }
.drawer-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.d-title { font-family: var(--display); font-size: 28px; line-height: 1.1; }
.shot { width: 100%; border: 1px solid var(--line); border-radius: 12px; display: block; background: #fff; }
.note { font-size: 13px; color: var(--muted); }
.vals { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.vals th, .vals td { text-align: left; border-bottom: 1px solid var(--line); padding: 9px 6px; vertical-align: top; }
.vals th { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.vals td.bad { color: var(--red); font-weight: 600; } .vals td.good { color: var(--green); font-weight: 600; }
.steps { font-size: 13px; color: var(--muted); padding-left: 20px; }
.steps li.failed { color: var(--red); }
.dlinks { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
details summary { cursor: pointer; color: var(--muted); margin: 10px 0 6px; font-size: 14px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 999px; z-index: 40; font-size: 14px; box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
