:root {
  color-scheme: light;
  --background: #f7f8fa; --sheet: #ffffff; --card: #ffffff; --card-border: #e5e9f0; --card-idle: #f3f5f8;
  --card-shadow: 0 1px 6px rgba(17, 24, 39, 0.04);
  --sheet-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 8px 28px rgba(17, 24, 39, 0.05);
  --ink: #111827; --gray: #5a6578; --hairline: #e5e9f0; --dash: #9aa6b8; --link: #0e7490;
  --good: #10794a; --waiting: #8a4b00; --broken: #b3261e; --broken-border: #efb0aa;
  --good-dot: #1fa971; --waiting-dot: #d98a1f; --broken-dot: #d6453b;
  --square: #f1f3f6; --person: #dff1f5; --on-person: #0e7490;
  --brand: #0e7490;
  --on-brand: #ffffff;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --heading-font: 'Geist', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font: 400 16px/1.5 var(--font); }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
h1, h2, p { margin: 0; }
h1 { font: 800 34px/1.15 var(--heading-font); letter-spacing: -0.03em; }
h1.long { font-size: 30px; }
h2 { font: 700 18px/1.3 var(--heading-font); letter-spacing: -0.01em; }
.muted { color: var(--gray); }

.menu { max-width: 1120px; height: 64px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.menu .logo { justify-self: start; display: inline-flex; align-items: center; height: 40px; color: var(--ink); text-decoration: none;
  font: 800 19px var(--heading-font); letter-spacing: -0.02em; }
.menu .logo .accent { color: var(--brand); }
.menu nav { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--card-border); border-radius: 999px;
  background: var(--square); }
.menu nav a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 18px;
  border-radius: 999px; color: var(--gray); font: 500 14px var(--heading-font); text-decoration: none; }
.menu nav a:hover { color: var(--ink); }
.menu nav a[aria-current="page"] { background: var(--sheet); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08), 0 0 0 1px rgba(17, 24, 39, 0.04); }
.menu nav svg { width: 15px; height: 15px; flex: none; }
.menu .right { justify-self: end; display: flex; align-items: center; gap: 16px; font-size: 14px; }
.menu .right button { border: 0; padding: 0; background: none; color: var(--gray); font: inherit; cursor: pointer; }
.menu .right button:hover { color: var(--ink); }
.menu .search input { width: 240px; height: 36px; padding: 0 16px; border: 1px solid var(--card-border); border-radius: 999px;
  background: var(--sheet); color: var(--ink); font: 400 14px var(--font); }
.menu .search input::placeholder { color: var(--gray); }
.menu .search input:focus { border-color: var(--brand); outline: none; }

.sheet { max-width: 1120px; margin: 0 auto; min-height: calc(100vh - 64px); background: var(--sheet);
  border: 1px solid var(--card-border); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: var(--sheet-shadow); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 0 48px;
  border-bottom: 1px solid var(--hairline); font-size: 15px; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; color: var(--gray); }
.breadcrumbs > :first-child { font-weight: 700; color: var(--ink); }
.breadcrumbs > :last-child { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.breadcrumbs a { color: var(--gray); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs > * + *::before { content: '‹'; margin-right: 10px; color: var(--gray); font-weight: 400; }
.sheet-body { padding: 36px 48px 56px; display: flex; flex-direction: column; gap: 28px; }

.heading { display: flex; flex-direction: column; gap: 10px; }
.heading .title-with-avatar { display: flex; align-items: center; gap: 14px; }
.status { font-size: 16px; }
.status b { font: 700 1em var(--heading-font); color: var(--good); margin-right: 8px; }
.status.waiting b { color: var(--waiting); }
.status.broken b { color: var(--broken); }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.avatar { flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--square); color: var(--ink); font: 700 15px var(--heading-font); }
.avatar.person { border-radius: 50%; background: var(--person); color: var(--on-person); }
.avatar.small { width: 30px; height: 30px; font-size: 12px; }
.avatar.large { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }

.card { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: 12px; background: var(--card);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow); color: var(--ink); text-decoration: none; }
a.card::after { content: '›'; flex: none; color: var(--gray); font-size: 20px; line-height: 1; }
a.card:hover { border-color: var(--dash); }
.card.broken { border-color: var(--broken-border); }
.card.broken .sentence { color: var(--broken); }
.card .text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card .name { font-size: 16px; font-weight: 700; }
.card .sentence { font-size: 14px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good-dot); margin: 0 7px 1px 0; }
.dot.waiting { background: var(--waiting-dot); }
.dot.broken { background: var(--broken-dot); }
.card .count { flex: none; display: inline-flex; align-items: baseline; gap: 5px; font-size: 14px; color: var(--gray); }
.card .count b { font: 700 17px var(--heading-font); color: var(--ink); }
.card .count.zero b { color: var(--waiting); }
.card .time { flex: none; font-size: 14px; color: var(--gray); }

