/* Tokens follow the marketing dashboard (marketing/public/ui-tokens.css). */
:root {
  --font: "Inter", -apple-system, system-ui, "Segoe UI", sans-serif;
  --bg: #0e0e10; --panel: #161618; --panel2: #202023; --rail: #0e0e10;
  --hover: #1d1d20; --active: #26262b; --field: #18181b;
  --border: #26262b; --border2: #34343a; --text: #ededed; --muted: #9a9aa2;
  --green: #3ecf8e; --green-dim: #1a3b2c; --red: #f87171; --red-dim: #3a1a1a;
  --amber: #e0a72e; --amber-dim: #3a2a0a; --blue: #5bc0eb; --blue-dim: #12303d;
  --accent: #ededed; --accent-ink: #0e0e10;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  color-scheme: dark;
}
body.light {
  color-scheme: light;
  --bg: #f6f7f9; --rail: #ffffff; --panel: #ffffff; --panel2: #eef0f3;
  --hover: #f0f2f5; --active: #eef0f3; --field: #ffffff;
  --border: #e5e7eb; --border2: #d4d7dc; --text: #16181d; --muted: #5f6b7a;
  --green: #18764a; --red: #c43b3b; --amber: #936515; --blue: #1677a3;
  --green-dim: #d7f3e6; --red-dim: #fdeaea; --amber-dim: #fef3c7; --blue-dim: #e0f1f9;
  --accent: #16181d; --accent-ink: #ffffff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); display: flex; min-height: 100vh; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.card h2.mt { margin-top: 20px; }
.ml { margin-left: 6px; }
.rail-label { display: block; flex: none; font-size: 11px; color: var(--muted); padding: 0 8px; margin-bottom: -6px; text-transform: uppercase; letter-spacing: .04em; }
.grow { flex: 1; min-width: 0; }
.warn-text { color: var(--amber); }

/* Rail */
.rail { align-self: flex-start; width: 220px; flex: none; background: var(--rail); border-right: 1px solid var(--border); padding: 20px 12px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 15px; padding: 0 8px; }
.app-pick { width: 100%; }
nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--muted); font-weight: 500; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.on { background: var(--active); color: var(--text); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.me { display: flex; gap: 12px; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Page */
main { flex: 1; min-width: 0; padding: 28px 32px 48px; max-width: 1280px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 24px; font-weight: 600; }
.head p { margin: 4px 0 0; }
.row-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fresh { display: inline-flex; align-items: center; gap: 6px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 24px; }
.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }
.grid2 .card { margin-bottom: 24px; }

/* Controls */
button { font: inherit; font-weight: 600; height: 36px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border2); }
button.ghost:hover { background: var(--hover); }
button.sm { height: 28px; padding: 0 12px; font-size: 12px; }
button.danger { color: var(--red); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--border2); border-radius: var(--r-sm); padding: 0 10px; height: 36px; width: 100%; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
/* One chevron for every dropdown, with room to breathe (the native arrow sat on the edge). */
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a9aa2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px; padding-right: 34px; cursor: pointer; text-overflow: ellipsis; }
select.pill, .pill { height: 32px; border-radius: var(--r-pill); padding: 0 36px 0 14px; width: auto; background-position: right 14px center; }
.search { height: 32px; border-radius: var(--r-pill); max-width: 280px; padding: 0 14px; }
.ui-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 32px; padding: 0 12px; background: transparent; color: var(--muted); border: 1px solid var(--border); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.fchip[aria-pressed="true"] { background: var(--active); color: var(--text); border-color: var(--border2); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-pill); height: 32px; align-items: center; }
.seg-b { height: 24px; padding: 0 12px; background: transparent; color: var(--muted); font-weight: 500; }
.seg-b[aria-pressed="true"] { background: var(--active); color: var(--text); }
.ui-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: var(--r-pill); background: var(--panel2); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: center; line-height: 18px; margin-left: 6px; }
.fchip .ui-count { margin-left: 0; }

/* Status pills */
.st { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.st.green { background: var(--green-dim); color: var(--green); }
.st.red { background: var(--red-dim); color: var(--red); }
.st.amber { background: var(--amber-dim); color: var(--amber); }
.st.blue { background: var(--blue-dim); color: var(--blue); }
.st.neutral { background: var(--panel2); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--muted); }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.blue { background: var(--blue); } .dot.green { background: var(--green); }

