:root {
  --brand: #3f68f7;
  --brand-bright: #5b7ff8;
  --brand-deep: #2f4fc4;
  --brand-soft: #e6ecfe;
  --brand-softer: #f3f6ff;
  --emerald: #10b981;
  --emerald-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --bg: #ffffff;
  --surface: #fafaf9;
  --cream: #f7f5f0;
  --text: #0f0e10;
  --text-2: #3a3640;
  --muted: #6b6573;
  --border: #ebe9e5;
  --border-strong: #d6d3d1;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(15, 14, 16, .04), 0 8px 24px rgba(15, 14, 16, .035);
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  max-width: 100vw;
  overflow-x: clip;
  background:
    linear-gradient(90deg, transparent calc(50% - 621px), var(--border) calc(50% - 621px), var(--border) calc(50% - 620px), transparent calc(50% - 620px)),
    linear-gradient(90deg, transparent calc(50% + 620px), var(--border) calc(50% + 620px), var(--border) calc(50% + 621px), transparent calc(50% + 621px)),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: 'ss01' 1;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
img, video, svg, iframe, canvas { max-width: 100%; height: auto; }

.wrap { max-width: 920px; margin: 0 auto; padding: 44px 28px 88px; }
a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-deep); text-decoration-thickness: 2px; }

/* Nav */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  min-height: 64px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
nav .brand {
  margin-right: auto;
  padding: 8px 14px 8px 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
nav .brand::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 9px; background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
nav a.navlink {
  min-height: 36px;
  padding: 7px 8px;
  color: var(--text-2);
  font-size: .79rem;
  font-weight: 550;
  text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s;
}
nav a.navlink:hover { background: var(--surface); color: var(--text); }
nav a.navlink.active { background: var(--brand-softer); color: var(--brand); box-shadow: inset 0 -2px var(--brand); }
nav a.navlink.done::after { content: ' ✓'; color: var(--emerald); }
nav a.navlink.active.done::after { color: var(--brand); }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-family: var(--font-display); line-height: 1.16; }
h1 { max-width: 820px; margin: 14px 0 10px; font-size: clamp(2.15rem, 5.5vw, 4rem); font-weight: 700; letter-spacing: -.045em; }
h2 { margin: 52px 0 15px; padding-top: 17px; border-top: 1px solid var(--border); font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 650; letter-spacing: -.028em; scroll-margin-top: 82px; }
h2::before { content: '+'; margin-right: 9px; color: var(--brand); font-family: var(--font-mono); font-size: .72em; font-weight: 500; vertical-align: .1em; }
h3 { margin: 28px 0 9px; color: var(--text); font-size: 1.12rem; font-weight: 650; letter-spacing: -.015em; scroll-margin-top: 82px; }
p, ul, ol { margin-bottom: 14px; color: var(--text-2); }
ul, ol { padding-left: 25px; }
li { margin-bottom: 7px; }
strong { color: var(--text); font-weight: 650; }
.sub { max-width: 760px; margin-bottom: 30px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }

