/* Opportunity Desk. Robert is blue, Keith is copper, and a step in play wears its owner's colour. */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --ink: #18212d;
  --muted: #5b6878;
  --line: #cdd5df;
  --soft: #e2e7ee;
  --robert: #2456b8;
  --robert-tint: #e1e9f8;
  --keith: #ad4f17;
  --keith-tint: #f8e8da;
  --on-fill: #ffffff;
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151b; --surface: #1b222c; --ink: #e8edf3; --muted: #9ba8b7; --line: #323c49; --soft: #262f3b;
    --robert: #86aef7; --robert-tint: #19263f; --keith: #eba36a; --keith-tint: #382516; --on-fill: #11151b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151b; --surface: #1b222c; --ink: #e8edf3; --muted: #9ba8b7; --line: #323c49; --soft: #262f3b;
  --robert: #86aef7; --robert-tint: #19263f; --keith: #eba36a; --keith-tint: #382516; --on-fill: #11151b;
  color-scheme: dark;
}

body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45; }
#desk * { box-sizing: border-box; }
#desk h1, #desk h2, #desk h3, #desk p { margin: 0; }
#desk a { color: var(--robert); }
.robert { --owner: var(--robert); --tint: var(--robert-tint); }
.keith { --owner: var(--keith); --tint: var(--keith-tint); }
.both { --owner: var(--ink); --tint: var(--soft); }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--owner, var(--muted)); }
.display { font-family: var(--font-display); }

/* Header */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-block: 10px; }
.brand { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
#desk .nav { color: var(--ink); font-weight: 600; text-decoration: none; padding: 10px 0; border-bottom: 2px solid var(--ink); }
.bar .right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { min-height: 40px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--owner); color: var(--on-fill); }
.spike { background: var(--soft); font-size: 13px; }
.spike .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-block: 6px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.fill { border-color: var(--owner, var(--ink)); background: var(--owner, var(--ink)); color: var(--on-fill); }
.btn.dark { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn.line { border: 1.5px solid var(--ink); }
.btn:disabled { border-color: var(--soft); background: var(--soft); color: var(--muted); cursor: not-allowed; }
.btn.quiet { min-height: 36px; padding: 0 10px; font-weight: 500; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .lab { font-size: 13px; color: var(--muted); }
#desk input[type="text"], #desk input[type="email"], #desk input[type="password"], #desk textarea, #desk select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
#desk textarea { min-height: 84px; resize: vertical; }
#desk input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--owner, var(--ink)); }
#desk :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

main.wrap { padding-block: 26px 44px; display: flex; flex-direction: column; gap: 26px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; }
.head h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.15; }
.tally { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.tally b { font-size: 20px; color: var(--owner, var(--ink)); }

/* Board */
.group { display: flex; flex-direction: column; gap: 10px; }
.group > h2 { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--owner, var(--ink)); }
.group > h2::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--owner, var(--ink)); }
#desk .row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.row .name { flex: 1 1 170px; min-width: 0; }
.row .name b { display: block; font-family: var(--font-display); font-size: 18px; overflow-wrap: anywhere; }
.row .at { flex: 2 1 240px; min-width: 0; }
.row .count { flex: none; min-width: 130px; text-align: right; }
.track { display: flex; gap: 6px; }
.dot { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-display); font-size: 14px; font-weight: 700; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); }
.dot.now { border-color: var(--owner); background: var(--owner); color: var(--on-fill); }
.dot.done { border-color: var(--tint); background: var(--tint); color: var(--owner); }
.empty { padding: 16px 20px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 12px; }
.cols > * { flex: 1 1 300px; min-width: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; border: 1.5px solid var(--ink); color: var(--ink); }
.chip.fill { background: var(--ink); color: var(--bg); }
.chip.soft { border-color: var(--soft); background: var(--soft); }

/* One opportunity */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { min-width: 0; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile .num { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-display); font-size: 16px; font-weight: 700; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); }
.tile .who { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--owner); }
.tile-title { font-size: 13px; font-weight: 500; line-height: 1.3; }
.tile-state { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.tile.now { border: 2px solid var(--owner); padding: 11px; }
.tile.now .num { border-color: var(--owner); background: var(--owner); color: var(--on-fill); }
.tile.now .tile-state { color: var(--owner); }
.tile.done .num { border-color: var(--tint); background: var(--tint); color: var(--owner); }
.tile.locked { border-style: dashed; background: transparent; color: var(--muted); }
.tile.locked .who { color: var(--muted); }
.tile.sel { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.split > .main { flex: 999 1 520px; min-width: 0; }
.split > aside { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.step-head { display: flex; align-items: center; gap: 14px; }
.step-head .big { flex: none; width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-display); font-size: 28px; font-weight: 700; background: var(--owner); color: var(--on-fill); }
.step-head h2 { font-family: var(--font-display); font-size: 20px; font-weight: 500; line-height: 1.25; }
.stage { padding: 12px 16px; border-radius: 8px; background: var(--bg); }
.stage.now { background: var(--tint); }
.checks { display: flex; flex-direction: column; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; }
.check label, .check .txt { flex: 1; min-width: 0; }
.check .when { flex: none; font-size: 13px; color: var(--muted); }
.box { flex: none; width: 22px; height: 22px; border-radius: 4px; border: 1.5px solid var(--line); display: grid; place-items: center; color: var(--on-fill); }
.box.on { border-color: var(--owner); background: var(--owner); }
.box svg { width: 13px; height: 13px; }
.fields { display: flex; flex-direction: column; gap: 14px; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
#desk table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 14px; }
#desk th { text-align: left; padding: 9px 12px; font-weight: 600; background: var(--bg); }
#desk td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
#desk td input[type="text"], #desk td select { min-height: 40px; }
.kv { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--soft); }
.kv .k { flex: 0 0 170px; color: var(--muted); }
.kv .v { flex: 1 1 200px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.gate { border-top: 1px dashed var(--line); padding-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.alert { padding: 10px 14px; border-radius: 8px; border: 1.5px solid var(--ink); font-weight: 500; }
.note { padding: 10px 0; border-top: 1px solid var(--soft); }
.note .by { font-size: 12px; font-weight: 600; color: var(--owner); }
.offer { padding: 12px 16px; border-radius: 8px; background: var(--keith-tint); }
.choice { padding: 16px; border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.signin { max-width: 420px; margin: 48px auto 0; }
