/* PitchHub by VRS — brand: green #18B24B, dark ink #0E1B14 */
:root {
  --green: #18B24B;
  --green-dark: #12903C;
  --green-soft: #E7F7EC;
  --ink: #0E1B14;
  --ink-2: #3C4A42;
  --muted: #6B7A70;
  --line: #E3EAE5;
  --bg: #F6F9F7;
  --card: #FFFFFF;
  --card-2: #FFFFFF;          /* inputs, ghost buttons, inline panels */
  --danger: #D64545;
  --danger-soft: #FDECEC;
  --danger-line: #F0D0D0;
  --warn-bg: #FFF6E5;
  --warn-ink: #8A6116;
  --warn-line: #F2E3BF;
  --info-line: #CBEAD6;
  --blue-soft: #E8F0FE;
  --blue-ink: #2851A3;
  --toast-bg: #0E1B14;
  --toast-ink: #FFFFFF;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(14, 27, 20, .07), 0 8px 24px rgba(14, 27, 20, .05);
}
html[data-theme="dark"] {
  --green: #22C55B;
  --green-dark: #34d16b;
  --green-soft: rgba(34, 197, 91, .14);
  --ink: #F2F4F1;
  --ink-2: #C9CFC9;
  --muted: #8C948C;
  --line: #2A2F2A;
  --bg: #131614;
  --card: #1B201C;
  --card-2: #22271F;
  --danger: #F07070;
  --danger-soft: rgba(240, 112, 112, .13);
  --danger-line: rgba(240, 112, 112, .3);
  --warn-bg: rgba(229, 168, 0, .12);
  --warn-ink: #E5B855;
  --warn-line: rgba(229, 168, 0, .28);
  --info-line: rgba(34, 197, 91, .3);
  --blue-soft: rgba(90, 140, 240, .16);
  --blue-ink: #8FB4F5;
  --toast-bg: #F2F4F1;
  --toast-ink: #131614;
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 .8em; }
code { background: var(--green-soft); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* topbar */
#topbar {
  display: flex; align-items: center; gap: 26px; padding: 0 28px; height: 58px;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
#brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
#brand-mark { width: 26px; height: 26px; display: block; }
#brand .nm { line-height: 1; }
#brand .v { color: var(--green); }
#brand .by { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
#mainnav { display: flex; gap: 4px; flex: 1; }
#mainnav a {
  padding: 8px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 550; font-size: 14px;
}
#mainnav a:hover { background: var(--bg); text-decoration: none; }
#mainnav a.active { background: var(--green-soft); color: var(--green-dark); }
#userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
#userbox button { padding: 6px 12px; font-size: 13px; }
#theme-toggle {
  margin-left: auto; flex: none;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  width: 32px; height: 32px; border-radius: 99px; padding: 0; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
#theme-toggle:hover { background: var(--bg); color: var(--ink); border-color: var(--green); }

/* layout */
#view { max-width: 1060px; margin: 0 auto; padding: 30px 28px 70px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-side { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .grid2, .grid-side { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card .sub { color: var(--muted); font-size: 13px; margin-top: -6px; margin-bottom: 14px; }

/* forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; background: var(--card-2); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
textarea { resize: vertical; min-height: 90px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

button, .btn {
  font: inherit; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; background: var(--green); color: #fff;
  transition: background .12s;
}
button:hover, .btn:hover { background: var(--green-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
/* dark mode: bright green needs dark text for contrast */
html[data-theme="dark"] button:not(.ghost):not(.danger), html[data-theme="dark"] .btn { color: #08140b; }
html[data-theme="dark"] button:not(.ghost):not(.danger) .spin { border-color: rgba(0,0,0,.25); border-top-color: #08140b; }
button.ghost { background: var(--card-2); color: var(--ink-2); border-color: var(--line); }
button.ghost:hover { background: var(--bg); }
button.small { padding: 5px 11px; font-size: 13px; }
button.danger { background: var(--card-2); color: var(--danger); border-color: var(--danger-line); }
button.danger:hover { background: var(--danger-soft); }
.btnrow { display: flex; gap: 10px; margin-top: 18px; align-items: center; flex-wrap: wrap; }

/* auth screen */
#auth-wrap { min-height: calc(100vh - 58px); display: flex; align-items: center; justify-content: center; padding: 30px; }
#auth-card { width: 400px; max-width: 100%; }
#auth-card .tagline { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.auth-toggle { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* tables & lists */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--green-soft); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.pill.green { background: var(--green-soft); color: var(--green-dark); border-color: transparent; }
.pill.blue { background: var(--blue-soft); color: var(--blue-ink); border-color: transparent; }
.pill.orange { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.pill.red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* notices */
.notice { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.notice.info { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--info-line); }
.notice.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }

/* toast */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-ink); padding: 11px 20px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 100; max-width: 80vw;
}
#toast.show { opacity: 1; }
#toast.err { background: var(--danger); color: #fff; }