/* Tables */
.tablewrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow-x: auto; background: var(--panel); }
.card .tablewrap { border-radius: var(--r-md); }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ctable th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ctable td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ctable tr:last-child td { border-bottom: 0; }
.ctable .num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
.ideas { table-layout: fixed; min-width: 760px; }
.ideas th:nth-child(1) { width: 72px; } .ideas th:nth-child(3) { width: 56px; } .ideas th:nth-child(4) { width: 128px; }
.ideas th:nth-child(5) { width: 96px; } .ideas th:nth-child(6) { width: 96px; } .ideas th:nth-child(7) { width: 140px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
tr.group-row td { background: var(--panel2); font-weight: 600; font-size: 12px; padding: 8px 14px; }
.empty { color: var(--muted); padding: 24px 0; }
select.stage { height: 26px; font-size: 12px; font-weight: 600; padding: 0 28px 0 11px; border-color: transparent; background-position: right 10px center; background-size: 8px 5px; }
select.stage.blue { background-color: var(--blue-dim); color: var(--blue); }
select.stage.amber { background-color: var(--amber-dim); color: var(--amber); }
select.stage.green { background-color: var(--green-dim); color: var(--green); }
select.stage.red { background-color: var(--red-dim); color: var(--red); }
select.stage.neutral { background-color: var(--panel2); color: var(--text); }

.quick-add { display: flex; gap: 8px; margin-bottom: 8px; }
.quick-add input { height: 40px; border-radius: var(--r-md); }
.quick-add select { height: 40px; }

/* Overview */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--border); border-radius: var(--r-sm); }
.list li:last-child { border-bottom: 0; }
.list li.click { cursor: pointer; }
.list li.click:hover { background: var(--hover); }
.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stage-box, .person { height: auto; padding: 10px 12px; background: var(--panel2); color: var(--text); border-radius: var(--r-md); text-align: left; display: flex; flex-direction: column; gap: 2px; font-weight: 500; }
.stage-box strong { font-size: 20px; }
.stage-box:hover, .person:hover { background: var(--active); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.releases { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 24px; }
.release { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.release.click { cursor: pointer; }
.release.click:hover { border-color: var(--border2); }
.release-top { display: flex; align-items: center; gap: 8px; }
.release-name { font-size: 14px; color: var(--muted); }
.release-name strong { color: var(--text); }
.release p { margin: 0; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv div { display: flex; flex-direction: column; }
.kv strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.rollout { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; min-width: 60px; }
.bar span { display: block; height: 100%; background: var(--green); }

/* Dialogs */
.modal { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--panel); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.modal::backdrop { background: rgb(0 0 0 / .5); }
.modal form { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0; font-size: 16px; }
.modal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-head a { text-decoration: none; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
label.check input { width: 16px; height: 16px; }
.frow { display: flex; gap: 10px; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.warn { background: var(--amber-dim); color: var(--amber); padding: 10px 12px; border-radius: var(--r-sm); margin: 0; font-size: 13px; }
.err { color: var(--red); margin: 0; font-size: 13px; }
.err:empty { display: none; }

/* Login */
body.login { align-items: center; justify-content: center; }
.login .box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin: 0; font-size: 18px; }
.login p { margin: 0; }
.login form { display: flex; flex-direction: column; gap: 8px; }
.btn { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: var(--r-pill); font-weight: 600; text-decoration: none; background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer; font: inherit; }
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid var(--border2); }

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { flex-direction: column; }
  .rail { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .rail .app-pick { width: auto; }
  nav { flex-direction: row; margin: 0; width: 100%; overflow-x: auto; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  main { padding: 20px 16px 40px; }
  .head h1 { font-size: 20px; }
  .frow { flex-direction: column; }
  .quick-add { flex-direction: column; }
  .search { max-width: none; width: 100%; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Next launch */
.next + .next { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.next-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.next-head strong { font-size: 16px; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: var(--r-sm); font-size: 13px; }
.mini li.click { cursor: pointer; }
.mini li.click:hover { background: var(--hover); }
.next p { margin: 6px 0 0; }

/* Ideas */
.title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
tr.flash td { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--green-dim); } to { background: transparent; } }
#idea-summary { margin: 0 0 8px; }
.ui-count.red { background: var(--red-dim); color: var(--red); }
.err.hint { color: var(--amber); }
.quick-add button { height: 40px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-pill); font-weight: 600; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 10; max-width: calc(100vw - 32px); }
