/* =============================================================
   Sales for Founders — GTM Binder
   Light, neutral, editorial. Calm paper feel with one quiet accent.
   Display = Fraunces (serif), Body = Inter.
   ============================================================= */

:root {
  --bg:         #f4f3ef;   /* warm paper */
  --bg-2:       #efeee9;
  --panel:      #ffffff;
  --panel-2:    #fbfaf8;
  --panel-3:    #f6f5f1;
  --line:       rgba(23, 23, 20, 0.10);
  --line-2:     rgba(23, 23, 20, 0.16);
  --text:       #23252a;
  --muted:      #6c7077;
  --faint:      #9b9ea4;
  --accent:     #a9762a;   /* muted ochre, used sparingly */
  --accent-2:   #c79545;
  --accent-soft:#f3ead9;
  --ink:        #26282d;   /* neutral primary for buttons */
  --ink-hover:  #34373d;
  --sea:        #4f7d8c;
  --green:      #4f8a5f;
  --green-bg:   #eef5ef;
  --red:        #b3675c;
  --red-bg:     #f7efed;
  --radius:     14px;
  --radius-sm:  10px;
  --maxw:       760px;
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow:     0 1px 2px rgba(23,23,20,0.04), 0 6px 20px -14px rgba(23,23,20,0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A whisper of warmth, nothing more */
.beam {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 60% at 80% -10%, rgba(169, 118, 42, 0.06), transparent 55%),
    radial-gradient(80% 50% at 10% 0%, rgba(79, 125, 140, 0.04), transparent 50%);
}

h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
}

button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  padding: 0.62rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.16s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--line-2); }
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px -8px rgba(23,23,20,0.5);
}
.btn-primary:hover { background: var(--ink-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel); }
.btn-ghost:disabled { opacity: 0.35; cursor: default; }
.btn-block { width: 100%; justify-content: center; display: flex; }
.btn-link {
  background: none; border: none; color: var(--muted);
  font-size: 0.82rem; padding: 0; text-decoration: underline; text-underline-offset: 3px;
}
.btn-link:hover { color: var(--text); }

/* =============================================================
   LOGIN
   ============================================================= */
.login {
  position: relative; z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2.4rem 2.2rem;
  box-shadow: 0 1px 2px rgba(23,23,20,0.04), 0 30px 70px -45px rgba(23,23,20,0.4);
}
.brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.6rem; }
.brand-mark {
  color: var(--accent);
  font-size: 1.05rem;
}
.brand-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.login-title { font-size: 2.5rem; line-height: 1; margin-bottom: 0.7rem; }
.login-sub { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.8rem; line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 1.05rem; }
.login-error { color: var(--red); font-size: 0.85rem; margin: 0; text-align: center; }
.login-foot {
  margin: 1.8rem 0 0;
  text-align: center;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--faint);
}

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label {
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.field-hint { font-size: 0.78rem; color: var(--faint); margin-top: -0.1rem; }
input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(169, 118, 42, 0.12);
  background: #fff;
}
textarea { min-height: 78px; line-height: 1.5; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "▾";
  position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; font-size: 0.8rem;
}
select { appearance: none; -webkit-appearance: none; padding-right: 2rem; }

/* =============================================================
   APP SHELL
   ============================================================= */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Rail ---------- */
.rail {
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}
.rail-top { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.6rem; padding: 0 0.4rem; }
.rail-brand { display: flex; flex-direction: column; line-height: 1.2; }
.rail-brand strong { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.rail-team { font-size: 0.76rem; color: var(--accent); font-weight: 600; }

.stepper { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; overflow-y: auto; }
.step {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  text-align: left;
  width: 100%;
  font-size: 0.86rem;
  transition: all 0.15s var(--ease);
}
.step:hover { background: var(--panel); color: var(--text); }
.step.active { background: var(--panel); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.step.active .step-num { background: var(--ink); color: #fff; border-color: transparent; }
.step-num {
  flex: none;
  width: 25px; height: 25px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-size: 0.74rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: all 0.15s;
}
.step.done .step-num { background: var(--green-bg); border-color: rgba(79,138,95,0.35); color: var(--green); }
.step-label { flex: 1; line-height: 1.2; }
.step-label small { display: block; font-size: 0.68rem; color: var(--faint); letter-spacing: 0.03em; text-transform: uppercase; }

.rail-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1rem; margin-top: 0.6rem; border-top: 1px solid var(--line);
}
.save-status { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.4rem; }
.save-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
}
.save-status.saving::before { background: var(--accent-2); animation: pulse 1s infinite; }
.save-status.error::before { background: var(--red); }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: rgba(244, 243, 239, 0.85);
  backdrop-filter: blur(10px);
}
.topbar-mid { flex: 1; display: flex; justify-content: center; }
.mini-progress { display: flex; gap: 5px; }
.mini-progress span {
  width: 26px; height: 4px; border-radius: 2px; background: var(--line-2);
  transition: background 0.2s;
}
.mini-progress span.on { background: var(--accent); }
.mini-progress span.cur { background: var(--accent-2); }