.card {
  position: relative;
  margin: 17px 0;
  padding: 21px 23px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card::after { content: '+'; position: absolute; right: -6px; bottom: -10px; padding: 0 2px; background: var(--bg); color: var(--border-strong); font-family: var(--font-mono); font-size: 14px; }
.card.tip { background: linear-gradient(135deg, var(--emerald-soft), var(--surface) 64%); border-left: 3px solid var(--emerald); }
.card.warn { background: linear-gradient(135deg, var(--amber-soft), var(--surface) 64%); border-left: 3px solid var(--amber); }
.card.script { background: linear-gradient(135deg, var(--brand-softer), var(--surface) 68%); border-left: 3px solid var(--brand); }
.card > :last-child, .card > :last-child > :last-child { margin-bottom: 0; }
.card .label, .handle-label {
  margin-bottom: 8px;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.card.tip .label { color: #047857; }
.card.warn .label { color: var(--amber); }
.script-text { color: var(--text-2); font-style: italic; }

/* Call-script staging */
.script-section { scroll-margin-top: 82px; }
.script-goal { margin: -3px 0 22px; color: var(--muted); font-size: 1rem; }
.script-stack { display: grid; gap: 13px; }
.script-stack > .card { margin: 0; }
.script-lines { display: grid; gap: 10px; }
.script-lines .script-text { margin: 0; padding-left: 15px; border-left: 2px solid var(--brand-soft); }
.script-branch { margin-top: 14px; padding: 16px 18px; background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--emerald); }
.script-branch .handle-label { color: #047857; }
.script-branch.resistance { border-left-color: var(--amber); }
.script-branch.resistance .handle-label { color: var(--amber); }
.script-branch .card { margin: 14px 0 0; }
.outcome { margin-top: 11px; }
.script-note { margin-top: 10px; color: var(--muted); font-size: .84rem; }
.script-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 30px; }
.script-jump a { text-decoration: none; }
.cross-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cross-links a { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 650; text-decoration: none; }
.cross-links a:hover { border-color: var(--brand); color: var(--brand); }

.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 620px; margin: 17px 0; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--cream); color: var(--muted); font-family: var(--font-mono); font-size: .71rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
tr:hover td { background: var(--surface); }

.price { margin: 4px 0 6px; color: var(--brand); font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -.035em; }
.pill {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 9px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.pill.green { background: var(--emerald-soft); border-color: #a7f3d0; color: #047857; }
.pill.blue { background: var(--brand-softer); border-color: var(--brand-soft); color: var(--brand); }
.pill.yellow { background: var(--amber-soft); border-color: #fde68a; color: var(--amber); }
.pill.red { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }

/* Research and quick-reference links */
.go-deeper { margin: 16px 0 22px; padding: 15px 17px; background: var(--brand-softer); border: 1px solid var(--brand-soft); }
.go-deeper .handle-label { margin-bottom: 7px; }
.link-list { display: flex; flex-wrap: wrap; gap: 7px 15px; margin: 0; padding: 0; list-style: none; }
.link-list li { margin: 0; }
.link-list a { font-size: .88rem; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.quick-grid .card { margin: 0; }
.quick-grid .wide { grid-column: 1 / -1; }
.cheat-section h2 { margin-top: 28px; }
.cheat-section .card { padding: 17px 19px; }
.cheat-section p, .cheat-section li { font-size: .92rem; line-height: 1.5; }
.compact-list li { margin-bottom: 4px; }

/* Dashboard */
.day-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 14px; margin-top: 25px; }
.day-card {
  display: block;
  min-height: 190px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.day-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 14px 34px rgba(79,57,246,.09); color: var(--text); text-decoration: none; }
.day-card .daynum { color: var(--brand); font-family: var(--font-mono); font-size: .71rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.day-card h3 { margin: 7px 0 8px; }
.day-card p { margin: 0 0 14px; color: var(--muted); font-size: .86rem; }
.progress-bar { height: 5px; overflow: hidden; background: var(--brand-soft); }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); transition: width .3s; }
.day-card .status { margin-top: 7px; color: var(--muted); font-size: .77rem; }

/* Quiz */
.quiz { margin: 22px 0; padding: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.quiz h3 { margin-top: 0; color: var(--text); }
.q { margin: 20px 0; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.q:last-of-type { border-bottom: 0; }
.q .qtext { margin-bottom: 9px; color: var(--text); font-weight: 650; }
.q label { display: block; margin: 6px 0; padding: 9px 12px; background: #fff; border: 1px solid var(--border); cursor: pointer; font-size: .91rem; transition: border-color .15s, background .15s; }
.q label:hover { background: var(--brand-softer); border-color: var(--brand); }
.q label.correct { background: var(--emerald-soft); border-color: var(--emerald); }
.q label.incorrect { background: var(--danger-soft); border-color: var(--danger); }
.q input { margin-right: 8px; accent-color: var(--brand); }
.q .explain { display: none; margin-top: 9px; padding: 9px 12px; background: var(--cream); color: var(--muted); font-size: .86rem; }
.q.answered .explain { display: block; }
button.btn {
  min-height: 44px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border: 0;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 650;
  box-shadow: 0 7px 18px rgba(79,57,246,.18);
}
button.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
button.btn.secondary { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.quiz-result { margin-top: 14px; font-weight: 700; }
.quiz-result.pass { color: #047857; }
.quiz-result.fail { color: var(--amber); }
.study-list { margin-top: 20px; }
.study-list > ol { margin: 12px 0 0; }
.study-list li { margin: 0 0 18px; padding: 0 0 16px 4px; border-bottom: 1px solid var(--border); }
.study-list li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.study-list li p { margin: 5px 0; font-size: .9rem; }
.study-answer { margin-top: 6px; color: var(--text); font-size: .9rem; }
.study-links { font-size: .84rem; }

/* Self-assessment */
.assessment-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 14px 0 22px; color: var(--muted); font-size: .86rem; }
.assessment-meta strong { color: var(--brand); }
.assessment-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.topic-report th, .topic-report td { white-space: nowrap; }
.topic-report .weak td { background: var(--amber-soft); }
.recommendations { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.recommendations .card { margin: 0; }
.resume-note { margin: 12px 0; color: var(--muted); font-size: .86rem; }

/* Objection library */
#obj-search { width: 100%; margin: 17px 0; padding: 13px 15px; background: #fff; border: 1px solid var(--border-strong); color: var(--text); font: inherit; box-shadow: var(--shadow-sm); }
#obj-search:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.obj { margin: 10px 0; overflow: hidden; background: #fff; border: 1px solid var(--border); scroll-margin-top: 82px; }
.obj summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 15px 18px; color: var(--text); cursor: pointer; font-weight: 650; list-style: none; }
.obj summary::-webkit-details-marker { display: none; }
.obj summary::after { content: '+'; margin-left: auto; color: var(--brand); font-family: var(--font-mono); font-size: 1rem; }
.obj[open] summary::after { content: '−'; }
.obj summary:hover { background: var(--brand-softer); }
.obj .body { padding: 7px 18px 17px; border-top: 1px solid var(--border); background: var(--surface); }
.obj .body p { font-size: .92rem; }
.obj .handle-label { margin: 12px 0 5px; color: var(--brand); }

/* Passcode gate */
#gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; background: radial-gradient(circle at 50% 20%, var(--brand-softer), #fff 45%); }
#gate .gate-box { width: 100%; max-width: 410px; padding: 32px; background: #fff; border: 1px solid var(--border); box-shadow: 0 24px 70px rgba(15,14,16,.12); text-align: center; }
#gate h1 { font-size: 2rem; }
#gate input { width: 100%; margin: 14px 0; padding: 12px 15px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font: inherit; text-align: center; }
#gate input:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
#gate .err { min-height: 1.4em; margin-top: 9px; color: var(--danger); font-size: .86rem; }
.checklist label { display: block; padding: 7px 0; cursor: pointer; }
.checklist input { margin-right: 10px; accent-color: var(--brand); }

footer { margin-top: 65px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; text-align: center; }

@media (max-width: 760px) {
  body { background: var(--bg); }
  nav { align-items: flex-start; padding: 8px 14px; }
  nav .brand { width: 100%; margin-right: 0; padding-bottom: 3px; }
  nav a.navlink { padding: 6px 8px; font-size: .76rem; }
  .wrap { padding: 30px 18px 65px; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-grid .wide { grid-column: auto; }
  .card { padding: 18px; }
  table { min-width: 600px; }
}

@media print {
  nav, .quiz, #gate, footer, #assessment { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .card, .obj, .go-deeper { break-inside: avoid; background: #fff; border-color: #bbb; box-shadow: none; }
  .card::after { display: none; }
  a { color: #000; text-decoration: none; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
}
