:root {
  --bg: #0d0f14;
  --panel: #161922;
  --panel-2: #1c2030;
  --line: #262b3a;
  --text: #eceef3;
  --muted: #8b91a3;
  --accent: #ff6b0d;
  --accent-2: #ffb347;
  --green: #2fcf6b;
  --yellow: #f5b82e;
  --red: #ef4a3c;
  --blue: #5aa9ff;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(255,107,13,.10), transparent 60%),
                    radial-gradient(900px 400px at -10% 0%, rgba(90,169,255,.07), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 60px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px);
  background: rgba(13,15,20,.75); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 62px; padding-bottom: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d00; font-weight: 900; }
.brand small { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--muted); padding: 7px 13px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--panel-2); }
.live { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* headings */
.head { display: flex; align-items: end; justify-content: space-between; margin: 34px 0 16px; gap: 12px; }
h1 { font-size: 28px; letter-spacing: -.03em; margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 38px 0 14px;
  display: flex; align-items: center; gap: 10px; }
h2 .count { background: var(--panel-2); color: var(--text); border-radius: 20px; padding: 1px 9px; letter-spacing: 0; font-size: 12px; }
.sub { color: var(--muted); margin: 4px 0 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.hot { border-color: rgba(255,107,13,.5); background: linear-gradient(180deg, rgba(255,107,13,.12), var(--panel)); }

/* approval card */
.approve { display: grid; grid-template-columns: 300px 1fr; gap: 26px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px; padding: 20px; margin-bottom: 18px;
  box-shadow: 0 20px 50px -30px rgba(0,0,0,.8); }
.phone { position: relative; width: 300px; aspect-ratio: 9/16; border-radius: 22px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 6px #050608, 0 0 0 7px #2a2f3d; }
.phone video { width: 100%; height: 100%; object-fit: cover; display: block; }
.approve h3 { font-size: 22px; letter-spacing: -.02em; margin: 2px 0 8px; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.chip.t-what-if { color: #ffcf8a; border-color: rgba(255,179,71,.35); }
.chip.t-why { color: #9fd0ff; border-color: rgba(90,169,255,.35); }
.chip.t-fact { color: #b6f5c9; border-color: rgba(47,207,107,.35); }
label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 6px; }
textarea, input[type=text], input[type=password], input[type=url] {
  width: 100%; background: #0f1218; color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,13,.18); }
textarea { min-height: 150px; resize: vertical; }
.counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
button, .btn { border: 0; border-radius: 12px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .08s, filter .15s; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
button:hover, .btn:hover { filter: brightness(1.1); text-decoration: none; }
button:active { transform: translateY(1px); }
.b-ok { background: linear-gradient(135deg, #24b45a, var(--green)); color: #04150a; }
.b-main { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d00; }
.b-ghost { background: var(--panel-2); border: 1px solid var(--line); }
.b-warn { background: rgba(245,184,46,.15); color: var(--yellow); border: 1px solid rgba(245,184,46,.35); }
.b-bad { background: rgba(239,74,60,.12); color: #ff8b80; border: 1px solid rgba(239,74,60,.35); }
.more { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 6px; }
details > summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; list-style: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
.note { border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 10px 0; }
.note.warn { background: rgba(245,184,46,.1); color: #ffd77a; border: 1px solid rgba(245,184,46,.25); }
.note.ok { background: rgba(47,207,107,.1); color: #9ff0bd; border: 1px solid rgba(47,207,107,.25); }
.flash { background: rgba(47,207,107,.12); border: 1px solid rgba(47,207,107,.3); color: #b6f5c9;
  padding: 12px 16px; border-radius: 14px; margin-top: 20px; }

/* pipeline stepper */
.steps { display: flex; gap: 4px; margin: 4px 0 12px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.done { background: var(--accent); }
.steps i.now { background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .45; } }

/* tile grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: #353b4f; }
.thumb { aspect-ratio: 9/12; background: linear-gradient(160deg, #1d2232, #12151d); display: grid; place-items: center;
  font-size: 40px; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge { position: absolute; left: 10px; top: 10px; }
.tile .body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tile h4 { margin: 0; font-size: 15px; line-height: 1.3; }
.tile .meta { color: var(--muted); font-size: 12px; margin-top: auto; }
.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 22px; text-align: center; }

/* card thread (the agents' notes) */
.thread { margin-top: 6px; }
.msg { display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin: 12px 0; }
.msg .who { font-weight: 700; font-size: 13px; }
.msg .txt { font-size: 14px; color: #cfd3de; }
.msg .txt ul { margin: 4px 0; padding-left: 18px; }
.msg .txt p { margin: 4px 0; }

/* avatars */
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #0d0f14; }
.av.lg { width: 48px; height: 48px; font-size: 19px; }
.av-vira { background: #ff8a3d; } .av-chefin { background: #f5b82e; } .av-george { background: #5aa9ff; }
.av-pericles { background: #c38bff; } .av-cleiton { background: #2fcf6b; } .av-owner { background: #eceef3; }

/* agents */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.agent { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.agent.running { border-color: rgba(47,207,107,.45); box-shadow: 0 0 0 1px rgba(47,207,107,.15), 0 14px 40px -24px rgba(47,207,107,.5); }
.agent header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.agent header b { font-size: 17px; display: block; }
.agent header span { color: var(--muted); font-size: 13px; }
.state { margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: var(--panel-2); color: var(--muted); }
.state.on { background: rgba(47,207,107,.14); color: var(--green); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(47,207,107,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(47,207,107,0); } 100% { box-shadow: 0 0 0 0 rgba(47,207,107,0); } }
.log { list-style: none; padding: 0; margin: 0; font-size: 13px; border-left: 2px solid var(--line); }
.log li { padding: 4px 0 4px 12px; color: #c4c9d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log li:last-child { color: var(--text); font-weight: 600; }
.summary { background: #0f1218; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px;
  white-space: pre-wrap; color: #c4c9d6; max-height: 220px; overflow: auto; margin-top: 12px; }
.runs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.runs a { font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--panel-2); color: var(--muted); }
.agent .when { color: var(--muted); font-size: 12px; margin-bottom: 10px; }

/* accounts */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.acct { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.acct .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; }
.ic-ig { background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7); color: #fff; }
.ic-tt { background: #000; color: #fff; border: 1px solid #333; }
.ic-yt { background: #ff0033; color: #fff; }
.acct b { display: block; } .acct span { font-size: 13px; color: var(--muted); }
.acct .btn { margin-left: auto; padding: 8px 12px; font-size: 13px; }

/* login + legal */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 30px; text-align: center; }
.login .logo { width: 54px; height: 54px; border-radius: 16px; font-size: 26px; margin: 0 auto 14px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login form { margin-top: 20px; display: grid; gap: 10px; }
.login button { justify-content: center; }
.legal { max-width: 760px; margin: 40px auto; padding: 0 20px 60px; color: #cfd3de; }
.legal h1 { margin-bottom: 6px; } .legal h2 { text-transform: none; letter-spacing: 0; font-size: 18px; color: var(--text); }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .approve { grid-template-columns: 1fr; }
  .phone { width: 100%; max-width: 320px; margin: 0 auto; }
  .nav a { padding: 7px 9px; }
  .brand small, .live span.long { display: none; }
}

/* fixes: text-only thumbnails, code blocks, mobile nav */
.thumb.novid { aspect-ratio: 16/10; padding: 18px; place-items: end start; text-decoration: none;
  background: linear-gradient(150deg, #262c40, #151925 60%), #151925; }
.thumb .ph { font-size: 17px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #dfe3ee;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb.novid + .body h4 { display: none; }
pre.code { background: #0b0d12; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: 12px/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; color: #c9d1e3; margin: 6px 0; }
code { font: 12.5px ui-monospace, Menlo, monospace; background: #0f1218; padding: 1px 5px; border-radius: 5px; }
@media (max-width: 760px) {
  .top .wrap { gap: 10px; }
  .brand { font-size: 0; gap: 0; }
  .nav { margin-left: 0; overflow-x: auto; }
  .live { display: none; }
}
.grid { align-items: start; }
.av { flex-shrink: 0; }
.agent header > div:nth-child(2) { min-width: 0; }
.state { flex-shrink: 0; white-space: nowrap; }
/* keep long links and code inside the panel */
.approve > div, .msg > div, .tile .body { min-width: 0; }
.msg .txt, .summary { overflow-wrap: anywhere; }
pre.code { overflow-x: auto; white-space: pre; }
/* agent controls */
.ctl { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ctl .actions { margin-top: 0; }
.ctl button { padding: 8px 13px; font-size: 13px; }
.sched { margin-top: 8px; }
.sched input[type=text] { margin: 6px 0; padding: 9px 12px; }
.chk { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); margin: 4px 12px 0 0; }
/* who's next */
.next { display: grid; grid-template-columns: 26px 1fr; gap: 9px; align-items: start; background: #0f1218;
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; margin-top: 4px; }
.next .av { width: 26px; height: 26px; font-size: 11px; }
.next .lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.next b { display: block; font-size: 13px; line-height: 1.3; }
.next .why { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.next.big { grid-template-columns: 34px 1fr; padding: 12px 14px; margin: 6px 0 4px; }
.next.big .av { width: 34px; height: 34px; font-size: 14px; }
.next.big b { font-size: 15px; } .next.big .why { font-size: 13px; }
/* ideas */
.nc { background: var(--panel-2); border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: 2px; }
.nav a.on .nc { background: var(--accent); color: #1a0d00; }
.ideas { display: grid; gap: 14px; }
.idea { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.idea h3 { font-size: 19px; letter-spacing: -.02em; margin: 2px 0 6px; }
.idea .pitch { font-size: 16px; color: #dfe3ee; margin: 0 0 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-bottom: 10px; }
.facts div { background: #0f1218; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 13px; color: #c4c9d6; overflow-wrap: anywhere; }
.facts span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 2px; }
.chef { display: grid; grid-template-columns: 26px 1fr; gap: 9px; font-size: 13px; color: #c4c9d6; margin: 8px 0;
  background: rgba(245,184,46,.06); border: 1px solid rgba(245,184,46,.2); border-radius: 12px; padding: 9px 10px; overflow-wrap: anywhere; }
.chef .av { width: 26px; height: 26px; font-size: 11px; } .chef ul { margin: 0; padding-left: 16px; } .chef p { margin: 0; }
.idea .txt { font-size: 13px; color: #c4c9d6; overflow-wrap: anywhere; } .idea .txt ul { padding-left: 18px; }
.chip.hold { color: var(--yellow); border-color: rgba(245,184,46,.35); }
.discard { display: flex; gap: 8px; margin-top: 10px; }
.discard input { flex: 1; padding: 9px 12px; }
.discard button { padding: 9px 14px; font-size: 13px; }
.idea.gone { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; opacity: .8; }
.idea.gone h3 { font-size: 15px; margin: 0; } .idea.gone .sub { font-size: 13px; margin: 2px 0 0; }
@media (max-width: 760px) { .discard { flex-direction: column; } }
/* chain panel */
.chainbox { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; margin-bottom: 18px; }
.chainbox.on { border-color: rgba(255,107,13,.4); background: linear-gradient(180deg, rgba(255,107,13,.07), var(--panel)); }
.chainbox .row { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.chainbox b { display: block; font-size: 16px; margin-bottom: 2px; }
.caps { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.cap { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); margin: 0; }
.cap input { width: 64px; background: #0f1218; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; font: inherit; }
@media (max-width: 760px) { .chainbox .row { flex-direction: column; align-items: stretch; } }
/* George's progress */
.prog { background: #0f1218; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.tile .prog { margin: 4px 0 0; padding: 10px 11px; }
.ptitle { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.pbar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--blue), #8fd0ff);
  box-shadow: 0 0 12px rgba(90,169,255,.5); transition: width .6s; }
.prow { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.prow b { font-size: 20px; letter-spacing: -.02em; }
.prow span { color: var(--muted); font-size: 13px; }
.tile .prow b { font-size: 16px; } .tile .prow span { font-size: 12px; }
.peta { font-size: 13px; color: #c4c9d6; margin-top: 2px; }
.tile .peta { font-size: 12px; }
.chip.score { color: #ffd77a; border-color: rgba(245,184,46,.35); }
.stockbar { display: grid; grid-template-columns: auto 160px 1fr; gap: 12px; align-items: center; margin-top: 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.stockbar b { color: var(--text); font-size: 14px; }
@media (max-width: 760px) { .stockbar { grid-template-columns: 1fr; } }
