:root {
  --bg: #fafaf9;
  --col: #f3f3f1;
  --card: #ffffff;
  --line: #e6e5e1;
  --line-strong: #d6d4cf;
  --text: #17171a;
  --muted: #76757d;
  --faint: #a3a2a8;
  --accent: #5b4fe9;
  --accent-soft: rgba(91, 79, 233, 0.09);
  --ok: #1f9d55;
  --hire: #e0892b;
  --ai: #7c5cf0;
  --sec: #1597a3;
  --shadow: 0 1px 2px rgba(20, 20, 30, 0.04), 0 1px 1px rgba(20, 20, 30, 0.03);
  --shadow-lift: 0 18px 40px -12px rgba(20, 20, 40, 0.22), 0 4px 10px -4px rgba(20, 20, 40, 0.12);
  --radius: 10px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e;
    --col: #121215;
    --card: #18181c;
    --line: #26262c;
    --line-strong: #34343b;
    --text: #ededef;
    --muted: #8d8c95;
    --faint: #5d5c65;
    --accent: #8b80ff;
    --accent-soft: rgba(139, 128, 255, 0.12);
    --ok: #3fcf7f;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
    --shadow-lift: 0 24px 50px -12px rgba(0, 0, 0, 0.7), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0e;
  --col: #121215;
  --card: #18181c;
  --line: #26262c;
  --line-strong: #34343b;
  --text: #ededef;
  --muted: #8d8c95;
  --faint: #5d5c65;
  --accent: #8b80ff;
  --accent-soft: rgba(139, 128, 255, 0.12);
  --ok: #3fcf7f;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  --shadow-lift: 0 24px 50px -12px rgba(0, 0, 0, 0.7), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 52px; padding: 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  background: var(--text); color: var(--bg);
}
.logo svg { width: 14px; height: 14px; stroke-width: 2.2; }
.brand { font-weight: 600; letter-spacing: -0.01em; }
.crumb-sep { color: var(--faint); }
.crumb { color: var(--muted); }
.status {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 12.5px; color: var(--text);
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
}
.status-sub { color: var(--muted); }
.status-sub::before { content: "·"; margin-right: 8px; color: var(--faint); }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pulse::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid var(--ok); opacity: 0; animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- board ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 16px 40px; }
.lede {
  margin: 0; font-size: clamp(20px, 2.6vw, 26px); font-weight: 500;
  letter-spacing: -0.025em; line-height: 1.25;
}
h1.lede { font-size: clamp(20px, 2.6vw, 26px); font-weight: 500; }
.lede span { color: var(--muted); }

/* intro: portrait + who I am */
.intro { display: flex; align-items: center; gap: 22px; margin: 0 0 24px; }
.portrait {
  flex: none; width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-lift);
}
.intro-text { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.intro-sub { margin: 0; color: var(--muted); font-size: 14.5px; }
.intro-sub strong { color: var(--text); font-weight: 500; }
.call-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--card); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.call-btn svg { width: 15px; height: 15px; color: var(--accent); }
.call-btn:hover { border-color: var(--accent); }
.call-btn:active { transform: scale(.98); }

