/* Luca: a white workspace on a deep navy frame. Royal blue for action, the red leaf only for "needs you" and live. */
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --navy: #0A1A45; --navy-2: #0F2563; --navy-3: #18306F; --deep: #061233;
  --ink: #0B1633; --ink-2: #39435F; --muted: #5F6A86; --faint: #98A1B8;
  --line: #E6EAF2; --line-2: #D3DAE8; --bg: #F5F7FB; --tint: #F0F3F9;
  --accent: #1E4FD8; --signal: #E3122B;
  --ok: #16794C;  --ok-bg: #E5F4EC;
  --attn: #A35B00; --attn-bg: #FFF4E0;
  --bad: #B42318; --bad-bg: #FDEDEB;
  --live: #1E4FD8; --live-bg: #EAF0FD;
  --r: 12px;
  --head: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: .3rem 0 .8rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--tint); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 0 .9rem; }
.i { width: 18px; height: 18px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: #fff; padding: .5rem 1rem; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
[hidden] { display: none !important; }
.num, .cost, td.num { font-variant-numeric: tabular-nums; }

/* ---- shell: navy sidebar ---- */
.shell { display: grid; grid-template-columns: 276px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C3CCE6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1rem .75rem .75rem; gap: .35rem; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .1rem .35rem .7rem; text-decoration: none; color: #fff; }
.logo-tile { width: 40px; height: 40px; border-radius: 11px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.logo-tile img { width: 28px; height: 28px; object-fit: contain; }
.brand b { display: block; font: 700 1.12rem/1.2 var(--head); letter-spacing: -.02em; color: #fff; }
.brand small { display: block; font-size: .78rem; color: #93A0C4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 175px; }
.new-task { display: flex; align-items: center; justify-content: center; gap: .5rem; background: var(--signal); color: #fff; text-decoration: none; font: 600 .95rem var(--head); border-radius: 12px; padding: .62rem .9rem; margin: .1rem 0 .2rem; box-shadow: 0 6px 18px -8px rgba(227,18,43,.8); }
.new-task:hover { background: #C10F24; }
.tsearch { position: relative; margin: .2rem 0 .3rem; }
.tsearch span { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #7D8AB0; display: flex; }
.side .tsearch input[type=search] { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #fff; min-height: 38px; padding: .4rem .7rem .4rem 2.2rem; border-radius: 10px; font-size: .88rem; }
.side .tsearch input::placeholder { color: #7D8AB0; }
.side .tsearch input:focus { outline: 2px solid rgba(255,255,255,.35); border-color: transparent; }
.nav { display: grid; gap: 1px; margin-top: .2rem; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .46rem .7rem; border-radius: 9px; color: #C3CCE6; text-decoration: none; font-weight: 500; font-size: .92rem; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav a .i { color: #8D9BC4; }
.nav a.on .i { color: #fff; }
.badge { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 700; background: var(--signal); color: #fff; border-radius: 999px; padding: 0 .45rem; }
.threads { flex: 1; overflow: auto; margin: .6rem -.2rem 0; min-height: 0; padding: 0 .2rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.tsec { margin-bottom: .5rem; }
.tsec > summary { list-style: none; display: flex; align-items: center; gap: .4rem; font: 600 .74rem var(--head); color: #8D9BC4; padding: .35rem .6rem; border-radius: 8px; }
.tsec > summary::-webkit-details-marker { display: none; }
.tsec > summary::before { content: "▸"; font-size: .7rem; transition: transform .15s; }
.tsec[open] > summary::before { transform: rotate(90deg); }
.tsec > summary:hover { color: #fff; }
.tsec > summary em { font-style: normal; margin-left: auto; background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .7rem; }
.tsec-action > summary em { background: var(--signal); }
.thread { display: grid; grid-template-columns: 10px 1fr; column-gap: .55rem; padding: .42rem .6rem; text-decoration: none; color: #DCE2F2; border-radius: 9px; }
.thread:hover { background: rgba(255,255,255,.07); }
.thread.on { background: rgba(255,255,255,.14); color: #fff; }
.thread .tdot { width: 7px; height: 7px; border-radius: 50%; background: #5A6890; margin-top: .48rem; grid-row: span 2; }
.thread.k-run .tdot { background: #5B8CFF; box-shadow: 0 0 0 3px rgba(91,140,255,.25); animation: pulse 1.6s ease-in-out infinite; }
.thread.k-act .tdot { background: var(--signal); box-shadow: 0 0 0 3px rgba(227,18,43,.25); }
.thread.k-bad .tdot { background: #F08A7E; }
.thread .t { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .m { font-size: .72rem; color: #8D9BC4; }
.thread.k-act .m { color: #FF9AA6; font-weight: 600; }
.thread.k-run .m { color: #9DB8FF; }
.tempty { font-size: .78rem; color: #7D8AB0; padding: .1rem .6rem .4rem 1.75rem; margin: 0; }
.tall { display: block; font-size: .78rem; color: #93A0C4; padding: .3rem .6rem; }
.me { margin-top: .4rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: .55rem .7rem; display: flex; align-items: center; gap: .6rem; }
.me > div { min-width: 0; flex: 1; }
.me b { display: block; font-size: .85rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span:not(.avatar) { display: block; font-size: .74rem; color: #8D9BC4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .link { color: #93A0C4; }
.me .link:hover { color: #fff; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2A3F7E; color: #fff; font: 600 .72rem var(--head); display: grid; place-items: center; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; background: var(--navy-3); }
.main { padding: 2rem 2.5rem 7rem; min-width: 0; width: 100%; max-width: 1200px; }
.main.wide { max-width: none; padding-left: 1.5rem; padding-right: 1.5rem; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.head h1 { margin: 0; }
.banner { background: var(--attn-bg); color: var(--attn); padding: .55rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .9rem; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
@keyframes pulse { 50% { opacity: .45; } }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: .45rem; justify-content: center; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 10px; padding: .5rem .9rem; font: 600 .9rem var(--head); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); background: #FAFBFD; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-danger, .btn.danger { color: var(--bad); border-color: #F1C7C2; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--tint); border-color: transparent; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #12623F; }
.btn-stop { color: var(--bad); border-color: #F1C7C2; }
.btn-sm { padding: .3rem .62rem; font-size: .82rem; border-radius: 8px; }
.btn .i { width: 16px; height: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; padding: 0; }
.link:hover { color: var(--ink); }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row form { margin: 0; }
.icon-btn { list-style: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--tint); color: var(--ink); }

/* ---- surfaces ---- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-bottom: .3rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-attn { background: var(--attn-bg); color: var(--attn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-live { background: var(--live-bg); color: var(--live); }
.pill-wait, .pill-muted { background: var(--tint); color: var(--muted); }
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--live-bg); color: #1F3F9E; }
.empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line-2); border-radius: 14px; }
.empty p { color: var(--muted); max-width: 520px; margin: .3rem auto 1rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; }
.stat b { display: block; font-size: 1.45rem; }
.stat span { font-size: .8rem; color: var(--muted); }

/* ---- forms ---- */
.field { display: block; margin-bottom: 1rem; }
.lbl { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; }
.hint { display: block; font-size: .8rem; color: var(--muted); margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: .55rem .75rem; min-height: 42px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid #B9C7F2; outline-offset: 0; border-color: var(--live); }
.check { display: flex; gap: .55rem; align-items: flex-start; margin: .45rem 0; font-size: .92rem; }
.check input { margin-top: .3rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .1rem 1rem; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.2rem; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 650; margin-bottom: .4rem; }
details > summary { cursor: pointer; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; color: var(--muted); font-weight: 600; padding: .65rem .9rem; border-bottom: 1px solid var(--line); background: #FAFBFC; }
td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.search-row { margin-bottom: 1rem; max-width: 520px; }

/* ---- chips and agents ---- */
.chips { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1.2rem; align-items: center; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: .3rem .85rem; font-size: .85rem; color: var(--ink-2); text-decoration: none; }
.chip:hover { border-color: var(--faint); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip em { font-style: normal; color: var(--faint); margin-left: .35rem; }
.chip.on em { color: #C7CDE0; }
.group { margin-bottom: 1.4rem; border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.2rem 1.2rem; }
.group-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8rem; }
.group-h h2 { font-size: .98rem; font-weight: 600; color: var(--ink-2); }
.group-h .small { letter-spacing: .08em; text-transform: uppercase; font-size: .7rem; color: var(--faint); }
.agent { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; min-height: 180px; transition: border-color .15s; }
.agent:hover { border-color: var(--line-2); }
.agent h3 { margin: 0; font-size: 1.05rem; }
.agent h3 a { color: var(--ink); text-decoration: none; }
.agent p { color: var(--muted); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .78rem; color: var(--faint); }
.trig { font-size: .72rem; font-weight: 600; color: var(--ink-2); background: var(--tint); border-radius: 6px; padding: .1rem .45rem; }


/* ---- home: the workbench ---- */
.bench { max-width: 980px; margin: 0 auto; padding-top: 1.2rem; }
.bench-head { margin-bottom: 1.2rem; }
.bench-date { font: 600 .82rem var(--head); color: var(--signal); margin: 0 0 .3rem; }
.bench-head h1 { font-size: clamp(1.6rem, 2.8vw, 2.15rem); font-weight: 600; letter-spacing: -.025em; max-width: 26ch; }
.starters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0 1rem; }
.starter-group { display: grid; gap: .45rem; align-content: start; }
.starter-label { font: 600 .74rem var(--head); color: var(--muted); }
.starter { display: flex; align-items: center; gap: .6rem; text-align: left; font: 500 .9rem var(--head); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .85rem; cursor: pointer; }
.starter:hover { border-color: var(--accent); color: var(--accent); }
.starter .i { color: var(--accent); }
.bench-note { display: flex; gap: .6rem; align-items: center; background: var(--live-bg); color: #1B3E9E; border-radius: 12px; padding: .7rem 1rem; font-size: .9rem; }
.bench-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; min-height: 180px; }
.panel h2 { font-size: .95rem; display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; }
.panel h2 em { font-style: normal; font-size: .72rem; background: var(--tint); color: var(--ink-2); border-radius: 999px; padding: 0 .5rem; }
.panel-act { border-top: 3px solid var(--signal); }
.panel-act h2 em { background: var(--signal); color: #fff; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.plist a { display: block; text-decoration: none; color: var(--ink); padding: .45rem .5rem; border-radius: 9px; }
.plist a:hover { background: var(--tint); }
.plist b { display: flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist span { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pempty { color: var(--faint); font-size: .88rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.6s ease-in-out infinite; }

/* ---- composer ---- */
.composer form { display: grid; background: #fff; border: 1px solid var(--line-2); border-radius: 18px; padding: .5rem .6rem .5rem; box-shadow: 0 10px 30px -14px rgba(10,26,69,.25); }
.composer form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--live-bg), 0 10px 30px -14px rgba(10,26,69,.25); }
.composer textarea { border: 0; min-height: 52px; max-height: 260px; padding: .55rem .5rem; resize: none; font-size: 1rem; background: transparent; }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; align-items: center; gap: .4rem; }
.cbtn { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .7rem; border-radius: 999px; color: var(--ink-2); cursor: pointer; position: relative; overflow: hidden; font: 500 .84rem var(--head); border: 1px solid var(--line); }
.cbtn:hover { background: var(--tint); }
.cbtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.client-pick { width: auto; max-width: 190px; min-height: 34px; border-radius: 999px; font-size: .82rem; padding: .25rem .7rem; background: var(--tint); border-color: transparent; color: var(--ink-2); }
.file-names { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; border: 0; background: var(--navy); color: #fff; font: 600 .9rem var(--head); border-radius: 999px; padding: .55rem 1.1rem; cursor: pointer; flex: none; }
.send:hover { background: var(--navy-2); }
.send:disabled { background: #A9B0C2; cursor: not-allowed; }
.send.stop { background: var(--signal); }
.send.stop:hover { background: #C10F24; }
.dock { position: fixed; left: 276px; right: 0; bottom: 0; padding: .7rem 1.5rem 1rem; background: linear-gradient(to top, var(--bg) 72%, rgba(245,247,251,0)); z-index: 15; }
.dock > div { max-width: 880px; margin: 0 auto; }

/* ---- thread: newest at the bottom, like a chat ---- */
.run { max-width: 880px; margin: 0 auto; display: grid; gap: 1rem; }
.run-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding-bottom: .8rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; padding-top: .4rem; }
.run-title { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: start; column-gap: .3rem; min-width: 0; }
.run-title h1 { font-size: 1.35rem; margin: 0; overflow-wrap: anywhere; }
.run-title .run-meta { grid-column: 1 / -1; }
.rename { position: relative; }
.rename > form { position: absolute; top: 36px; left: 0; z-index: 10; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: .6rem; width: 420px; box-shadow: 0 12px 32px -12px rgba(10,26,69,.3); flex-wrap: nowrap; }
.run-meta { color: var(--muted); font-size: .84rem; margin: .3rem 0 0; }
.run-meta a { color: var(--muted); }
.state-chip { display: inline-block; font: 600 .72rem var(--head); background: var(--tint); color: var(--ink-2); border-radius: 999px; padding: .05rem .55rem; margin-right: .2rem; }
.run[data-status="running"] .state-chip, .run[data-status="queued"] .state-chip { background: var(--live-bg); color: var(--live); }
.run[data-status="waiting_approval"] .state-chip, .run[data-status="waiting_input"] .state-chip, .run[data-status="paused"] .state-chip { background: #FFE8EB; color: #B00C21; }
.run-actions .btn .i { width: 15px; height: 15px; }
.feed { display: grid; gap: 1.3rem; }
.turn { display: grid; gap: .8rem; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .8rem 1.05rem .9rem; }
.msg > header { display: flex; align-items: center; gap: .55rem; margin-bottom: .35rem; }
.msg > header b { font: 600 .88rem var(--head); }
.msg > header time { margin-left: auto; font-size: .75rem; color: var(--faint); }
.msg .body { overflow-wrap: anywhere; }
.msg .body > :last-child { margin-bottom: 0; }
.msg-you { background: #EEF2FB; border-color: #DEE5F4; }
.luca-av { width: 28px; height: 28px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.luca-av img { width: 20px; height: 20px; object-fit: contain; }
.msg.ask { border-color: #F3C2C9; box-shadow: inset 3px 0 0 var(--signal); }
.ask-label { font: 600 .78rem var(--head); color: #B00C21; margin: 0 0 .2rem; }
.prose { line-height: 1.68; }
.prose h3, .prose h4, .prose h5 { margin: 1rem 0 .35rem; font-size: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: .4rem 0 .8rem; }
.prose li { margin: .15rem 0; }
.prose .table-wrap { margin: .6rem 0 .9rem; }
.prose pre { white-space: pre-wrap; background: var(--tint); padding: .7rem; border-radius: 8px; font: .8rem/1.5 var(--mono); }
.log { background: #fff; border: 1px solid var(--line); border-radius: 14px; font-size: .86rem; }
.log > summary { list-style: none; display: flex; align-items: center; gap: .55rem; padding: .55rem .8rem; color: var(--ink-2); }
.log > summary::-webkit-details-marker { display: none; }
.log > summary::after { content: "›"; margin-left: auto; font-size: 1.1rem; color: var(--faint); transition: transform .15s; }
.log[open] > summary::after { transform: rotate(90deg); }
.log-title b { font: 600 .86rem var(--head); color: var(--ink); }
.log.live { border-color: #C9D6F7; background: linear-gradient(90deg, #F3F6FE, #fff 60%); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.4s ease-in-out infinite; }
.tl { list-style: none; margin: 0 .8rem .7rem 1.55rem; padding: .2rem 0 .1rem .9rem; border-left: 2px solid var(--line); display: grid; gap: .3rem; }
.st { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: .4rem; color: var(--ink-2); font-size: .83rem; }
.st::before { content: ""; position: absolute; left: calc(-0.9rem - 5px); top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); border: 2px solid #fff; }
.st-tool::before { background: var(--accent); }
.st-err::before { background: var(--bad); }
.st-file::before { background: var(--ok); }
.st time { color: var(--faint); font-size: .72rem; padding-top: .1rem; }
.st summary { list-style: none; cursor: pointer; }
.st summary::-webkit-details-marker { display: none; }
.st-tool summary { color: var(--ink); font-weight: 500; }
.st-res summary { color: var(--faint); }
.st-err, .st-err summary { color: var(--bad); }
.st-sys { color: var(--attn); }
.st-note span { color: var(--muted); font-style: italic; }
.st pre { white-space: pre-wrap; font: .74rem/1.45 var(--mono); background: #FAFBFD; border: 1px solid var(--line); padding: .55rem .65rem; border-radius: 8px; max-height: 240px; overflow: auto; margin: .3rem 0 .2rem; }
.report-card { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; background: #fff; border: 1px solid #C9D6F7; border-radius: 16px; padding: .9rem 1rem; box-shadow: inset 4px 0 0 var(--accent); }
.report-card > div:nth-child(2) { flex: 1; min-width: 220px; }
.report-card b { display: block; font: 600 .95rem var(--head); }
.report-card span { display: block; }
.report-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--live-bg); color: var(--accent); display: grid; place-items: center; }
.report-view { max-width: 860px; }
.signin { border-color: #C9D6F7; box-shadow: inset 3px 0 0 var(--accent); }
.signin h3 { font-size: 1rem; margin: .1rem 0 .3rem; }
.signin-form { display: grid; gap: .6rem; margin-top: .6rem; }
.signin-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.signin-row select { width: auto; min-width: 220px; }
.browser-slot:empty { display: none; }
.feed-end { height: 1px; }
.live-line { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .86rem; margin: -.3rem 0 0; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink-2); display: inline-block; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.jump { position: fixed; bottom: 7.5rem; left: calc(50% + 138px); transform: translateX(-50%); z-index: 16; display: inline-flex; align-items: center; gap: .35rem; background: var(--navy); color: #fff; border: 0; border-radius: 999px; padding: .4rem .9rem; font: 600 .82rem var(--head); cursor: pointer; box-shadow: 0 8px 20px -8px rgba(10,26,69,.6); }
.jump .i { width: 15px; height: 15px; }
.browser { border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 14px 34px -20px rgba(10,26,69,.45); }
.browser-bar { display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; background: var(--navy); color: #C3CCE6; font-size: .82rem; }
.browser-bar .dots { display: inline-flex; gap: 5px; }
.browser-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.22); }
.browser-bar .url { background: rgba(255,255,255,.1); border-radius: 7px; padding: .1rem .6rem; color: #fff; font-family: var(--mono); font-size: .78rem; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-bar .state { margin-left: auto; }
.browser.human .browser-bar { background: #7A0B19; }
.browser .screen { background: #0B0F1A; position: relative; }
.browser .screen img { display: block; width: 100%; height: auto; min-height: 120px; }
.browser.human .screen img { cursor: default; }
.browser .screen:focus:not(:focus-visible) { outline: none; }
.browser.human .screen:focus { outline: 3px solid var(--live); outline-offset: -3px; }
.browser .ctrl { display: flex; gap: .6rem; align-items: center; justify-content: space-between; padding: .55rem .8rem; background: #FAFBFD; border-top: 1px solid var(--line); flex-wrap: wrap; }
.browser .ctrl select { width: auto; min-height: 32px; padding: .2rem .5rem; }
.browser.full { position: fixed; inset: 1rem; z-index: 50; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.browser.full .screen { flex: 1; overflow: auto; }
.typebar { display: flex; gap: .4rem; padding: .5rem .8rem; border-top: 1px solid var(--line); }
.approvals-zone:empty { display: none; }
.approval { background: #fff; border: 1px solid #F3C2C9; border-radius: 16px; padding: 1rem 1.15rem; margin-bottom: .8rem; box-shadow: inset 4px 0 0 var(--signal); }
.approval header { display: flex; align-items: center; gap: .55rem; margin-bottom: .4rem; }
.approval h3 { margin: 0; font-size: 1rem; }
.appr-ic { width: 24px; height: 24px; border-radius: 50%; background: var(--signal); color: #fff; font: 700 .8rem/24px var(--head); text-align: center; }
.approval img { max-width: 100%; max-height: 320px; object-fit: contain; object-position: left top; border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0; }
.approval pre { white-space: pre-wrap; font: .8rem/1.5 var(--body, inherit); background: #FAFBFD; border: 1px solid var(--line); padding: .7rem; border-radius: 8px; max-height: 280px; overflow: auto; }
.appr-form { display: grid; gap: .55rem; }
.appr-form input { max-width: 420px; }
.files:empty { display: none; }
.files { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem 1rem; }
.files-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.files-head b { font: 600 .88rem var(--head); }
.files-list { display: flex; gap: .45rem; flex-wrap: wrap; }
.file { display: inline-flex; gap: .45rem; align-items: center; border: 1px solid var(--line); padding: .32rem .65rem; border-radius: 10px; font-size: .84rem; text-decoration: none; color: var(--ink); background: #fff; }
.file:hover { border-color: var(--accent); }
.file em { font-style: normal; font-size: .7rem; color: var(--faint); }
.file .i { width: 15px; height: 15px; color: var(--muted); }

/* ---- auth: split screen ---- */
.auth-body { background: #fff; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: radial-gradient(900px 500px at 10% 0%, #1B3A8F 0%, transparent 55%), var(--navy); color: #C3CCE6; display: flex; align-items: center; padding: 3rem; }
.auth-side > div { max-width: 380px; }
.auth-logo { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 22px; padding: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.auth-name { font: 700 2.2rem/1.1 var(--head); color: #fff; margin: 1.4rem 0 .6rem; letter-spacing: -.03em; }
.auth-tag { font-size: 1.05rem; line-height: 1.55; margin: 0; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 2.5rem 1.6rem; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 1rem; }
.auth-card .btn-primary { width: 100%; margin-top: .3rem; padding: .7rem; }
.auth-mobile-brand { display: none; align-items: center; gap: .55rem; text-decoration: none; color: var(--navy); font: 700 1.2rem var(--head); margin-bottom: 1.2rem; }
.auth-mobile-brand img { width: 34px; height: 34px; object-fit: contain; }
.plan-pick { display: grid; gap: .5rem; margin-bottom: 1rem; }
.logo-row { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 96px; height: 96px; border-radius: 22px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.logo-preview img { width: 72px; height: 72px; object-fit: contain; }
.refer { border-top: 3px solid var(--signal); max-width: 880px; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
details.adv { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
details.adv > summary { color: var(--ink-2); }
details.adv textarea { font: .85rem/1.5 var(--mono); }

@media (max-width: 1000px) {
  .starters, .bench-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .threads { max-height: 260px; }
  .main { padding: 1.2rem 1rem 8rem; }
  .dock { left: 0; padding: .6rem .8rem .8rem; }
  .grid-2, .grid-3, .stats { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; }
  .jump { left: 50%; }
  .rename > form { width: 300px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .pulse, .live-dot, .thread .tdot { animation: none !important; } }

/* platform admin */
.admin-own { margin-bottom: 1.2rem; border-color: var(--ink); max-width: 880px; }
.admin-own .row { align-items: flex-end; }
.admin-own .field { flex: 1; min-width: 240px; margin: 0; }

/* show / hide password */
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 2.8rem; }
.pw-eye { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--tint); }
.pw-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* platform admin settings */
.chips + .card, .chips + p, .chips + form { margin-top: .2rem; }
.now { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; max-width: 980px; }
.now p { margin: .2rem 0 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 12px; padding: .8rem .9rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.choice input { margin-top: .3rem; }
.choice b { display: block; }
.choice small { color: var(--muted); }
details.prov { border: 1px solid var(--line); border-radius: 12px; padding: .2rem 1rem; margin: .7rem 0 0; }
details.prov > summary { cursor: pointer; display: flex; gap: .8rem; align-items: baseline; padding: .7rem 0; }
details.prov[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.integ { margin-bottom: 1rem; max-width: 880px; }
.integ-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.integ-head h2 { margin: 0; }
.copy { display: flex; align-items: center; gap: .5rem; margin: .3rem 0; flex-wrap: wrap; }
.copy code { font-size: .82rem; padding: .35rem .55rem; word-break: break-all; }
.plans-edit input { width: 100%; min-width: 80px; }
.check.small { font-size: .85rem; margin-top: -.4rem; }

/* add-a-login menu */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 320px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(20,33,61,.25); padding: .35rem; }
.menu-list a { display: block; padding: .65rem .75rem; border-radius: 9px; text-decoration: none; color: var(--ink); }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--tint); }
.menu-list b { display: block; font-weight: 600; }
.menu-list span { display: block; font-size: .85rem; color: var(--muted); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }

/* guided set-up */
.setup { max-width: 820px; margin: 0 auto; padding-bottom: 6.5rem; }
.setup-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.setup-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 2rem; }
.setup-bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.setup-h { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 700; margin-bottom: .6rem; }
.setup-lead { color: var(--ink-2); font-size: 1.05rem; margin-bottom: 1.6rem; max-width: 40em; }
.setup-foot { position: fixed; left: 276px; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: .9rem max(1.5rem, calc((100vw - 276px - 820px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 1rem; z-index: 10; backdrop-filter: blur(6px); }
.btn-lg { padding: .72rem 1.3rem; font-size: 1rem; border-radius: 11px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--tint); }
.opts { display: grid; gap: .7rem; margin-bottom: 1.4rem; }
.opts-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.opt { display: flex; gap: .9rem; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 14px; padding: 1rem 1.1rem; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.opt:hover { border-color: var(--faint); }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.opt:has(input:focus-visible) { outline: 2px solid var(--live); outline-offset: 2px; }
.opt input { margin-top: .35rem; accent-color: var(--ink); }
.opt.off { opacity: .55; cursor: not-allowed; background: var(--tint); }
.opt-body b { display: block; font-weight: 600; font-size: 1.02rem; }
.opt-body > span { display: block; color: var(--muted); font-size: .92rem; margin-top: .15rem; }
.tag { font-style: normal; font-size: .74rem; font-weight: 600; background: #E8EEFF; color: var(--accent); border-radius: 999px; padding: .1rem .5rem; margin-left: .35rem; vertical-align: middle; }
.opt-mail { align-items: center; }
.opt-mail .opt-body b { word-break: break-all; }
.avatar.sm { width: 36px; height: 36px; font-size: .85rem; flex: none; }
.newmail details { position: relative; }
.newmail summary { list-style: none; }
.newmail summary::-webkit-details-marker { display: none; }
.newmail details[open] > div { position: absolute; bottom: calc(100% + 10px); left: 0; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: .8rem 1rem; box-shadow: 0 12px 32px -12px rgba(20,33,61,.25); width: 420px; }
.how { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: 1rem; }
.how li { display: flex; gap: .9rem; align-items: flex-start; font-size: 1.02rem; }
.how li b { display: block; }
.how li span.muted { display: block; font-size: .92rem; }
.how .num { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--tint); color: var(--ink); font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.how .num.q { background: var(--attn-bg); color: var(--attn); }
.copy.big code { font-size: 1rem; padding: .6rem .8rem; background: var(--tint); border-radius: 10px; }
.watch { margin: 1.2rem 0; }
.waiting { display: flex; gap: .8rem; align-items: center; border: 1px dashed var(--line-2); border-radius: 12px; padding: .9rem 1rem; }
.waiting b, .waiting span { display: block; }
.spin { width: 20px; height: 20px; flex: none; border: 2.5px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.9s linear infinite; }
.spin.big { width: 44px; height: 44px; border-width: 3.5px; margin: 0 auto 1rem; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.mail-in { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .6rem; }
.mail-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.code { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .08em; }
.setup-card { padding: 1.3rem 1.4rem; }
.totp-code { margin: -.3rem 0 .8rem; font-size: .95rem; color: var(--ink-2); }
.totp-code b { font-family: var(--mono); font-size: 1.25rem; letter-spacing: .1em; color: var(--ink); }
.test { min-height: 260px; display: grid; place-items: center; }
.test-state { text-align: center; max-width: 520px; }
.test-state h2 { font-size: 1.5rem; margin: .4rem 0; }
.state-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .6rem; font-size: 1.8rem; font-weight: 700; }
.state-icon.ok { background: var(--ok-bg); color: var(--ok); }
.state-icon.bad { background: var(--bad-bg); color: var(--bad); }
.state-icon.attn { background: var(--attn-bg); color: var(--attn); }
.row.center { justify-content: center; margin-top: 1rem; }
.code-in { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .25em; width: 11ch; text-align: center; padding: .55rem; }
.mails { display: grid; gap: .5rem; }
.mail { border: 1px solid var(--line); border-radius: 12px; padding: .7rem 1rem; }
.mail summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.mail-text { white-space: pre-wrap; font: .85rem/1.5 var(--mono); background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: .7rem; max-height: 360px; overflow: auto; }
@media (max-width: 900px) { .setup-foot { left: 0; } }

/* Continue with Google */
.btn-google { width: 100%; justify-content: center; gap: .6rem; background: #fff; border: 1px solid var(--line-2); color: var(--ink); font-weight: 600; padding: .65rem 1rem; }
.btn-google:hover { border-color: var(--faint); background: #FAFBFC; }
.btn-google svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--faint); font-size: .82rem; margin: 1rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* live browser: keyboard state */
.typebar { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.kbd-state { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.kbd-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.kbd-state.on { color: var(--ink); font-weight: 600; }
.kbd-state.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }

/* a finished thread keeps a smaller picture of the last page */
.run[data-status="idle"] .browser:not(.human) .screen img, .run[data-status="done"] .browser:not(.human) .screen img,
.run[data-status="stopped"] .browser:not(.human) .screen img, .run[data-status="failed"] .browser:not(.human) .screen img { max-height: 280px; object-fit: cover; object-position: top left; }
.run[data-status="idle"] .browser:not(.human) .browser-bar, .run[data-status="done"] .browser:not(.human) .browser-bar { background: #44506E; }
.main { padding-bottom: 10rem; }
