/* Duo: Quincy + Adam's command center. Brand tokens from the duo logo:
   forest and lime, rounded Fredoka headings, calm white cards.
   The Business Creation System is still drawn as a line with four stops. */

:root {
  --forest-900: #1F5A2E;
  --forest-700: #256B37;
  --lime-500: #A4C425;
  --lime-100: #E3F0D0;
  --lime-50: #EEF4E2;
  --ground: #F3F5F0;
  --surface: #FFFFFF;
  --line: #E1E7DA;
  --ink: #16241A;
  --ink-soft: #34463A;
  --muted: #5B6B5F;
  --warn: #D9822B;
  --warn-100: #FBE7D3;
  --warn-ink: #8A4210;
  --blue: #3F6E8C;
  --link: var(--forest-900);
  --shadow: 0 1px 2px rgba(22, 36, 26, .05);
  --head: "Fredoka", "Figtree", system-ui, sans-serif;
  --sans: "Figtree", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101812; --surface: #17221A; --line: #2A3A2E; --ink: #E8EFE6; --ink-soft: #C4D0C5;
    --muted: #9AAA9D; --lime-50: #1D2A1F; --lime-100: #2A3B22; --warn-100: #3A2A1A; --warn-ink: #F0B47A;
    --link: #A4C425; --forest-900: #2E7A43; --blue: #86B7D6; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #101812; --surface: #17221A; --line: #2A3A2E; --ink: #E8EFE6; --ink-soft: #C4D0C5;
  --muted: #9AAA9D; --lime-50: #1D2A1F; --lime-100: #2A3B22; --warn-100: #3A2A1A; --warn-ink: #F0B47A;
  --link: #A4C425; --forest-900: #2E7A43; --blue: #86B7D6; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lime-500); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12px; }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; letter-spacing: -.005em; color: var(--ink); }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
h2 { font-size: 22px; font-weight: 500; }
h3 { font-size: 18px; font-weight: 500; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- frame */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 10px 24px; min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.mark img { width: 34px; height: 34px; object-fit: contain; }
.mark b { font: 600 26px/1 var(--head); color: var(--forest-900); letter-spacing: -.01em; }
.mark span { font: 500 13px/1 var(--sans); color: var(--muted); }
.nav { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.nav a.on { background: var(--forest-900); color: #fff; }
.nav a:not(.on):hover { background: var(--lime-50); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--head); color: #fff; background: var(--forest-700); flex: none; border: 2px solid var(--surface); }
.avatar.adam { background: var(--lime-500); color: var(--ink); }
.avatar.claude { background: var(--blue); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
/* the duo motif: two overlapping round avatars */
.pair { display: inline-flex; flex: none; }
.pair .avatar + .avatar { margin-left: -9px; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.rail { padding: 20px 14px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; border-right: 1px solid var(--line); background: var(--surface); }
.rail h4 { margin: 4px 10px 10px; }
.station { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.station:hover { background: var(--lime-50); }
.station.on { background: var(--forest-900); color: #fff; }
.station.on small { color: var(--lime-100); }
.station i { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--forest-700)); box-shadow: 0 0 0 2px var(--surface); }
.station span { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station small { font: 12px var(--sans); color: var(--muted); }
.rail .add { margin-top: 12px; width: 100%; justify-content: center; }
.together { margin-top: 20px; background: var(--lime-50); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.together img { width: 40px; height: 40px; object-fit: contain; }
main { padding: 28px clamp(16px, 3vw, 40px) 80px; min-width: 0; max-width: 1240px; width: 100%; margin: 0 auto; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--lime-50); }
.btn.primary { background: var(--forest-900); border-color: var(--forest-900); color: #fff; }
.btn.primary:hover { background: var(--forest-700); }
.btn.signal { background: var(--lime-500); border-color: var(--lime-500); color: var(--ink); }
.btn.signal:hover { background: #B3D13A; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--lime-50); }
.btn.danger { border-color: var(--warn); color: var(--warn-ink); background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--forest-700); box-shadow: 0 0 0 3px var(--lime-500); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
label { display: block; font: 600 13px/1.2 var(--sans); color: var(--ink-soft); margin: 14px 0 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 13px/1 var(--sans); cursor: pointer; }
.chip.on { border-color: var(--forest-900); background: var(--forest-900); color: #fff; }

/* ---------------------------------------------------------------- the line */
.line { display: grid; grid-template-columns: repeat(4, 1fr); margin: 24px 0 6px; position: relative; }
.line::before { content: ""; position: absolute; left: 13px; right: 13px; top: 11px; height: 6px; background: var(--line); border-radius: 3px; }
.line .fill { position: absolute; left: 13px; top: 11px; height: 6px; background: var(--forest-700); border-radius: 3px; transition: width .4s; }
.stop { position: relative; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; min-height: 44px; }
.stop:last-child { align-items: flex-end; text-align: right; }
.stop b { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 5px solid var(--line); position: relative; z-index: 1; transition: transform .15s; }
.stop.past b { border-color: var(--forest-700); background: var(--forest-700); }
.stop.here b { border-color: var(--lime-500); background: var(--forest-900); box-shadow: 0 0 0 5px var(--lime-100); }
.stop:hover b { transform: scale(1.1); }
.stop span { font: 600 12px/1.2 var(--sans); color: var(--muted); }
.stop.here span { color: var(--ink); }
.paused-tag, .pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font: 600 12px/1.4 var(--sans); }
.paused-tag { background: var(--warn-100); color: var(--warn-ink); }
.pill.good { background: var(--lime-100); color: var(--forest-900); }

/* ---------------------------------------------------------------- project head */
.phead { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.phead h1 { font-size: clamp(30px, 4vw, 40px); }
.tabs { display: flex; gap: 4px; margin: 24px 0 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--forest-900); border-color: var(--forest-900); }

/* ---------------------------------------------------------------- board */
.board { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.col { background: var(--lime-50); border-radius: 20px; padding: 12px; min-height: 240px; border: 2px dashed transparent; }
.col.drop { border-color: var(--lime-500); }
.col-h { display: flex; align-items: center; justify-content: space-between; margin: 4px 6px 10px; }
.col-h .eyebrow { color: var(--ink); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; cursor: grab; box-shadow: var(--shadow); }
.card:hover { border-color: var(--forest-700); }
.card.dragging { opacity: .4; }
.card h5 { margin: 0 0 8px; font: 600 14px/1.35 var(--sans); }
.card .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); margin-right: 6px; vertical-align: 1px; }
.card .foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.stamp { font: 600 11px/1 var(--sans); padding: 5px 9px; border-radius: 999px; }
.stamp.ideation { background: #E2ECF3; color: #2C5672; }
.stamp.design_build { background: var(--lime-100); color: var(--forest-900); }
.stamp.engines { background: var(--forest-900); color: #fff; }
.due { font: 600 12px var(--sans); color: var(--muted); }
.due.late { color: var(--warn-ink); }
.quickadd { width: 100%; min-height: 44px; border: 1px dashed var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.quickadd:hover { border-color: var(--forest-700); color: var(--forest-900); }

/* ---------------------------------------------------------------- advice */
.advice { margin: 20px 0 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.advice .bulb { width: 44px; height: 44px; border-radius: 50%; background: var(--lime-500); display: grid; place-items: center; }
.advice ol { margin: 6px 0 0; padding-left: 20px; font-size: 16px; line-height: 1.5; color: var(--ink-soft); }
.advice li { margin: 4px 0; }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 22px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; }
.stat .eyebrow { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink-soft); }
.stat .eyebrow::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--sc, var(--forest-700)); }
.stat b { display: block; font: 600 38px/1 var(--head); margin-top: 12px; color: var(--ink); }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.feed li:last-child { border: 0; }
.feed time { display: block; font: 12px var(--sans); color: var(--muted); }
.feed.dated li { grid-template-columns: 110px 1fr; }

/* the system map on the overview */
.map { display: grid; gap: 4px; }
.map-row { display: grid; grid-template-columns: 170px 1fr 52px; gap: 14px; align-items: center; min-height: 48px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.map-row:last-child { border: 0; }
.map-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track { position: relative; height: 16px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: var(--line); border-radius: 2px; }
.track .run { position: absolute; left: 0; top: 6px; height: 4px; background: var(--forest-700); border-radius: 2px; }
.track .dot { position: absolute; top: 0; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--lime-500); border: 3px solid var(--forest-900); }
.track .tick { position: absolute; top: 4px; width: 2px; height: 8px; background: var(--muted); opacity: .4; }
.map-legend { display: grid; grid-template-columns: 170px 1fr 52px; gap: 14px; }
.map-legend div { display: flex; justify-content: space-between; }

/* ---------------------------------------------------------------- handoff */
.prompt { font: 13px/1.6 var(--mono); min-height: 300px; background: var(--ground); }
.history { max-height: 380px; overflow: auto; }
.history details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.history summary { cursor: pointer; font-size: 14px; min-height: 32px; }
.history pre { white-space: pre-wrap; font: 12px/1.5 var(--mono); background: var(--ground); padding: 10px; border-radius: 12px; }

/* ---------------------------------------------------------------- media */
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.crumbs a { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.tile:hover { border-color: var(--forest-700); }
.tile .thumb { aspect-ratio: 4/3; background: var(--lime-50); display: grid; place-items: center; overflow: hidden; }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .thumb .glyph { font: 600 13px var(--sans); color: var(--muted); letter-spacing: .08em; }
.tile .cap { padding: 8px 10px; font-size: 13px; }
.tile .cap div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dropzone { border: 2px dashed var(--line); border-radius: 20px; padding: 18px; text-align: center; color: var(--muted); margin-top: 16px; }
.dropzone.drop { border-color: var(--lime-500); color: var(--ink); background: var(--lime-50); }

/* ---------------------------------------------------------------- timeline */
.gantt { overflow-x: auto; }
.gantt-inner { min-width: 760px; position: relative; }
.g-head { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--line); }
.g-weeks { position: relative; height: 30px; }
.g-weeks span { position: absolute; top: 8px; font: 11px var(--sans); color: var(--muted); transform: translateX(-50%); }
.g-row { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--line); min-height: 48px; align-items: center; }
.g-row .name { font-weight: 600; padding-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.g-lane { position: relative; height: 48px; }
.g-bar { position: absolute; top: 16px; height: 16px; border-radius: 8px; }
.g-bar.ideation { background: #8FB0C6; }
.g-bar.design_build { background: var(--lime-500); }
.g-bar.engines { background: var(--forest-700); }
.g-pin { position: absolute; top: 20px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); cursor: pointer; }
.g-pin.done { background: var(--ink); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); z-index: 2; }
.g-today::after { content: "Today"; position: absolute; top: -2px; left: 4px; font: 600 10px var(--sans); color: var(--warn-ink); }
.legend { display: flex; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.legend i { width: 18px; height: 8px; border-radius: 4px; display: inline-block; }

/* ---------------------------------------------------------------- clients */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.client { cursor: pointer; }
.client:hover { border-color: var(--forest-700); }

/* ---------------------------------------------------------------- modal */
.scrim { position: fixed; inset: 0; background: rgba(22, 36, 26, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; border: 1px solid var(--line); box-shadow: 0 24px 50px -20px rgba(0,0,0,.35); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; z-index: 60; font-size: 14px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; background: var(--surface); }
.empty img { width: 64px; height: 64px; object-fit: contain; display: block; margin: 0 auto 10px; }

/* ---------------------------------------------------------------- auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: var(--lime-50); padding: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; text-align: center; }
.auth-art img { width: min(240px, 60%); height: auto; }
.auth-art h1 { font-size: clamp(32px, 4.5vw, 52px); color: var(--forest-900); }
.auth-art p { color: var(--ink-soft); max-width: 28em; margin: 0; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.auth-form form, .auth-form .box { width: min(380px, 100%); }
.code { font: 600 28px/1 var(--mono); letter-spacing: .35em; text-align: center; padding: 14px !important; }
.qr { background: #fff; padding: 8px; border-radius: 12px; display: inline-block; border: 1px solid var(--line); }
.qr svg { display: block; width: 190px; height: 190px; }
.secret { font: 12px var(--mono); word-break: break-all; background: var(--ground); padding: 8px; border-radius: 12px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font: 14px var(--mono); background: var(--ground); padding: 12px; border-radius: 12px; }
.err { color: var(--warn-ink); font-size: 14px; min-height: 20px; margin-top: 8px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; }
  .rail h4, .together { display: none; }
  .station { grid-template-columns: 12px auto; flex: none; }
  .station small { display: none; }
  .rail .add { width: auto; margin: 0; flex: none; }
  .grid2 { grid-template-columns: 1fr; }
  .map-row, .map-legend { grid-template-columns: 100px 1fr 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 16px; }
  .auth-art img { width: 120px; }
  main { padding: 18px 16px 80px; }
  .top { padding: 8px 16px; gap: 10px; flex-wrap: wrap; }
  .mark span { display: none; }
}
@media (max-width: 560px) {
  .board { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .line span { font-size: 10px; }
  .who .name { display: none; }
  .nav { order: 3; width: 100%; flex-wrap: wrap; margin-left: 0; }
}
