@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600&display=swap");

:root {
  --bg: #100c0a; --bg-2: #16110d; --surface: #1c1611; --surface-2: #231b15;
  --line: rgba(226, 198, 170, .12); --line-2: rgba(226, 198, 170, .22);
  --ink: #f3ece3; --ink-dim: #c3b4a4; --muted: #8d8073;
  --copper: #c87b45; --copper-hi: #e49a5f; --wait: #e2b54a; --ok: #7fb069; --err: #e0705a;
  --display: "Fraunces", Georgia, serif; --body: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --r: 14px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); min-height: 100vh; }
a { color: var(--copper-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; font-family: var(--body); }
p { margin: 0; }
.muted { color: var(--muted); }
.dim { color: var(--ink-dim); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
[hidden] { display: none !important; }

/* top bar + tabs */
.top { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.brand { font: 600 20px var(--display); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--copper-hi), var(--copper) 60%, #7a4422); }
.brand small { font: 500 13px var(--body); color: var(--muted); }
.top .grow { flex: 1; }
.top select { max-width: 280px; }
.who { color: var(--ink-dim); font-size: 14px; display: flex; gap: 12px; align-items: center; }
.top .wrap.tabs, .tabs { display: flex; gap: 4px; overflow-x: auto; flex-wrap: nowrap; min-height: 0; }
.tabs a { padding: 12px 14px; color: var(--ink-dim); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--copper); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--copper); color: #1a0f08; font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
main.wrap { padding-block: 28px 64px; display: grid; gap: 22px; }

/* building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--line-2); color: var(--ink-dim); }
.pill.you { border-color: var(--wait); color: var(--wait); }
.pill.pennies { border-color: var(--copper); color: var(--copper-hi); }
.pill.done { border-color: var(--ok); color: var(--ok); }

button, .btn { font: 600 15px var(--body); border-radius: 10px; padding: 10px 16px; border: 1px solid var(--copper); background: var(--copper); color: #1a0f08; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
button.danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 50%, transparent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--copper-hi); outline-offset: 2px; }
input, select, textarea { font: 15px var(--body); color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 96px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { opacity: .7; }
label.field { display: grid; gap: 6px; font-weight: 500; }
.note { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); color: var(--ink-dim); font-size: 14px; }
.error { color: var(--err); font-size: 14px; }
.ok { color: var(--ok); font-size: 14px; }

/* next action banner */
.next { display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line-2); background: linear-gradient(120deg, rgba(200, 123, 69, .14), transparent 60%), var(--surface); }
.next.client { border-color: color-mix(in srgb, var(--wait) 55%, transparent); background: linear-gradient(120deg, rgba(226, 181, 74, .14), transparent 60%), var(--surface); }
.next strong { font: 600 20px var(--display); }

/* pipeline stepper */
.pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; counter-reset: st; }
.pipe li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 0 4px; font-size: 13px; color: var(--muted); }
.pipe li::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; height: 2px; background: var(--line-2); }
.pipe li:first-child::before { display: none; }
.pipe .dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--bg-2); border: 2px solid var(--line-2); color: var(--muted); }
.pipe li.done { color: var(--ink-dim); }
.pipe li.done::before, .pipe li.active::before, .pipe li.waiting::before { background: var(--copper); }
.pipe li.done .dot { background: var(--copper); border-color: var(--copper); color: #1a0f08; }
.pipe li.active .dot { border-color: var(--copper-hi); color: var(--copper-hi); box-shadow: 0 0 0 6px rgba(200, 123, 69, .18); }
.pipe li.waiting .dot { border-color: var(--wait); color: var(--wait); box-shadow: 0 0 0 6px rgba(226, 181, 74, .16); }
.pipe li.current { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .pipe { grid-template-columns: 1fr; gap: 10px; }
  .pipe li { grid-template-columns: 36px 1fr; justify-items: start; text-align: left; align-items: center; }
  .pipe li::before { display: none; }
}
.stage { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.stage:first-child { border-top: 0; }
.stage .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; border: 1px solid var(--line-2); color: var(--muted); }
.stage.done .n { background: var(--copper); border-color: var(--copper); color: #1a0f08; }
.stage.current { background: linear-gradient(90deg, rgba(200, 123, 69, .08), transparent); }
.editor { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 8px; }

/* intake */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.steps button { width: 100%; text-align: left; background: transparent; border: 1px solid transparent; color: var(--ink-dim); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.steps button[aria-current="step"] { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
.steps .tick { color: var(--ok); }
.intake { display: grid; gap: 22px; grid-template-columns: 260px 1fr; align-items: start; }
@media (max-width: 760px) { .intake { grid-template-columns: 1fr; } }

/* thread + timeline */
.msgs { display: grid; gap: 12px; }
.msg { max-width: 78%; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.msg.mine { justify-self: end; background: rgba(200, 123, 69, .16); border-color: rgba(200, 123, 69, .35); }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.kind { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--copper-hi); font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-top: 0; }
.scroll { overflow-x: auto; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.center .card { width: min(420px, 100%); display: grid; gap: 16px; }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, monospace; font-size: 13px; }