/* setup wizard steps */
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps .step { flex: 1; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 4px; border-top: 3px solid var(--line); }
.steps .step.on { color: var(--green-dark); border-top-color: var(--green); }
.steps .step.done { color: var(--ink-2); border-top-color: var(--green-dark); }

/* capability map editor */
.cap-row { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr 34px; gap: 8px; margin-bottom: 8px; align-items: start; }
.cap-row input { font-size: 13px; padding: 7px 10px; }
.cap-row .x { background: none; border: none; color: var(--muted); font-size: 17px; padding: 6px 4px; cursor: pointer; }
.cap-row .x:hover { color: var(--danger); background: none; }
.cap-head { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr 34px; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 5px; }

/* gap map */
.gap-item { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; font-size: 13.5px; align-items: flex-start; }
.gap-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.gap-item.match .dot { background: var(--green); }
.gap-item.gap .dot { background: var(--danger); }
.gap-item.partial .dot { background: #E5A800; }
.gap-item .need { font-weight: 600; }
.gap-item .note { color: var(--muted); font-size: 12.5px; }

/* pitch output */
#pitch-md { width: 100%; min-height: 380px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; line-height: 1.6; }
.md-preview { border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; background: var(--card-2); font-size: 14px; }
.md-preview h1 { font-size: 20px; } .md-preview h2 { font-size: 16px; margin-top: 1.2em; } .md-preview h3 { font-size: 14px; }
.md-preview ul { padding-left: 22px; }
.version-list { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.version-list button.on { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }

/* CRM guides */
details.guide { border: 1px solid var(--line); border-radius: 10px; padding: 0; margin-top: 10px; background: var(--card-2); }
details.guide summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 16px; }
details.guide[open] summary::after { content: '–'; }
details.guide .guide-body { padding: 0 16px 16px; font-size: 13.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
details.guide ol { padding-left: 20px; margin: 8px 0; }
details.guide li { margin-bottom: 6px; }

.provider-logo { width: 22px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.provider-logo.hs { background: #FF7A59; }
.provider-logo.attio { background: #266DF0; }
.provider-logo.sf { background: #00A1E0; }
.provider-logo.ff { background: #E5484D; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); font-size: 14px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; margin-right: 7px; }
button.ghost .spin { border-color: rgba(0,0,0,.15); border-top-color: var(--ink-2); }
html[data-theme="dark"] button.ghost .spin { border-color: rgba(255,255,255,.2); border-top-color: var(--ink-2); }
@keyframes sp { to { transform: rotate(360deg); } }

.notice.ok { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--info-line); }
.notice a { color: inherit; text-decoration: underline; }
a.weblink { color: var(--green-dark); text-decoration: none; font-size: 13px; }
a.weblink:hover { text-decoration: underline; }

/* --- Who's in the meeting / personas --- */
.contact-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: none; }
.contact-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill.persona-cfo { background: #eef2ff; color: #3730a3; }
.pill.persona-hr { background: #fdf2f8; color: #9d174d; }
.pill.persona-ops { background: #fff7ed; color: #9a3412; }
.pill.persona-it { background: #f0f9ff; color: #075985; }
.pill.persona-ceo { background: #f0fdf4; color: #14532d; }
.pill.persona-other { background: #f3f4f6; color: #4b5563; }
html[data-theme="dark"] .pill.persona-cfo { background: rgba(99,102,241,.18); color: #b0b4f7; }
html[data-theme="dark"] .pill.persona-hr { background: rgba(236,72,153,.15); color: #f0a3c8; }
html[data-theme="dark"] .pill.persona-ops { background: rgba(249,115,22,.15); color: #f5b285; }
html[data-theme="dark"] .pill.persona-it { background: rgba(14,165,233,.15); color: #85c8ec; }
html[data-theme="dark"] .pill.persona-ceo { background: rgba(34,197,94,.15); color: #8fdcab; }
html[data-theme="dark"] .pill.persona-other { background: rgba(156,163,175,.15); color: #b8bec7; }
select.ct-persona, select.small { padding: 4px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-2); color: var(--ink); }
.att-check { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; cursor: pointer; font-weight: 400; }
.att-check input { margin-top: 3px; accent-color: var(--brand, #18B24B); }
.crib-item { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.crib-item:last-child { border-bottom: none; }
.crib-item ul { margin: 6px 0 0 18px; padding: 0; }
.crib-item li { margin: 3px 0; color: var(--muted, #6b7280); }
.crib-item .proof { margin-top: 6px; font-weight: 600; color: var(--brand-dark, #0f7a34); }

/* journey stepper (prospect detail) */
.journey { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.jstep { padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg, #f6f7f8); color: var(--muted, #6b7280); border: 1px dashed var(--line, #e5e7eb); white-space: nowrap; }
.jstep.done { background: var(--green-soft, #E7F6EC); color: var(--green-dark, #0f7a34); border: 1px solid var(--info-line, #CBEAD6); }
.jstep.soft { font-weight: 500; font-size: 11.5px; opacity: .92; }
.jarrow { color: var(--muted, #9ca3af); font-size: 12px; }

/* meeting timeline */
.mt-item { border-bottom: 1px solid var(--line, #e5e7eb); }
.mt-item:last-child { border-bottom: none; }
.mt-item summary::-webkit-details-marker { display: none; }
.mt-item summary::before { content: '▸'; color: var(--muted, #9ca3af); margin-right: 2px; transition: transform .15s; display: inline-block; }
.mt-item[open] summary::before { transform: rotate(90deg); }
.mt-analysis { background: var(--bg, #fafafa); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 12px 16px; margin-top: 10px; font-size: 13.5px; }
.mt-analysis h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }

/* =========================================================
   MOBILE (≤760px) — topbar wraps into two rows:
   row 1: brand · user · theme toggle | row 2: scrollable nav
   ========================================================= */
@media (max-width: 760px) {
  #topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 54px;
    gap: 8px 10px;
    padding: 10px 14px 0;
  }
  #brand { font-size: 16px; }
  #brand-mark { width: 22px; height: 22px; }
  #brand .by { display: none; }              /* save space */
  #theme-toggle { width: 30px; height: 30px; }
  #userbox { gap: 8px; }
  #user-name { display: none; }              /* logout button is enough */
  #userbox button { padding: 5px 10px; }

  /* nav drops to its own full-width row, horizontally scrollable */
  #mainnav {
    order: 10;
    flex: 0 0 100%;
    gap: 2px;
    margin: 0 -14px;
    padding: 2px 14px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #mainnav::-webkit-scrollbar { display: none; }
  #mainnav a {
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 13.5px;
    flex: none;
  }
  /* when logged out (nav hidden), keep row-1 height comfortable */
  #topbar:has(#mainnav[hidden]) { padding-bottom: 10px; }

  /* content spacing + type scale */
  #view { padding: 18px 14px 60px; }
  h1 { font-size: 21px; }
  h2 { font-size: 17px; }
  .card { padding: 16px 14px; }

  /* tables scroll instead of crushing columns */
  #pr-list, #pi-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #pr-list table, #pi-list table { min-width: 560px; }
  th, td { padding: 8px 8px; }

  /* capability map editor: 2-col layout instead of 4-col squeeze */
  .cap-head { display: none; }
  .cap-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--line);
  }
  .cap-row input:first-child { grid-column: 1 / -1; }
  .cap-row .x { grid-column: 2; justify-self: end; padding: 2px 6px; }

  /* setup wizard steps: smaller labels, no overflow */
  .steps { gap: 4px; }
  .steps .step { font-size: 10.5px; padding: 6px 2px; letter-spacing: 0; }

  /* buttons: full-width feel in stacked rows, bigger touch targets */
  .btnrow { gap: 8px; }
  .btnrow button, .btnrow .btn { padding: 10px 16px; }

  /* pitch editor + preview */
  #pitch-md { min-height: 280px; font-size: 12.5px; }
  .md-preview { padding: 14px 16px; }

  /* toast above thumb zone */
  #toast { bottom: 18px; max-width: 92vw; font-size: 13px; }

  /* auth card breathing room */
  #auth-wrap { padding: 20px 14px; align-items: flex-start; padding-top: 8vh; }
}

/* very small phones */
@media (max-width: 380px) {
  #mainnav a { padding: 7px 10px; font-size: 13px; }
  #brand { font-size: 15px; }
}