.page {
  flex: 1;
  padding: 2.6rem 1.6rem 5rem;
  max-width: calc(var(--maxw) + 3.2rem);
  margin: 0 auto;
  width: 100%;
  animation: rise 0.35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Page header ---------- */
.page-kicker {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 0.7rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.page-kicker .crit {
  background: var(--accent-soft); color: var(--accent);
  padding: 0.1rem 0.5rem; border-radius: 99px; font-size: 0.62rem; letter-spacing: 0.08em;
}
.page-title { font-size: 2.1rem; margin-bottom: 0.6rem; }
.page-instruction { color: var(--muted); font-size: 1.02rem; margin: 0 0 2rem; max-width: 56ch; }

/* ---------- Field blocks ---------- */
.fields { display: flex; flex-direction: column; gap: 1.35rem; }
.field-group {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.25rem; background: var(--panel);
  box-shadow: var(--shadow);
}
.field-group > .group-title {
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sea); font-weight: 700; margin: 0 0 1rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; }
.grid-2 .field.full { grid-column: 1 / -1; }

/* ---------- Radio / chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 1px solid var(--line-2); background: var(--panel);
  color: var(--muted); padding: 0.5rem 0.9rem; border-radius: 99px;
  font-size: 0.86rem; font-weight: 500; transition: all 0.14s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.sel {
  background: var(--ink);
  color: #fff; border-color: transparent; font-weight: 600;
}

/* ---------- Buying group rows ---------- */
.bg-list { display: flex; flex-direction: column; gap: 1.1rem; }
.bg-role { padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.bg-role:last-child { padding-bottom: 0; border-bottom: none; }
.bg-role-head {
  font-weight: 700; font-size: 0.95rem; color: var(--text);
  margin-bottom: 0.6rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
}
.bg-hint { font-weight: 400; font-size: 0.8rem; color: var(--faint); }

/* ---------- Yes/No lighthouse rows ---------- */
.lh-list { display: flex; flex-direction: column; gap: 0.6rem; }
.lh-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); transition: border-color 0.15s, background 0.15s;
}
.lh-row.yes { border-color: rgba(79,138,95,0.4); background: var(--green-bg); }
.lh-row.no  { border-color: rgba(179,103,92,0.4); background: var(--red-bg); }
.lh-text { flex: 1; font-size: 0.95rem; }
.lh-toggle { display: flex; gap: 0.35rem; flex: none; }
.lh-btn {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted);
  padding: 0.35rem 0.85rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  transition: all 0.14s;
}
.lh-btn.yes.on { background: var(--green); color: #fff; border-color: transparent; }
.lh-btn.no.on  { background: var(--red); color: #fff; border-color: transparent; }

.lh-score {
  display: flex; align-items: center; gap: 1.1rem;
  margin: 1.4rem 0 0; padding: 1.1rem 1.3rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-3);
}
.lh-score-num { font-family: "Fraunces", serif; font-size: 2.6rem; line-height: 1; color: var(--accent); }
.lh-score-num small { font-size: 1.2rem; color: var(--muted); }
.lh-verdict { font-size: 0.95rem; }
.lh-verdict strong { display: block; font-size: 1.02rem; margin-bottom: 0.15rem; }
.lh-verdict.keep strong { color: var(--green); }
.lh-verdict.change strong { color: var(--accent); }

.readonly-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--panel-3); border: 1px dashed var(--line-2); border-radius: 99px;
  padding: 0.4rem 0.9rem; font-size: 0.9rem; color: var(--text);
}
.readonly-pill .rk { color: var(--faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.readonly-pill .empty { color: var(--faint); font-style: italic; }

/* ---------- Live build: prompt + criteria ---------- */
.prompt-wrap { margin-bottom: 1.6rem; }
.prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.5rem; }
.prompt-label {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.8rem; }
.prompt-block {
  margin: 0;
  background: #23252a;
  color: #ece9e3;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow);
}
.good-box { margin-bottom: 1.6rem; }
.good-list { margin: 0; padding-left: 1.15rem; }
.good-list li { margin-bottom: 0.45rem; font-size: 0.95rem; line-height: 1.5; color: var(--text); }
.good-list li::marker { color: var(--accent); }

/* ---------- Output sentence card ---------- */
.output-card {
  margin-top: 2rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: 1.3rem 1.4rem;
  position: relative;
}
.output-card .out-label {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 0.55rem; display: block;
}
.output-sentence {
  font-family: "Fraunces", serif; font-size: 1.26rem; line-height: 1.42; color: var(--text);
}
.output-sentence .ph { color: var(--faint); font-style: italic; border-bottom: 1px dashed var(--faint); }
.output-sentence .fill { color: var(--accent); font-weight: 600; }

/* =============================================================
   TRANSCRIPT (Page 7)
   ============================================================= */
.transcript-pick { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.4rem; }
.t-options { display: flex; flex-direction: column; gap: 0.5rem; }
.t-option {
  text-align: left; border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius-sm); padding: 0.8rem 1rem; color: var(--text);
  transition: all 0.15s var(--ease); box-shadow: var(--shadow);
}
.t-option:hover { border-color: var(--faint); }
.t-option.sel { border-color: var(--accent); background: var(--accent-soft); }
.t-option .t-name { font-weight: 600; font-size: 0.95rem; }
.t-option .t-motion { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.t-option .t-badge {
  float: right; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 0.15rem 0.5rem; border-radius: 99px;
}

.transcript-box {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  margin-bottom: 1.6rem; overflow: hidden; box-shadow: var(--shadow);
}
.t-context { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.t-context h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }
.t-context .t-co-motion { font-size: 0.82rem; color: var(--sea); margin-bottom: 0.8rem; }
.t-context dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; margin: 0; font-size: 0.88rem; }
.t-context dt { color: var(--faint); white-space: nowrap; }
.t-context dd { margin: 0; color: var(--text); }
.t-scroll { max-height: 360px; overflow-y: auto; padding: 1.1rem 1.25rem; background: var(--panel-2); }
.t-line { margin-bottom: 0.7rem; font-size: 0.9rem; line-height: 1.5; }
.t-line .sp { font-weight: 700; color: var(--accent); }
.t-line.founder .sp { color: var(--sea); }
.t-note {
  font-size: 0.8rem; color: var(--muted); font-style: italic;
  padding: 0.6rem 1.25rem; border-top: 1px solid var(--line); background: var(--panel-3);
}