.new-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: 12px;
  border: 1.5px dashed var(--dash); color: var(--gray); font-size: 16px; text-decoration: none; }
.new-row .plus { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1.5px dashed var(--dash);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
.new-row strong { font: 700 1em var(--heading-font); color: var(--ink); margin-right: 8px; }
.new-row:hover, .new-row:focus-visible { color: var(--ink); border-color: var(--ink); }

.progress { display: block; height: 5px; margin-top: 8px; border-radius: 3px; background: var(--hairline); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 3px; background: var(--brand); transition: width 0.4s; }

.rows { max-width: 640px; display: flex; flex-direction: column; gap: 18px; font-size: 17px; }
.row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; align-items: baseline; }
.row > :first-child { text-align: right; font: 600 15px var(--heading-font); color: var(--gray); }
.row input, .row select, .row textarea { width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); font: inherit; outline: none; }
.row input::placeholder, .row textarea::placeholder { color: var(--gray); opacity: 1; }

.login { max-width: 400px; margin: 14vh auto 0; padding: 0 16px 40px; }
.login-logo { margin-bottom: 20px; text-align: center; font: 800 22px var(--heading-font); letter-spacing: -0.02em; }
.login-logo .accent { color: var(--brand); }
.login-card { display: flex; flex-direction: column; gap: 22px; padding: 32px; border: 1px solid var(--card-border); border-radius: 16px;
  background: var(--sheet); box-shadow: var(--sheet-shadow); }
.login-card h1 { font-size: 26px; }
.fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font: 600 14px var(--heading-font); }
.field input { height: 44px; padding: 0 14px; border: 1px solid var(--card-border); border-radius: 10px; background: var(--sheet);
  color: var(--ink); font: 400 16px var(--font); }
.field input:focus { border-color: var(--brand); outline: none; }
.fields .button { justify-content: center; margin-top: 6px; }

.actions { display: flex; align-items: center; gap: 24px; }
.button { display: inline-flex; align-items: center; min-height: 42px; padding: 0 22px; border-radius: 21px; border: 0;
  background: var(--brand); color: var(--on-brand); font: 700 15px var(--heading-font); text-decoration: none; white-space: nowrap; cursor: pointer; }

.menu.wide, .sheet.wide { max-width: 1480px; }
.sheet.wide .sheet-header { padding: 0 32px; }
.sheet.wide .sheet-body { padding: 32px 32px 48px; }

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { --column-fill: color-mix(in srgb, var(--column-color) 8%, var(--sheet));
  flex: 1 1 0; display: flex; flex-direction: column; min-width: 210px; }
.column-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 160px; padding: 8px; border-radius: 12px;
  background: var(--column-fill); border-top: 3px solid var(--column-color); }
.column-header { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px 6px; border: 0; border-radius: 8px;
  background: none; color: var(--ink); text-align: left; cursor: pointer; }
