:root {
  --forest: #1A3A34; --forest-2: #24504a; --forest-tint: #e7efec;
  --gold: #c9a24a; --gold-text: #7f6421; --gold-tint: #f6efdc;
  --bg: #f6f4ef; --card: #ffffff; --ink: #1d2422; --muted: #5d6965; --line: #e2ded5; --line-2: #eeebe4;
  --red: #b3412f; --red-tint: #fbe9e5; --amber: #9a6a00; --amber-tint: #fdf3dc; --blue: #2c5d8a; --blue-tint: #e6eef6; --green: #2e7a4f; --green-tint: #e4f2e9;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,30,28,.06), 0 4px 16px rgba(20,30,28,.05);
  --serif: 'Newsreader', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --link: #24504a; --accent-text: #1A3A34;
  color-scheme: light;
}
/* Dark theme: follows the device unless the user picks Light or Dark (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111715; --card: #18201e; --ink: #e8ece9; --muted: #9aa8a3; --line: #2b3533; --line-2: #222b29;
    --forest-tint: #1f2f2b; --gold-tint: #2c2716; --gold-text: #d9b866; --red-tint: #3a1f1a; --amber-tint: #33290f; --blue-tint: #18283a; --green-tint: #17301f;
    --red: #e58b78; --amber: #e2b04a; --blue: #8db8e0; --green: #7fcf9e; --shadow: none; color-scheme: dark;
    --link: #8fd0bf; --accent-text: #9fd8c8;
  }
}
:root[data-theme="dark"] {
    --bg: #111715; --card: #18201e; --ink: #e8ece9; --muted: #9aa8a3; --line: #2b3533; --line-2: #222b29;
    --forest-tint: #1f2f2b; --gold-tint: #2c2716; --gold-text: #d9b866; --red-tint: #3a1f1a; --amber-tint: #33290f; --blue-tint: #18283a; --green-tint: #17301f;
    --red: #e58b78; --amber: #e2b04a; --blue: #8db8e0; --green: #7fcf9e; --shadow: none; color-scheme: dark;
    --link: #8fd0bf; --accent-text: #9fd8c8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; font-family: var(--sans); font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--forest); color: #e9f0ee; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--forest); display: grid; place-items: center; font: 700 15px var(--serif); }
.brand b { display: block; font: 600 15px var(--serif); } .brand span { font-size: 12px; opacity: .7; }
.side a.nav { display: flex; align-items: center; gap: 10px; color: #dbe6e3; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-weight: 500; }
.side a.nav:hover { background: rgba(255,255,255,.07); }
.side a.nav.on { background: rgba(255,255,255,.13); color: #fff; }
.side a.nav .badge { margin-left: auto; background: var(--gold); color: var(--forest); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side .sect { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: 14px 10px 4px; }
.side .who { margin-top: auto; padding: 10px; font-size: 13px; border-top: 1px solid rgba(255,255,255,.12); }
.side .who button { background: none; border: 0; color: #cfe0db; padding: 0; text-decoration: underline; cursor: pointer; font-size: 13px; }
.main { padding: 26px 32px 80px; max-width: 1280px; width: 100%; min-width: 0; }
.topbar { display: none; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }

/* cards + grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }
.card .cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card .cardhead h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.g-contact { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font: 600 26px var(--serif); } .kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 550; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.primary:hover { background: var(--forest-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1d1a10; }
.btn.danger { color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--forest) 40%, transparent); border-color: var(--forest-2); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.err { color: var(--red); font-size: 14px; margin: 8px 0; }
.ok { color: var(--green); font-size: 14px; }

/* chips + pills */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; user-select: none; }
.chip.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.chip.out { font-weight: 600; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 9px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.new { background: var(--blue-tint); color: var(--blue); }
.pill.contacted { background: var(--line-2); color: var(--muted); }
.pill.callback, .pill.quoted { background: var(--amber-tint); color: var(--amber); }
.pill.meeting { background: var(--forest-tint); color: var(--accent-text); }
.pill.for_ross { background: var(--gold-tint); color: var(--gold-text); }
.pill.won { background: var(--green-tint); color: var(--green); }
.pill.lost, .pill.not_interested, .pill.do_not_call { background: var(--red-tint); color: var(--red); }
.pill.pending { background: var(--amber-tint); color: var(--amber); } .pill.approved, .pill.confirmed { background: var(--blue-tint); color: var(--blue); }
.pill.paid { background: var(--green-tint); color: var(--green); } .pill.void, .pill.cancelled { background: var(--red-tint); color: var(--red); }

/* tables + lists */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--line-2); }
.tablewrap { overflow-x: auto; }
.list { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item .when { width: 92px; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .when.late { color: var(--red); font-weight: 600; }
.item .body { flex: 1; min-width: 0; }
.item .acts { display: flex; gap: 6px; flex: none; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; font-size: 14px; }
.tel { font-weight: 600; text-decoration: none; white-space: nowrap; }
.timeline .item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 6px; flex: none; }
.timeline .item .dot.call { background: var(--forest-2); } .timeline .item .dot.sale { background: var(--gold); } .timeline .item .dot.task { background: var(--blue); }
.note { white-space: pre-wrap; }

/* offers */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--forest); }
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.offer { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.offer:hover { border-color: var(--forest-2); }
.offer .price { font: 600 22px var(--serif); color: var(--accent-text); }
.offer .name { font-weight: 650; }
.offer .feat { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--gold-text); background: var(--gold-tint); border-radius: 99px; padding: 1px 8px; }
.od { max-width: 860px; }
.od .hero { background: var(--forest); color: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.od .hero .price { font: 600 34px var(--serif); color: var(--gold); }
.od .hero p { margin: 6px 0 0; color: #d9e6e2; }
.od .pitch { background: var(--gold-tint); border-left: 4px solid var(--gold); padding: 14px 16px; border-radius: 6px; font-size: 16px; }
.od ul { padding-left: 20px; margin: 6px 0; } .od li { margin: 5px 0; }
.od section { margin-top: 18px; }
.od section h3 { margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details.faq { border-bottom: 1px solid var(--line-2); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 8px; }
details.faq summary::before { content: '+'; color: var(--gold-text); font-weight: 700; width: 12px; }
details.faq[open] summary::before { content: '–'; }
details.faq p { margin: 6px 0 0 20px; color: var(--ink); }
details.faq .src { margin-left: 20px; }
mark { background: var(--gold-tint); color: inherit; padding: 0; border-radius: 2px; }

/* call panel */
.callpanel { border: 2px solid var(--forest); }
.outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin-bottom: 12px; }
.outcomes .chip { text-align: center; border-radius: 8px; padding: 8px 10px; }
.nextstep { background: var(--line-2); border-radius: 8px; padding: 12px; margin: 12px 0; }
.slotdays { display: flex; gap: 10px; overflow: auto; max-height: 340px; padding-bottom: 6px; }
.slotday { flex: 0 0 auto; width: 112px; }
.slotday .dh { font-size: 12px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.slotday .dh span { display: block; font-weight: 400; color: var(--muted); }
.slot { display: block; width: 100%; margin-bottom: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 4px; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot.taken { text-decoration: line-through; opacity: .45; cursor: not-allowed; }
.slot.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.slotday .off { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0; }

/* drawer + modal + toast */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.15); transform: translateX(100%); transition: transform .2s ease; z-index: 40; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer .dhead { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; background: var(--card); }
.drawer .dbody { overflow-y: auto; padding: 16px; flex: 1; }
.refbtn { position: fixed; right: 18px; bottom: 18px; z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.modalbg { position: fixed; inset: 0; background: rgba(10,20,18,.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: 12px; width: min(620px, 100%); max-height: 92vh; overflow-y: auto; padding: 22px; }
.modal h2 { margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--forest); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; box-shadow: var(--shadow); }
.toast.bad { background: var(--red); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--forest); }
.login .card { width: min(400px, 100%); padding: 28px; }
.login .brand { padding: 0 0 18px; } .login .brand b { color: var(--ink); } .login .brand span { color: var(--muted); opacity: 1; }

.copyline { display: flex; gap: 8px; align-items: center; background: var(--line-2); border-radius: 8px; padding: 8px 10px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-x: auto; }
.copyline code { flex: 1; white-space: nowrap; }
.split { display: flex; justify-content: space-between; gap: 8px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--forest-2); }

/* find businesses */
.findgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.placemap { height: calc(100vh - 120px); min-height: 420px; position: sticky; top: 16px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.places { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.place { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
.place:hover { border-color: var(--forest-2); }
.place.flash { box-shadow: 0 0 0 3px var(--gold); }
.ctx { position: fixed; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.2); padding: 4px; min-width: 210px; }
.ctx button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.ctx button:hover { background: var(--line-2); }
.leaflet-container { font: inherit; }

@media (max-width: 1000px) {
  .findgrid { grid-template-columns: 1fr; } .placemap { position: static; height: 320px; min-height: 0; }
  .g-contact, .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 45; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--forest); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px; }
  .topbar b { font: 600 16px var(--serif); }
  .main { padding: 16px 16px 90px; }
  h1 { font-size: 23px; }
  .fields2 { grid-template-columns: 1fr; }
  .item .when { width: 70px; }
  .item { flex-wrap: wrap; } .item .acts { width: 100%; justify-content: flex-end; }
  table.resp thead { display: none; }
  table.resp tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.resp td { display: block; border: 0; padding: 2px 4px; }
}

/* theme switch */
.themeswitch { display: flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 8px; padding: 2px; margin: 8px 0; }
.themeswitch button { flex: 1; border: 0; background: none; color: #cfe0db; font-size: 12px; padding: 4px 0; border-radius: 6px; cursor: pointer; text-decoration: none !important; }
.themeswitch button.on { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.login .themeswitch { background: var(--line-2); margin: 14px 0 0; }
.login .themeswitch button { color: var(--muted); } .login .themeswitch button.on { background: var(--card); color: var(--ink); }

/* Learn */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.modules .card + .card { margin-top: 0; }
.module.complete { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.module h3 { font: 600 18px var(--serif); }
.lessonlist { margin-top: 10px; border-top: 1px solid var(--line-2); padding-top: 6px; }
.lessonrow { display: flex; gap: 10px; align-items: center; padding: 7px 4px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; }
.lessonrow:hover { background: var(--line-2); }
.lessonrow .grow { flex: 1; }
.lessonrow .tick { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--line-2); color: var(--muted); }
.lessonrow.done .tick { background: var(--green-tint); color: var(--green); }
.lessonrow.quizrow .tick { background: var(--gold-tint); color: var(--gold-text); }
.signoff { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; }
.signoff.ok { border-style: solid; border-color: color-mix(in srgb, var(--green) 50%, var(--line)); background: var(--green-tint); }
.lesson { max-width: 760px; padding: 28px 32px; }
.lesson h1 { font-size: 30px; margin-bottom: 14px; }
.lessonbody { font-size: 16.5px; line-height: 1.65; }
.lessonbody h2 { font-size: 21px; margin: 26px 0 8px; }
.lessonbody h3 { margin: 18px 0 6px; }
.lessonbody p { margin: 0 0 12px; }
.lessonbody ul, .lessonbody ol { padding-left: 22px; margin: 0 0 12px; } .lessonbody li { margin: 4px 0; }
.lessonbody table { margin: 8px 0 16px; font-size: 14.5px; } .lessonbody th, .lessonbody td { border-bottom: 1px solid var(--line); }
.lessonbody blockquote { margin: 14px 0; padding: 12px 16px; border-radius: 8px; background: var(--line-2); border-left: 4px solid var(--line); }
.lessonbody blockquote p:last-child { margin: 0; }
.lessonbody blockquote.say { background: var(--gold-tint); border-left-color: var(--gold); }
.lessonbody blockquote.try { background: var(--forest-tint); border-left-color: var(--forest-2); }
.quiz { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; max-width: 760px; }
.quiz .card + .card { margin-top: 0; }
.qtext { font-weight: 600; margin: 4px 0 10px; font-size: 16px; }
.qopts { display: flex; flex-direction: column; gap: 6px; }
.qopt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.qopt input { margin-top: 4px; }
.qopt:hover { border-color: var(--forest-2); }
.qcard.right { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.qcard.wrong { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.qopt.answer { background: var(--green-tint); border-color: var(--green); }
.qresult { font-size: 14px; margin-top: 8px; }
.card.pass { background: var(--green-tint); } .card.fail { background: var(--amber-tint); }
@media (max-width: 760px) { .lesson { padding: 18px; } .lessonbody { font-size: 16px; } }

/* Facts & sources */
.refdoc { overflow-x: auto; font-size: 14px; }
.refdoc h1 { font-size: 24px; margin-bottom: 8px; } .refdoc h2 { font-size: 19px; margin: 22px 0 8px; } .refdoc h3 { margin: 16px 0 6px; }
.refdoc table { margin: 8px 0 16px; font-size: 13px; min-width: 760px; }
.refdoc th, .refdoc td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.refdoc td a { overflow-wrap: anywhere; }
.refdoc code { font-size: 12px; background: var(--line-2); padding: 0 4px; border-radius: 4px; }
.st { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.st-VERIFIED, .st-DECIDED { background: var(--green-tint); color: var(--green); }
.st-CORRECTED, .st-OUTDATED, .st-PENDING, .st-REALITY { background: var(--amber-tint); color: var(--amber); }
.st-UNVERIFIABLE, .st-PAUSED { background: var(--red-tint); color: var(--red); }
.st-JHC-OWN { background: var(--blue-tint); color: var(--blue); }

/* Email & invoices */
.timeline .item .dot.email { background: var(--gold); }
.invline { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; }
.invline .grow { flex: 1; }
.invline input[type=number] { padding: 4px 6px; }