/* =============================================================
   SUMMARY (Page 8)
   ============================================================= */
.summary-actions { display: flex; gap: 0.7rem; margin-bottom: 2rem; flex-wrap: wrap; }
.summary-grid { display: flex; flex-direction: column; gap: 1rem; }
.sum-block {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.sum-block .sb-label {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin-bottom: 0.45rem; display: flex; gap: 0.5rem; align-items: center;
}
.sum-block .sb-value { font-size: 1rem; color: var(--text); white-space: pre-wrap; }
.sum-block .sb-value.empty { color: var(--faint); font-style: italic; }
.sum-block.headline {
  border-color: var(--line);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.sum-block.headline .sb-value { font-family: "Fraunces", serif; font-size: 1.32rem; line-height: 1.42; }
.changed-tag {
  font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  padding: 0.15rem 0.55rem; border-radius: 99px;
}
.changed-tag.yes { background: var(--accent-soft); color: var(--accent); }
.changed-tag.no { background: var(--green-bg); color: var(--green); }
.buyermap-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; font-size: 0.92rem; }
.buyermap-mini b { color: var(--sea); font-weight: 600; }
.buyermap-list { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.92rem; }
.buyermap-list b { color: var(--sea); font-weight: 600; display: inline-block; min-width: 5.2rem; }
.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 0.88rem;
  padding: 0.6rem 1.1rem; border-radius: 99px; z-index: 50;
  box-shadow: 0 10px 30px -10px rgba(23,23,20,0.5);
  animation: rise 0.3s var(--ease);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center;
    padding: 0.7rem 1rem; border-right: none; border-bottom: 1px solid var(--line);
    gap: 1rem;
  }
  .rail-top { margin: 0; }
  .stepper {
    flex-direction: row; overflow-x: auto; gap: 0.3rem; flex: 1;
    -webkit-overflow-scrolling: touch;
  }
  .step { flex: none; padding: 0.4rem; }
  .step-label { display: none; }
  .step.active { padding: 0.4rem 0.7rem; }
  .step.active .step-label { display: block; white-space: nowrap; }
  .rail-foot { flex-direction: column; gap: 0.3rem; border: none; padding: 0; margin: 0; }
  .rail-foot .btn-link { display: none; }
  .page { padding: 1.8rem 1.1rem 4rem; }
  .page-title { font-size: 1.7rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-title { font-size: 2.1rem; }
  .output-sentence { font-size: 1.1rem; }
  .mini-progress { display: none; }
}

/* ---------- Print (export the plan) ---------- */
@media print {
  .beam, .rail, .topbar, .summary-actions { display: none !important; }
  body { background: #fff; color: #111; }
  .app { display: block; }
  .page { max-width: none; padding: 0; }
  .sum-block { border: 1px solid #ddd; break-inside: avoid; box-shadow: none; }
  .sum-block.headline { background: #faf6ee; }
  .page-title, .output-sentence, .sb-value { color: #111 !important; }
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }
