/* 17 Oct redesign (Alex: "i dont like the boxes next to each other ... go modernise the look"): one centred column,
   no side panels, answers as plain text, a sticky composer, "How it decided" in a slide-over (bottom sheet on phones). */
:root {
  color-scheme: light;
  --bg: #ffffff; --soft: #f4f5f7; --panel: #ffffff; --ink: #16181d; --muted: #5f6672; --line: #e6e8ec;
  --me: #eef2f8; --pill: #f0f2f5; --accent: #2563c9; --accent-ink: #ffffff; --good: #1f8a4c; --warn: #a3600f;
  --focus: #2563c9; --scrim: rgba(15, 18, 24, .32);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131417; --soft: #1b1d21; --panel: #1b1d21; --ink: #ececef; --muted: #9ba1ab; --line: #2b2e34;
    --me: #23272f; --pill: #24272d; --accent: #7aa9ef; --accent-ink: #0e1420; --good: #6fd197; --warn: #e6a95c;
    --focus: #7aa9ef; --scrim: rgba(0, 0, 0, .55); --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131417; --soft: #1b1d21; --panel: #1b1d21; --ink: #ececef; --muted: #9ba1ab; --line: #2b2e34;
  --me: #23272f; --pill: #24272d; --accent: #7aa9ef; --accent-ink: #0e1420; --good: #6fd197; --warn: #e6a95c;
  --focus: #7aa9ef; --scrim: rgba(0, 0, 0, .55); --shadow: 0 8px 28px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.offscreen { position: fixed; left: -9999px; top: 0; }

/* header: brand left, three quiet actions right */
.bar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.barin { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; }
a.brand { color: inherit; text-decoration: none; }
a.brand:hover span:last-child { text-decoration: underline; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.baracts { display: flex; gap: 2px; }
.tbtn { background: none; border: 0; border-radius: 8px; padding: 8px 10px; min-height: 36px; font-size: 14px; color: var(--muted); }
.tbtn:hover { background: var(--soft); color: var(--ink); }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }

/* the welcome: a heading, one quiet line, starter tiles */
.welcome { padding: clamp(32px, 9vh, 88px) 0 8px; }
h1 { margin: 0 0 10px; font-size: clamp(30px, 6vw, 42px); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; }
.quiet { color: var(--muted); margin: 0 0 28px; max-width: 620px; font-size: 15px; }
.start.run { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: none; border-color: var(--line); }
.start.run span { color: var(--muted); font-size: 14px; }

/* the conversation: you on the right in a soft bubble, answers as plain text */
.convo { display: flex; flex-direction: column; gap: 22px; padding-top: 28px; }
.convo:empty { padding: 0; }
.msg.me { align-self: flex-end; max-width: 80%; background: var(--me); padding: 9px 15px; border-radius: 18px 18px 6px 18px; overflow-wrap: anywhere; }
.botturn { display: flex; flex-direction: column; gap: 10px; }
.msg.bot { font-size: 16.5px; line-height: 1.6; overflow-wrap: anywhere; }
.metaline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.speed { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; background: var(--pill); border: 0; border-radius: 999px; padding: 4px 11px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink); }
.speed:hover { background: var(--line); }
.speed .bolt { color: var(--good); }
.meta .ok { color: var(--good); } .meta .wa { color: var(--warn); }

/* follow-up chips: only the newest can be used */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fchips .lead { font-size: 13px; color: var(--muted); margin-right: 2px; }
.fchips button, .ideas button, .gchips button { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; min-height: 36px; }
.fchips button:hover, .ideas button:hover, .gchips button:hover { border-color: var(--accent); color: var(--accent); }
.fchips.old { display: none; }