.column-header:hover { background: color-mix(in srgb, var(--column-color) 14%, transparent); }
.column-header h2 { flex: 1; font-size: 15px; }
.column-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--column-color); }
.column-count { font: 600 14px var(--heading-font); color: var(--gray); }
.column-cards.drop-target { background: color-mix(in srgb, var(--column-color) 22%, var(--sheet)); outline: 2px solid var(--column-color); outline-offset: 2px; }
.column.collapsed { flex: 0 0 46px; min-width: 46px; }
.column.collapsed .column-cards { align-items: center; padding: 10px 0; }
.column.collapsed .column-header { flex-direction: column; gap: 12px; padding: 4px 0 8px; }
.column.collapsed .column-header h2 { flex: none; writing-mode: vertical-rl; white-space: nowrap; }
.column.collapsed .board-card { display: none; }
.stage-to-review { --column-color: #9aa6b8; }
.stage-interesting { --column-color: var(--brand); }
.stage-approached { --column-color: #2f6df6; }
.stage-follow-up { --column-color: #8b5cf6; }
.stage-in-contact { --column-color: #1fa971; }
.stage-no-response { --column-color: #d98a1f; }
.stage-not-interested { --column-color: #d6453b; }

.board-card { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--card-shadow); cursor: pointer; }
.board-card:hover { border-color: var(--dash); }
.board-card:target { outline: 2px solid var(--brand); outline-offset: 2px; }
.board-card .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; line-height: 1.3; }
.board-card .location { font-size: 13px; color: var(--gray); }
.budget { flex: none; font: 700 12px var(--heading-font); letter-spacing: 0.04em; color: var(--card-border); }
.budget b { color: var(--good); }
.board-card .card-footer { display: flex; align-items: baseline; gap: 10px; }
.board-card .card-footer:not(:empty) { margin-top: 4px; }
.board-card .opportunities { font: 600 12px var(--heading-font); color: var(--waiting); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 10; display: block; width: min(520px, 100vw); overflow-y: auto;
  background: var(--sheet); border-left: 1px solid var(--card-border); box-shadow: -12px 0 40px rgba(17, 24, 39, 0.08);
  transform: translateX(100%); visibility: hidden; transition: transform 0.25s ease, visibility 0.25s; }
.drawer[src] { transform: none; visibility: visible; }
@media (min-width: 721px) {
  body { transition: padding-right 0.25s ease; }
  body:has(.drawer[src]) { padding-right: 520px; }
}
.drawer-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 52px; padding: 0 28px; background: var(--sheet); border-bottom: 1px solid var(--hairline); font-size: 15px; }
.drawer-close { border: 0; padding: 0; background: none; color: var(--ink); font: 600 15px var(--font); cursor: pointer; }
.drawer-body { padding: 28px 28px 48px; display: flex; flex-direction: column; gap: 28px; }
.drawer-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.drawer .rows { gap: 12px; font-size: 15px; }
.drawer .row { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
.drawer .row > :first-child { font-size: 14px; }
.drawer .row p + p { margin-top: 2px; }
.broken { color: var(--broken); }
.fill-in { field-sizing: content; appearance: none; border: 0; padding: 0 2px; background: none; color: var(--link); font: 700 1em var(--heading-font); cursor: pointer;
  text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.contact-form { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px;
  border: 1.5px dashed var(--dash); }
.contact-form textarea { width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); font: 400 15px/1.5 var(--font);
  resize: vertical; outline: none; }
.contact-form textarea::placeholder { color: var(--gray); }
.contact-form:focus-within { border-color: var(--ink); }
.contact-form .button { min-height: 36px; padding: 0 18px; font-size: 14px; }
.segmented { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--card-border); border-radius: 999px; background: var(--square); }
.segmented label { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px;
  color: var(--gray); font: 500 14px var(--heading-font); cursor: pointer; }
.segmented label:hover { color: var(--ink); }
.segmented label:has(input:checked) { background: var(--sheet); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08), 0 0 0 1px rgba(17, 24, 39, 0.04); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented svg { width: 15px; height: 15px; flex: none; }
.segmented label:has(input:checked) svg { color: var(--kind-ink); }

.kind-note { --kind-color: #d98a1f; --kind-ink: #8a4b00; }
.kind-call { --kind-color: #1fa971; --kind-ink: #10794a; }
.kind-email { --kind-color: #2f6df6; --kind-ink: #1d4ed8; }

.timeline { display: flex; flex-direction: column; gap: 6px; }
.timeline-day { margin: 10px 0 4px; font: 600 13px var(--heading-font); color: var(--gray); }
.timeline-day:first-child { margin-top: 0; }
.timeline-entries { margin: 0; padding: 0; list-style: none; }
.timeline-entry { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.timeline-entry::before { content: ''; position: absolute; top: 30px; bottom: 4px; left: 14px; width: 1.5px; background: var(--hairline); }
.timeline-entries:last-child .timeline-entry:last-child::before { display: none; }
.timeline-marker { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--square); color: var(--gray); }
.timeline-marker svg { width: 14px; height: 14px; }
.timeline-entry.contact .timeline-marker { background: color-mix(in srgb, var(--kind-color) 16%, var(--sheet)); color: var(--kind-ink); }
.timeline-entry.contact .timeline-title { color: var(--kind-ink); }
.timeline-marker.stage-marker { background: color-mix(in srgb, var(--column-color) 16%, var(--sheet)); }
.timeline-marker.stage-marker::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--column-color); }
.timeline-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.timeline-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timeline-title { font: 600 15px var(--heading-font); }
.timeline-title .stage-name { font-weight: 700; }
.timeline-heading .time { flex: none; font-size: 13px; color: var(--gray); font-variant-numeric: tabular-nums; }
.timeline-body { font-size: 14px; color: var(--gray); }
.timeline-quote { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--kind-color) 8%, var(--sheet)); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }

.sortable-ghost { opacity: 0.4; }
.sortable-chosen { cursor: grabbing; }
.sortable-fallback { opacity: 0.9; transform: rotate(2deg); }

@media (max-width: 1520px) {
  .menu.wide { padding: 0 20px; }
  .sheet.wide { border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 1160px) {
  .menu { padding: 0 20px; }
  .sheet { border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 720px) {
  .menu, .menu.wide { height: auto; grid-template-columns: 1fr; gap: 10px; padding: 10px 16px 12px; }
  .menu .right { justify-self: stretch; }
  .menu .search { flex: 1; }
  .menu .search input { width: 100%; height: 40px; }
  .sheet-header, .sheet.wide .sheet-header { padding: 0 16px; min-height: 48px; font-size: 14px; gap: 10px; }
  .sheet-body, .sheet.wide .sheet-body { padding: 24px 16px 40px; gap: 24px; }
  h1 { font-size: 28px; }
  h1.long { font-size: 24px; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row > :first-child { text-align: left; }
  .card .sentence { white-space: normal; }
  .card .count span { display: none; }
  a.card::after { display: none; }
  .column { flex: 0 0 260px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