.board { display: grid; grid-template-columns: 1.15fr 1fr 0.85fr; gap: 14px; align-items: stretch; }
.col {
  background: var(--col); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px; min-width: 0; display: flex; flex-direction: column;
}
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 10px;
}
.col-head h2 { margin: 0; font-size: 13px; font-weight: 500; }
.col-icon { width: 15px; height: 15px; color: var(--muted); flex: none; }
.col-icon.accent { color: var(--accent); }
.col-icon.accent .fill { fill: currentColor; stroke: none; }
.col-icon.done .fill { fill: var(--ok); stroke: var(--ok); }
.col-icon.done .check { stroke: var(--card); stroke-width: 1.6; }
.count { font: 500 12px var(--mono); color: var(--muted); }
.col-hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.cards { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.col-drop .dropzone { flex: 1; }

/* ---------- cards ---------- */
.card {
  position: relative; display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 10px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s, opacity .15s;
}
button.card { cursor: pointer; touch-action: manipulation; }
@media (hover: hover) {
  button.card { cursor: grab; }
  button.card:hover { border-color: var(--line-strong); }
  button.card:hover .assign-hint { opacity: 1; transform: none; }
}
.card.is-source { opacity: .35; }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.key { font: 500 11.5px var(--mono); color: var(--muted); letter-spacing: 0.01em; }
.assign-hint {
  margin-left: auto; font-size: 11.5px; color: var(--accent);
  opacity: 0; transform: translateX(-3px); transition: opacity .15s, transform .15s;
}
.card-title { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.card-sum { margin: 3px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--muted)); }
.chip.price { margin-left: auto; color: var(--text); font: 500 12px var(--mono); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.chip.draft { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }

[data-label="Hiring"] { --dot: var(--hire); }
[data-label="AI Agents"] { --dot: var(--ai); }
[data-label="Security"] { --dot: var(--sec); }

/* drop column */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 132px; padding: 16px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); font-size: 13px; transition: all .15s;
}
.dropzone svg { width: 20px; height: 20px; color: var(--faint); transition: transform .2s; }
.dz-touch { display: none; }
@media (hover: none) { .dz-desktop { display: none; } .dz-touch { display: inline; } }
.col-drop.is-armed .dropzone { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.col-drop.is-over { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.col-drop.is-over .dropzone svg { transform: scale(1.25) rotate(90deg); color: var(--accent); }
.card.assigned { cursor: pointer; }
.card.assigned.flash { animation: land .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes land { from { transform: scale(.96); box-shadow: 0 0 0 4px var(--accent-soft); } to { transform: none; } }

/* done column */
.ref { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 10px 12px; }
button.ref { cursor: pointer; }
@media (hover: hover) {
  button.ref { cursor: pointer; }
  button.ref:hover { border-color: var(--line-strong); }
}
.ref-check {
  flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ok); color: var(--card);
}
.ref-check svg { width: 12px; height: 12px; stroke-width: 2; }
.ref-body { min-width: 0; flex: 1; }
.ref-role { display: block; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.ref-name { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-name small { color: var(--muted); font-weight: 400; font-size: inherit; }
.ref-open { width: 14px; height: 14px; color: var(--faint); transition: transform .15s, color .15s; }
.ref:hover .ref-open { color: var(--text); transform: translateX(2px); }
.ref-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.ref-link:hover { border-bottom-color: var(--text); }
.ref-cta { text-decoration: none; margin-top: 8px; }

/* drag ghost */
.ghost {
  position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none; margin: 0;
  box-shadow: var(--shadow-lift); border-color: var(--line-strong);
  transform-origin: 30px 20px; will-change: transform;
}

.legal { margin-top: 28px; display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--faint); }
.legal a { text-decoration: none; }
.legal a:hover { color: var(--text); }

/* ---------- sheet ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 20; background: rgba(10, 10, 14, .32);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 21; top: 8px; right: 8px; bottom: 8px;
  width: min(480px, calc(100vw - 16px));
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lift);
  transform: translateX(calc(100% + 16px)); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}
.sheet.open { transform: none; pointer-events: auto; }
.sheet-top {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line);
}
.icon-btn {
  margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--col); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px 20px 24px; overscroll-behavior: contain; }
.sheet-title { margin: 0 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.props { margin: 0 0 18px; display: grid; gap: 2px; }
.props > div { display: grid; grid-template-columns: 96px 1fr; align-items: center; min-height: 30px; }
.props dt { color: var(--muted); font-size: 13px; }
.props dd { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.avatar {
  flex: none; width: 20px; height: 20px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 1px var(--line);
}
.state { padding: 1px 8px; border-radius: 6px; font-size: 12px; background: var(--accent-soft); color: var(--accent); }
.state.paid { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.muted { color: var(--muted); }
.sheet-desc { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
.sub { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.checklist { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist li::before {
  content: ""; flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 4px;
  border: 1.5px solid var(--line-strong);
}
.brief { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.brief .sub { margin-bottom: -2px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brief label { display: grid; gap: 5px; }
.brief label span { font-size: 12.5px; color: var(--muted); }
.brief label em { font-style: normal; color: var(--faint); }
.brief input, .brief textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s;
  font-size: 16px; /* keeps iOS from zooming */
}
@media (min-width: 640px) { .brief input, .brief textarea { font-size: 14px; } }
.brief textarea { resize: vertical; min-height: 96px; }
.brief input:focus, .brief textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.brief .invalid { border-color: #e5484d; }
.form-error { margin: 0; min-height: 0; color: #e5484d; font-size: 13px; }
.form-error:empty { display: none; }
.pay {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--text); color: var(--bg); font-weight: 500;
  transition: transform .1s, opacity .15s;
}
.pay:hover { opacity: .9; }
.pay:active { transform: scale(.985); }
.pay:disabled { opacity: .55; cursor: progress; }
.pay kbd {
  font: 500 11px var(--mono); padding: 1px 5px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent); opacity: .7;
}
@media (hover: none) { .pay kbd { display: none; } }
.fine { margin: -2px 0 0; text-align: center; font-size: 12px; color: var(--faint); }
.talk-first {
  justify-self: center; border: 0; background: none; padding: 2px 4px; cursor: pointer;
  font-size: 13px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.talk-first:hover { text-decoration-color: var(--accent); }

/* booking sheet: Google Calendar renders on white, so the frame keeps a white canvas in both themes */
.sheet-call { width: min(640px, calc(100vw - 16px)); }
.call-body { position: relative; flex: 1; min-height: 0; background: #fff; border-radius: 0 0 14px 14px; overflow: hidden; }
.call-body iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.call-loading { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: #76757d; font-size: 13px; }
.paid-note {
  display: flex; gap: 10px; padding: 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok);
}
.paid-note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.paid-note p { margin: 0; color: var(--text); }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); opacity: 0;
  max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 13px; box-shadow: var(--shadow-lift);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .board { grid-template-columns: 1fr 1fr; }
  .board > .col:first-child { grid-row: span 2; }
}
@media (max-width: 640px) {
  .wrap { padding-top: 20px; }
  .intro { align-items: flex-start; gap: 14px; }
  .portrait { width: 64px; height: 64px; border-width: 2px; }
  .sheet-call { height: 92dvh; }
  .call-body { border-radius: 0; }
  .board { grid-template-columns: 1fr; gap: 10px; }
  .board > .col:first-child { grid-row: auto; }
  .col-hint { display: none; }
  .status-sub { display: none; }
  .crumb, .crumb-sep { display: none; }
  .dropzone { min-height: 84px; }
  .row { grid-template-columns: 1fr; }
  .sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh;
    border-radius: 16px 16px 0 0; border-bottom: 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet::before {
    content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: var(--line-strong);
  }
  .sheet-top { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