/* the month strip */
.mstrip { display: flex; gap: 3px; max-width: 360px; }
.mstrip span { flex: 1; text-align: center; font-size: 11px; padding: 3px 0; border-radius: 5px; background: var(--pill); color: var(--muted); }
.mstrip span.on { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--ink); font-weight: 600; }
.mstrip span.now { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* run 10: one call, ten answers, a compact speed list that lands all at once */
.runblock { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 6px; }
.runhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.runhead b { font-size: 15px; }
.runsum { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.runsum strong { color: var(--good); font-weight: 600; }
.runlist { margin-top: 8px; }
.runrow { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.runrow .rq { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runrow .ra { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runrow .speed { padding: 2px 9px; font-size: 12.5px; }
/* the welcome guide */
.shows { margin: -14px 0 26px; font-size: 15px; }
.askh { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px; }
.asks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ask { display: flex; flex-direction: column; gap: 6px; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.asklabel { font-size: 12.5px; color: var(--muted); }
.askex { display: flex; flex-wrap: wrap; gap: 6px; }
.askq { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 14.5px; min-height: 36px; text-align: left; }
.askq:hover { border-color: var(--accent); color: var(--accent); }
.start.run { margin-top: 10px; width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: none; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-height: 44px; text-align: left; }
.start.run:hover { border-color: var(--accent); }
.start.run span { color: var(--muted); font-size: 14px; }
.pitch { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.pitch p { margin: 0; max-width: 560px; }
.cta-contact { color: var(--accent); font-weight: 600; text-decoration: none; }
.footpitch { margin-bottom: 6px !important; color: var(--ink); }

/* the example row above the box during a chat: one line, scrolls sideways */
.ideas { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 8px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 92%, transparent); mask-image: linear-gradient(to right, #000 92%, transparent); }
.ideas::-webkit-scrollbar { display: none; }
.ideas button { flex: none; white-space: nowrap; font-size: 13.5px; padding: 5px 12px; min-height: 34px; }
.ideas button.alt { background: var(--soft); border-color: transparent; color: var(--muted); }

/* the trace controls look clickable */
.chev { margin-left: 2px; display: inline-block; transition: transform .15s; color: var(--muted); }
.speed[aria-expanded="true"] .chev { transform: rotate(90deg); }
/* the model trace level: Hide / Condensed / Full, one segmented control on the newest answer */
.levels { display: inline-flex; align-items: center; gap: 2px; background: var(--pill); border-radius: 999px; padding: 3px; margin-left: auto; }
.lvlabel { font-size: 12px; color: var(--muted); padding: 0 8px 0 9px; }
.lv { background: none; border: 0; border-radius: 999px; padding: 4px 11px; font-size: 13px; color: var(--muted); min-height: 28px; cursor: pointer; }
.lv:hover { color: var(--ink); }
.lv[aria-checked="true"] { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.hint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; background: color-mix(in srgb, var(--accent) 10%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 12px; padding: 9px 12px; }
.hint span { flex: 1 1 260px; }
.hint .tbtn { color: var(--accent); font-weight: 600; min-height: 32px; }

/* THE MODEL TRACE: the star of the page */
.tslot:empty { display: none; }
.trace { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; animation: tracein .16s ease-out; }
@keyframes tracein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.thead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--soft); }
.ttitle { font-weight: 650; font-size: 14.5px; }
.tms { font-size: 13px; color: var(--good); font-weight: 600; font-variant-numeric: tabular-nums; }
.tsec { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tsec:last-child { border-bottom: 0; }
.tsech { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ticon { width: 20px; height: 20px; border-radius: 6px; background: var(--pill); color: var(--ink); display: inline-grid; place-items: center; font-size: 11px; letter-spacing: 0; text-transform: none; }
.tline { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 3px 0; font-size: 14px; align-items: baseline; }
.tk { font-size: 12.5px; color: var(--muted); }
.tv { overflow-wrap: anywhere; }
.tv.ok { color: var(--good); } .tv.wa { color: var(--warn); }
.tnote { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.seen mark { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); border-radius: 5px; padding: 0 5px; font-weight: 600; }
.seen mark.pl { background: color-mix(in srgb, var(--warn) 18%, transparent); }
.mchips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.mchip { font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--pill); border-radius: 5px; padding: 0 6px; }
.allp { margin-top: 8px; font-size: 13px; }
.allp summary { cursor: pointer; color: var(--accent); width: max-content; padding: 4px 0; }
.pword { padding: 6px 0; }
.pwname { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.bars { display: flex; flex-direction: column; gap: 5px; margin: 2px 0 6px; }
.sbar { display: grid; grid-template-columns: minmax(0, 190px) minmax(40px, 1fr) 46px; gap: 10px; align-items: center; font-size: 13px; }
.bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.sbar.top .bl { color: var(--ink); font-weight: 600; }
.bt { height: 6px; border-radius: 3px; background: var(--pill); overflow: hidden; }
.bf { display: block; height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--muted) 55%, transparent); }
.sbar.top .bf { background: var(--accent); }
.bv { text-align: right; font: 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--muted); }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--pill); margin: 2px 0 8px; }
.seg { display: block; height: 100%; min-width: 2px; }
.s1, .legend i.s1 { background: #8b7cf6; } .s2, .legend i.s2 { background: var(--accent); }
.s3, .legend i.s3 { background: #2bb59a; } .s5, .legend i.s5 { background: color-mix(in srgb, var(--muted) 22%, transparent); } .s4, .legend i.s4 { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.spill { display: inline-block; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 1px 10px; }
.spill.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.spill.wa { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
/* condensed: the standard view, complete at a glance */
.brow { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 14px; }
.bk { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bvv { min-width: 0; overflow-wrap: anywhere; }
.bvv .sbar { margin: 1px 0 2px; }
.bsub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; }
.bnote { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.bsub .bnote { margin-top: 0; }
.mchips .more { color: var(--muted); font-size: 12px; padding: 0 2px; }
.stack.mini { height: 8px; margin: 4px 0 2px; }
.bfoot { padding: 6px 10px; display: flex; justify-content: flex-end; }
.bfoot .tbtn { color: var(--accent); font-weight: 600; min-height: 32px; }
.runslot { grid-column: 1 / -1; }
.runslot .trace { margin: 6px 0 4px; }

@media (max-width: 640px) {
  .asks { grid-template-columns: 1fr; }
  .tline { grid-template-columns: 1fr; gap: 0; padding: 4px 0; }
  .sbar { grid-template-columns: minmax(0, 1fr) 70px 42px; }
  .tsec, .thead { padding-left: 13px; padding-right: 13px; }
  .ideas button, .lv, .bfoot .tbtn { min-height:44px; }
  .levels { margin-left: 0; }
  .brow { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 9px 13px; }
  .runrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
  .runrow .ra { grid-column: 1 / -1; grid-row: 2; }
  .runrow .speed { min-height: 32px; }
}
.runnote, .waking { color: var(--muted); font-size: 14px; }
.cerrline { display: flex; align-items: center; gap: 10px; color: var(--warn); font-size: 14px; }

/* the composer: sticky at the bottom, Try one beside the box */
.dock { position: sticky; bottom: 0; z-index: 4; background: linear-gradient(to bottom, transparent, var(--bg) 22px); padding-top: 22px; }
.dockin { max-width: 760px; margin: 0 auto; padding: 0 16px calc(10px + env(safe-area-inset-bottom)); position: relative; }
.composer { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; color: var(--ink); font: inherit; padding: 9px 6px; max-height: 132px; line-height: 1.45; overflow-y: hidden; }
.composer textarea:focus { outline: none; }
.send { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.cfoot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); padding: 7px 8px 0; font-variant-numeric: tabular-nums; }

/* the Try one menu opens above the composer */
.trymenu { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 14px); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 16px; box-shadow: var(--shadow); max-height: min(60vh, 520px); overflow: auto; }
.tryhead { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.ggroup { padding: 8px 0; }
.glabel { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.gchips { display: flex; flex-wrap: wrap; gap: 6px; }
.runbtn { width: 100%; margin-top: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: var(--ink); color: var(--bg); border: 0; border-radius: 12px; padding: 12px 14px; min-height: 44px; font-weight: 600; text-align: left; }
.runbtn span { font-weight: 400; font-size: 13px; opacity: .75; }

.foot { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; color: var(--muted); font-size: 12.5px; }
.foot p { margin: 0; }

@media (max-width: 640px) {
    .start.run { flex-direction: column; gap: 2px; }
  .msg.me { max-width: 88%; }
  .cfoot .keys { display: none; }
  .tbtn { padding: 8px 8px; min-height: 44px; }
  .fchips button, .ideas button, .gchips button, .speed { min-height:44px; }
    .send { width: 44px; }
  .brand span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.bgroup { font-weight: 600; margin-bottom: 4px; }
.stack.mini + .legend { font-size: 12px; margin-bottom: 2px; }
