:root {
  --ink: #13213a;
  --ink-soft: #526077;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --line: #dce3ed;
  --blue: #3158d8;
  --blue-dark: #2344b0;
  --orange: #f26a3d;
  --green: #18875e;
  --red: #b83a48;
  --yellow: #e9ad35;
  --shadow: 0 18px 50px rgba(28, 44, 77, 0.12);
  --radius: 18px;
  font-family: Aptos, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(49, 88, 216, 0.28);
  outline-offset: 2px;
}

.wordmark {
  color: var(--ink);
  font-family: Bahnschrift, "Arial Narrow", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  text-transform: uppercase;
}
.wordmark span { color: var(--orange); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .71rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { color: var(--ink-soft); line-height: 1.55; }

.auth-page { background: #eaf0f8; }
.auth-shell { display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(360px, .85fr); min-height: 100vh; }
.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(42px, 8vw, 120px);
  position: relative;
  background: #dbe5f2;
}
.auth-story::before {
  content: "";
  position: absolute;
  width: 62vw;
  height: 62vw;
  max-width: 760px;
  max-height: 760px;
  right: -25vw;
  bottom: -24vw;
  border: 1px solid rgba(49, 88, 216, .3);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(49, 88, 216, .05), 0 0 0 140px rgba(49, 88, 216, .04);
}
.auth-story .wordmark { position: absolute; top: 42px; left: clamp(42px, 8vw, 120px); }
.auth-kicker { margin: 0 0 20px; color: var(--orange); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.auth-story h1 { max-width: 740px; margin: 0; font-family: Bahnschrift, "Arial Narrow", sans-serif; font-size: clamp(3rem, 6.8vw, 7rem); font-weight: 650; letter-spacing: -.06em; line-height: .88; }
.auth-copy { max-width: 580px; margin: 32px 0 0; color: #465774; font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.55; }
.signal-line { display: flex; align-items: end; gap: 7px; height: 42px; margin-top: 42px; }
.signal-line span { display: block; width: 6px; border-radius: 6px; background: var(--blue); animation: signal 1.6s ease-in-out infinite; }
.signal-line span:nth-child(1) { height: 14px; }
.signal-line span:nth-child(2) { height: 38px; animation-delay: -.4s; }
.signal-line span:nth-child(3) { height: 24px; animation-delay: -.8s; }
.signal-line span:nth-child(4) { height: 8px; animation-delay: -1.2s; background: var(--orange); }
@keyframes signal { 50% { opacity: .35; transform: scaleY(.75); } }
.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: clamp(36px, 7vw, 100px); background: var(--surface); }
.auth-panel h2 { margin: 0; font-size: clamp(1.9rem, 3vw, 3rem); letter-spacing: -.04em; }
.auth-panel .muted { max-width: 480px; margin: 10px 0 0; }

.stack-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: #3d4a61; font-size: .79rem; font-weight: 750; letter-spacing: .02em; }
label small { color: #7a8598; font-weight: 500; line-height: 1.35; }
input, textarea, select {
  width: 100%;
  border: 1px solid #ccd5e1;
  border-radius: 11px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fbfcfe;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; line-height: 1.45; }
input:hover, textarea:hover, select:hover { border-color: #a9b6ca; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(49, 88, 216, .08); outline: none; }
.form-error { border-left: 4px solid var(--red); padding: 12px 14px; color: #832b38; background: #fff3f4; border-radius: 4px 10px 10px 4px; }
.primary-button, .secondary-button, .text-button, .icon-button {
  border: 0;
  border-radius: 11px;
  font-weight: 750;
}
.primary-button { min-height: 44px; padding: 11px 18px; color: #fff; background: var(--blue); box-shadow: 0 7px 18px rgba(49, 88, 216, .18); }
.primary-button:hover { background: var(--blue-dark); }
.primary-button.compact { min-height: 40px; }
.secondary-button { min-height: 40px; padding: 9px 15px; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.secondary-button:hover { border-color: #abb7c9; background: #f8fafd; }
.text-button { padding: 7px 0; color: var(--ink-soft); background: transparent; }
.icon-button { width: 40px; height: 40px; color: #5c687d; background: #edf1f6; font-size: 1.5rem; }

.workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; min-height: 100vh; padding: 28px 20px 22px; border-right: 1px solid var(--line); background: #e9eff7; }
.sidebar-wordmark { padding: 0 10px 30px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; color: #536078; background: transparent; font-weight: 700; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.58); }
.nav-item.active { color: #fff; background: var(--ink); }
.nav-glyph { width: 22px; font-size: 1rem; text-align: center; }
.sidebar-foot { display: grid; gap: 16px; margin-top: auto; padding: 20px 10px 0; border-top: 1px solid #cfd8e5; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.identity > span:last-child { display: grid; min-width: 0; }
.identity strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.identity small { color: #778399; }
.avatar { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; color: #fff; border-radius: 50%; background: var(--blue); font-weight: 800; }
.main-area { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 32px 20px; }
.topbar h1 { margin: 0; font-family: Bahnschrift, "Arial Narrow", sans-serif; font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: -.045em; line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.sync-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; color: #6c788c; font-size: .76rem; font-weight: 700; }
.sync-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(24, 135, 94, .1); }
.sync-state.loading i { background: var(--yellow); animation: pulse 1s infinite; }
.sync-state.error i { background: var(--red); }
@keyframes pulse { 50% { transform: scale(.65); opacity: .5; } }
.stats-strip { display: grid; grid-template-columns: repeat(6, minmax(92px, 1fr)); margin: 0 32px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 22px rgba(28,44,77,.04); }
.stats-strip article { display: grid; gap: 7px; min-height: 82px; padding: 16px 18px; border-right: 1px solid var(--line); }
.stats-strip article:last-child { border-right: 0; }
.stats-strip span { color: #707c90; font-size: .72rem; font-weight: 700; }
.stats-strip strong { font-family: Bahnschrift, "Arial Narrow", sans-serif; font-size: 1.8rem; line-height: 1; }
.stats-strip .warn strong { color: var(--orange); }
.stats-strip .positive strong { color: var(--green); }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 0 32px 18px; }
.search-box { display: flex; flex: 1 1 360px; align-items: center; gap: 8px; max-width: 520px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.search-box span { color: #738097; font-size: 1.2rem; }
.search-box input { border: 0; box-shadow: none; background: transparent; }
.search-box input:focus { box-shadow: none; }
.toolbar select { width: auto; min-width: 170px; background: var(--surface); }
.result-count { margin-left: auto; color: #7b8798; font-size: .76rem; font-weight: 700; }
.board-shell { min-height: 520px; padding: 0 0 28px 32px; overflow: hidden; }
.board { display: grid; grid-auto-columns: 286px; grid-auto-flow: column; gap: 12px; min-height: 500px; padding: 0 32px 12px 0; overflow-x: auto; scroll-snap-type: x proximity; }
.board-column { min-height: 440px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #edf1f6; scroll-snap-align: start; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 5px 12px; }
.column-head h2 { margin: 0; font-size: .78rem; letter-spacing: .025em; }
.column-head span { display: grid; width: 25px; height: 25px; place-items: center; color: #6e7a8d; border-radius: 8px; background: rgba(255,255,255,.7); font-size: .72rem; font-weight: 800; }
.column-cards { display: grid; align-content: start; gap: 9px; min-height: 380px; }
.column-cards.drag-over { border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(49,88,216,.35); }
.lead-card { position: relative; overflow: hidden; padding: 14px 14px 13px 17px; border: 1px solid #d7dfea; border-radius: 12px; background: var(--surface); box-shadow: 0 5px 14px rgba(35,51,82,.045); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.lead-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--blue); }
.lead-card.priority-A::before { background: var(--orange); }
.lead-card.priority-C::before { background: #9aa6b7; }
.lead-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(35,51,82,.09); }
.lead-card.dragging { opacity: .5; transform: rotate(1.5deg); }
.card-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.card-top h3 { margin: 0; font-size: .92rem; line-height: 1.25; }
.priority-pill { flex: 0 0 auto; padding: 3px 6px; color: #69758a; border: 1px solid #dce2eb; border-radius: 6px; font: 700 .63rem Consolas, monospace; }
.card-meta { margin: 6px 0 0; color: #768397; font-size: .72rem; }
.issue-note { margin: 12px 0 10px; padding: 8px 9px; color: #6f3540; border-left: 2px solid #d86a78; background: #fff4f5; font-size: .73rem; line-height: 1.4; }
.issue-note.empty { color: #778397; border-color: #b9c4d2; background: #f6f8fb; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #68758a; font-size: .68rem; }
.due { color: var(--blue); font-weight: 750; }
.due.overdue { color: var(--red); }
.mini-avatar { display: grid; width: 25px; height: 25px; place-items: center; color: #fff; border-radius: 50%; background: #7f8ba0; font-size: .65rem; font-weight: 800; }
.empty-state { max-width: 520px; margin: 70px auto; padding: 48px; text-align: center; }
.empty-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 18px; place-items: center; color: var(--blue); border: 1px solid #b7c6e8; border-radius: 50%; font-size: 1.6rem; }
.empty-state h2 { margin: 0; }
.empty-state p { color: var(--ink-soft); }

dialog { padding: 0; border: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(16, 29, 53, .35); backdrop-filter: blur(3px); }
.drawer-dialog { width: min(720px, 100%); max-width: none; height: 100%; max-height: none; margin: 0 0 0 auto; border-radius: 22px 0 0 22px; }
.modal-dialog { width: min(540px, calc(100% - 28px)); border-radius: 20px; }
.drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; }
.research-badge { display: inline-flex; margin-top: 8px; padding: 5px 8px; color: #216a53; border: 1px solid #b9dfd1; border-radius: 999px; background: #eef9f5; font-size: .68rem; font-weight: 750; }
.drawer-body, .modal-body { padding: 22px 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.brief-separator { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 14px 0 2px; border-top: 1px solid var(--line); }
.brief-separator span { font-weight: 850; }
.brief-separator small { color: #7b8798; font-size: .7rem; }
.script-field textarea { min-height: 180px; color: #25334a; background: #fbfcfe; white-space: pre-wrap; }
.script-field textarea[readonly] { cursor: text; }
.check-label { display: flex; align-items: center; align-self: end; min-height: 44px; }
.check-label input { width: 18px; height: 18px; }
.drawer-actions { display: flex; justify-content: flex-end; padding-top: 20px; }
.activity-section { padding: 0 26px 32px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; padding-top: 18px; border-top: 1px solid var(--line); }
.section-title h3 { margin: 0; }
.section-title span { color: #7a8698; font-size: .75rem; }
.comment-form { display: flex; gap: 8px; margin: 14px 0 18px; }
.activity-list { display: grid; gap: 12px; }
.activity-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.activity-dot { display: grid; width: 30px; height: 30px; place-items: center; color: var(--blue); border-radius: 50%; background: #e9efff; font-size: .72rem; font-weight: 800; }
.activity-content { padding: 3px 0 12px; border-bottom: 1px solid #edf0f4; }
.activity-content p { margin: 3px 0 0; color: #48566d; font-size: .82rem; line-height: 1.45; white-space: pre-wrap; }
.activity-meta { display: flex; gap: 8px; color: #7b8798; font-size: .68rem; }
.activity-meta strong { color: #4f5c70; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.invite-result { padding: 0 26px 26px; }
.invite-result p { color: var(--ink-soft); font-size: .82rem; }
.copy-row { display: flex; gap: 8px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 420px; padding: 13px 16px; color: #fff; border-radius: 11px; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 42vh; padding: 90px 32px 42px; }
  .auth-story .wordmark { top: 28px; left: 32px; }
  .auth-story h1 { font-size: clamp(2.8rem, 10vw, 5rem); }
  .auth-panel { padding: 42px 32px 60px; }
  .workspace { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 25px 12px; }
  .sidebar-wordmark { overflow: hidden; width: 46px; padding: 0 2px 28px; font-size: 0; }
  .sidebar-wordmark::first-letter { font-size: 1.5rem; }
  .nav-item { justify-content: center; padding: 12px; font-size: 0; }
  .nav-glyph { font-size: 1.1rem; }
  .identity > span:last-child, .sidebar-foot form { display: none; }
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .stats-strip article:nth-child(3) { border-right: 0; }
  .stats-strip article:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .workspace { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 20; flex-direction: row; width: 100%; min-height: 0; height: 64px; padding: 8px 12px; border-top: 1px solid var(--line); border-right: 0; background: rgba(238,243,249,.96); backdrop-filter: blur(14px); }
  .sidebar-wordmark, .sidebar-foot { display: none; }
  .main-nav { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .nav-item { flex-direction: column; gap: 2px; padding: 5px; font-size: .65rem; }
  .nav-glyph { width: auto; font-size: 1rem; }
  .topbar { align-items: flex-start; padding: 22px 18px 16px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .sync-state, .secondary-button#invite-button { display: none; }
  .stats-strip { margin: 0 18px 16px; overflow-x: auto; grid-template-columns: repeat(6, minmax(94px, 1fr)); }
  .stats-strip article { min-height: 74px; border-right: 1px solid var(--line) !important; border-bottom: 0 !important; }
  .toolbar { flex-wrap: wrap; padding: 0 18px 14px; }
  .search-box { max-width: none; }
  .toolbar select { flex: 1; }
  .result-count { display: none; }
  .board-shell { padding-left: 18px; }
  .board { grid-auto-columns: min(82vw, 310px); padding-right: 18px; }
  .drawer-dialog { width: 100%; border-radius: 0; }
  .drawer-head, .drawer-body, .activity-section, .modal-body { padding-left: 18px; padding-right: 18px; }
  .form-grid, .form-row { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .comment-form { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Direct business listings stay visible for owners and managers. */
.source-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.source-links a { text-decoration: none; }
.source-links[hidden] { display: none; }
.call-guide { padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f5f9f8; }
.call-guide h3 { margin: 0; }
.call-copy { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 15px; line-height: 1.65; margin: 12px 0 0; }
.dossier-details { border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 16px; }
.dossier-details > summary, .objection-answer > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.dossier-details > .form-grid { margin-top: 14px; }
.objection-answer { border-top: 1px solid var(--line); padding: 10px 0; }
.objection-answer:first-child { margin-top: 14px; }
.objection-answer .call-copy { font-size: 14px; padding-bottom: 8px; }
