/* Handshake — minimal CSS, mobile-first, single-file */

:root {
  --bg: #f6f5f0;
  --card: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e6e4dc;
  --brand: #4a3aff;
  --brand-soft: #eeebff;
  --hot: #d6336c;
  --warm: #b06a00;
  --maybe: #6c757d;
  --x: #000000;
  --bluesky: #1185fe;
  --threads: #000000;
  --linkedin: #0a66c2;
  --facebook: #1877f2;
  --skool: #ff6b35;
  --discord: #5865f2;
  --telegram: #26a5e4;
  --instagram: #e1306c;
  --tiktok: #010101;
  --reddit: #ff4500;
  --whatsapp: #25d366;
  --other: #888;
  --stage-new: #e7f5ff;
  --stage-qualified: #fff3bf;
  --stage-queued: #ffe8cc;
  --stage-touched: #d3f9d8;
  --stage-waiting: #e3fafc;
  --stage-won: #b2f2bb;
  --stage-dead: #dee2e6;
  --stage-archive: #ffe3e3;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- top bar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; color: var(--fg); font-size: 16px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.inline { display: inline; }
.link-btn {
  background: none; border: none; color: var(--brand); cursor: pointer;
  font: inherit; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

main { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* --- filters --- */
.filters { background: var(--card); border: 1px solid var(--border);
           border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-form .search {
  flex: 1 1 200px; min-width: 180px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; font: inherit;
  background: var(--bg);
}
.filter-form select, .filter-form button {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); font: inherit; cursor: pointer;
}
.filter-form button.primary {
  background: var(--brand); color: white; border-color: var(--brand);
}
.filter-form .clear { padding: 8px 10px; color: var(--muted); font-size: 13px; }

.count { color: var(--muted); margin: 4px 0 16px; font-size: 14px; }
.count strong { color: var(--fg); }

/* --- prospect list --- */
.prospect-list { list-style: none; padding: 0; margin: 0;
                 display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) {
  .prospect-list { grid-template-columns: repeat(2, 1fr); }
}

.prospect {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
}
.prospect-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.handle { font-weight: 600; font-size: 16px; color: var(--fg); }
.handle:hover { text-decoration: underline; }
.display-name { color: var(--muted); font-size: 13px; margin-top: 2px; }

.chip {
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  text-transform: lowercase; letter-spacing: 0.02em;
}
.chip.platform { background: #f1f1ee; color: var(--fg); }
.chip.platform-x, .chip.platform-threads, .chip.platform-tiktok { background: #111; color: #fff; }
.chip.platform-bluesky { background: var(--bluesky); color: #fff; }
.chip.platform-linkedin { background: var(--linkedin); color: #fff; }
.chip.platform-facebook { background: var(--facebook); color: #fff; }
.chip.platform-skool { background: var(--skool); color: #fff; }
.chip.platform-discord { background: var(--discord); color: #fff; }
.chip.platform-telegram { background: var(--telegram); color: #fff; }
.chip.platform-instagram { background: var(--instagram); color: #fff; }
.chip.platform-reddit { background: var(--reddit); color: #fff; }
.chip.platform-whatsapp { background: var(--whatsapp); color: #fff; }
.chip.temp-hot { background: #ffe0ec; color: var(--hot); }
.chip.temp-warm { background: #fff3bf; color: var(--warm); }
.chip.temp-maybe { background: #e9ecef; color: var(--maybe); }
.chip.stage { background: #e9ecef; color: #495057; }
.chip.stage-new { background: var(--stage-new); color: #1971c2; }
.chip.stage-qualified { background: var(--stage-qualified); color: #8a6d00; }
.chip.stage-queued { background: var(--stage-queued); color: #c97a00; }
.chip.stage-touched { background: var(--stage-touched); color: #2b8a3e; }
.chip.stage-waiting { background: var(--stage-waiting); color: #0b7285; }
.chip.stage-won { background: var(--stage-won); color: #2b8a3e; font-weight: 600; }
.chip.stage-dead { background: var(--stage-dead); color: #495057; }
.chip.stage-archive { background: var(--stage-archive); color: #c92a2a; }
.chip.badge { background: #f1f3f5; color: var(--muted); }

.meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px;
        font-size: 13px; color: var(--muted); }
.meta strong { color: var(--fg); font-weight: 600; }
.muted { color: var(--muted); }

.quote { margin: 10px 0 6px; padding-left: 10px; border-left: 3px solid var(--border);
         color: #343a40; font-style: italic; }
.angle, .jtd { margin: 6px 0; font-size: 14px; }
.angle em, .jtd em { color: var(--muted); font-style: normal; font-size: 12px;
                     text-transform: uppercase; letter-spacing: 0.04em; }

.links { margin-top: 10px; display: flex; gap: 14px; font-size: 13px; }

.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* --- board nav --- */
.board-header { display: flex; align-items: center; justify-content: space-between;
                margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.board-nav { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 12px; border-radius: 6px;
  color: var(--muted); font-size: 14px;
}
.nav-link:hover { background: var(--card); text-decoration: none; }
.nav-link.active {
  background: var(--card); color: var(--fg); font-weight: 600;
  border: 1px solid var(--border);
}
.nav-count { color: var(--muted); font-size: 12px; margin-left: 2px; }

/* --- kanban --- */
.kanban {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}
.kanban-archive { justify-content: flex-start; }

.column {
  flex: 0 0 260px;
  background: #f1efe9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 200px);
}
.column-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.column-count {
  font-size: 12px; color: var(--muted);
  background: rgba(255,255,255,0.7); border-radius: 10px;
  padding: 1px 8px;
}
.column-body { display: flex; flex-direction: column; gap: 8px;
               overflow-y: auto; flex: 1; }

.board-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}
.board-card.archived {
  background: #fff5f5;
  border-color: #ffc9c9;
}
.card-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
            margin-bottom: 4px; }
.card-row:last-child { margin-bottom: 0; }
.handle { font-weight: 600; color: var(--fg); font-size: 14px; }
.handle:hover { text-decoration: underline; }
.display-name { color: var(--muted); font-size: 12px; }
.meta-inline { font-size: 12px; color: var(--muted); }
.meta-inline strong { color: var(--fg); font-weight: 600; }
.quote { margin: 6px 0; padding-left: 8px; border-left: 2px solid var(--border);
         font-style: italic; color: #343a40; font-size: 13px; }

.move-form { margin-top: 8px; }
.move-form select {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-family: inherit;
  cursor: pointer;
}
.move-form select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.empty-column {
  padding: 16px 8px; text-align: center;
  color: var(--muted); font-size: 12px;
  font-style: italic;
}

/* --- money / stale chips --- */
.chip.money { background: #ecfdf5; color: #047857; font-weight: 600; }
.stale-badge {
  background: var(--stage-archive);
  color: #c92a2a;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.prospect.is-stale, .board-card.is-stale {
  border-color: #ffc9c9;
  background: #fff7f7;
}
.prospect.is-stale .handle, .board-card.is-stale .handle {
  color: #c92a2a;
}

/* --- pipeline bar (board) --- */
.pipeline-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.pipeline-total { font-size: 14px; color: var(--muted); }
.pipeline-total strong { color: var(--fg); font-size: 18px; margin: 0 4px; }
.pipeline-stages {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pipeline-cell {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}
.pipeline-stage.stage-new { background: var(--stage-new); }
.pipeline-stage.stage-qualified { background: var(--stage-qualified); }
.pipeline-stage.stage-queued { background: var(--stage-queued); }
.pipeline-stage.stage-touched { background: var(--stage-touched); }
.pipeline-stage.stage-waiting { background: var(--stage-waiting); }
.pipeline-stage.stage-won { background: var(--stage-won); }
.pipeline-stage.stage-dead { background: var(--stage-dead); }
.pipeline-count { color: var(--muted); }
.pipeline-money { color: #047857; font-weight: 600; }

.column-money {
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
}

.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 12px; color: var(--muted);
}
.last-touch { font-size: 11px; }
.card-detail-link { font-size: 11px; color: var(--brand); }

/* --- detail page --- */
.back { font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 8px; }
.back:hover { color: var(--brand); text-decoration: none; }

.prospect-head { margin-bottom: 16px; }
.prospect-head-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.handle-big { font-size: 22px; font-weight: 700; color: var(--fg); }
.handle-big:hover { text-decoration: underline; }
.head-links { margin-top: 4px; font-size: 13px; }
.head-links a { margin-right: 12px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.meta-grid strong { color: var(--fg); margin-right: 4px; }

.card-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card-section h3 {
  margin: 0 0 10px; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted);
}
.card-section p { margin: 6px 0; font-size: 14px; }
.lbl {
  display: inline-block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); width: 140px; vertical-align: top;
}
blockquote.quote {
  margin: 0; padding-left: 12px;
  border-left: 3px solid var(--brand);
  font-style: italic; color: #343a40;
}

.deal-form, .stage-form, .touch-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.deal-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.deal-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.deal-form .full { grid-column: 1 / -1; }
.deal-form input, .deal-form textarea {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px;
  font: inherit; background: var(--bg);
}
.deal-form button.primary { grid-column: 1 / -1; justify-self: start; }

.touch-form select, .touch-form input {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px;
  font: inherit; background: var(--bg);
}
.touch-form select { width: auto; }
.touch-form input[type="text"] { flex: 1; min-width: 180px; }
.stage-form select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }

.timeline { list-style: none; padding: 0; margin: 12px 0 0; }
.touch {
  padding: 8px 10px;
  border-left: 3px solid var(--border);
  margin-bottom: 8px;
  background: var(--bg);
  border-radius: 0 4px 4px 0;
}
.touch-comment { border-left-color: var(--linkedin); }
.touch-dm { border-left-color: var(--brand); }
.touch-email { border-left-color: var(--warm); }
.touch-ignore { border-left-color: var(--muted); }
.touch-note { border-left-color: var(--hot); }
.touch-head { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--muted); }
.touch-kind {
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 11px; color: var(--fg);
}
.touch-body { margin: 4px 0 0; font-size: 14px; color: var(--fg); }
.touch-outcome { margin: 4px 0 0; font-size: 12px; color: var(--warm); font-weight: 600; }

.history { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.history li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.history li:last-child { border-bottom: none; }
.history .from-to { color: var(--fg); }
.history .reason { color: var(--muted); font-style: italic; }

.detail-link { font-size: 12px; }

/* --- topbar nav --- */
.who .nav-link {
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}
.who .nav-link:hover { background: var(--bg); text-decoration: none; }
.who .nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.who-sep { color: var(--border); }

/* --- today page --- */
.today-header { margin-bottom: 16px; }
.today-header h1 { margin: 0 0 4px; font-size: 22px; }
.today-summary { font-size: 14px; color: var(--fg); margin: 4px 0; }
.today-summary strong { color: var(--hot); font-size: 18px; }
.today-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.today-stats .stat { font-size: 13px; color: var(--muted); }
.today-stats .stat strong { color: var(--fg); }
.owner-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 6px; }
.owner-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}
.owner-chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.owner-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.owner-chip.active:hover { color: #fff; }
.owner-chip.yeji-chip:not(.active) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.today-bookmark { font-size: 12px; margin: 4px 0 0; }
.today-bookmark code { font-size: 12px; }

.today-list { list-style: none; padding: 0; margin: 0;
              display: grid; gap: 10px; }
.today-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.today-card.hot {
  border-left-color: var(--hot);
  background: #fffafa;
}
.today-card.warm { border-left-color: var(--warm); }
.today-card.maybe { border-left-color: var(--maybe); }
.today-card-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.today-card .handle { font-size: 16px; }
.today-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.today-meta strong { color: var(--fg); }
.today-card .quote { margin: 6px 0; padding-left: 8px; border-left: 2px solid var(--border);
                     font-style: italic; font-size: 13px; color: #343a40; }
.today-card .angle { margin: 4px 0; font-size: 13px; }
.today-card .angle em { color: var(--muted); font-style: normal; font-size: 11px;
                        text-transform: uppercase; letter-spacing: 0.04em; }
.today-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.today-actions select {
  padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 4px; font: inherit; background: var(--bg); font-size: 13px;
}
.detail-btn {
  padding: 4px 10px; background: var(--brand-soft);
  color: var(--brand); border-radius: 4px;
  font-size: 13px; font-weight: 600;
}
.detail-btn:hover { background: var(--brand); color: white; text-decoration: none; }

/* --- topbar CTA link (Import) --- */
.who .nav-link-cta {
  background: var(--brand);
  color: white;
  font-weight: 600;
}
.who .nav-link-cta:hover { background: #3525d6; color: white; }

/* --- import page --- */
.import-header h1 { margin: 0 0 4px; font-size: 22px; }
.import-form-card { padding: 16px; }
.paste-form { display: flex; flex-direction: column; gap: 10px; }
.paste-form textarea {
  width: 100%;
  min-height: 360px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
  resize: vertical;
}
.paste-form textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.paste-meta { display: flex; align-items: center; justify-content: space-between; }
.paste-meta .hint { font-size: 12px; color: var(--muted); }
.paste-meta .hint strong { color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.paste-meta button.primary {
  padding: 8px 18px; border: none; border-radius: 6px;
  background: var(--brand); color: white; font: inherit; font-weight: 600;
  cursor: pointer;
}

.import-result h3 code { font-size: 14px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.import-result.import-error { border-left: 4px solid var(--stage-archive); }
.import-result.import-error h3 { color: #c92a2a; margin-top: 0; }

.result-counts { display: flex; gap: 12px; margin: 12px 0 16px; flex-wrap: wrap; }
.result-count {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--bg);
  text-align: center;
  min-width: 80px;
}
.result-count strong { display: block; font-size: 24px; font-weight: 700; line-height: 1; }
.result-count span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.count-added strong { color: #2b8a3e; }
.count-skipped strong { color: var(--warm); }
.count-invalid strong { color: #c92a2a; }

.result-list { list-style: none; padding: 0; margin: 8px 0; }
.result-list li { padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.result-list li:last-child { border-bottom: none; }
.import-result details { margin-top: 12px; }
.import-result summary { cursor: pointer; padding: 6px 0; font-weight: 600; font-size: 14px; color: var(--fg); }

.result-actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; }
.result-actions a.primary {
  padding: 8px 16px; background: var(--brand); color: white;
  border-radius: 6px; font-weight: 600;
}
.result-actions a.primary:hover { background: #3525d6; color: white; text-decoration: none; }

/* --- auth --- */
.auth-wrap { display: flex; justify-content: center; padding-top: 60px; }
.auth-card { background: var(--card); border: 1px solid var(--border);
             border-radius: 8px; padding: 24px; width: 100%; max-width: 320px; }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-card input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.auth-card button.primary {
  background: var(--brand); color: white; border: none; border-radius: 6px;
  padding: 10px; font: inherit; cursor: pointer; font-weight: 600;
}
.error { color: #c92a2a; background: var(--stage-archive); padding: 8px 10px;
         border-radius: 6px; font-size: 13px; margin: 8px 0; }
