/* Mobile-first. Almost every visitor is a phone inside the Facebook or Instagram
   in-app browser, so nothing here may depend on JavaScript or a downloaded font. */

:root {
  --bg: #fbfaf7;
  --card: #ffffff;
  --ink: #17211f;
  --muted: #5b6b66;
  --line: #e2e0d9;
  --accent: #1f6f5c;
  --accent-ink: #ffffff;
  --ok: #2e7d32;
  --warn: #b25e00;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --card: #1a201e;
    --ink: #eef2f0;
    --muted: #a3b0ab;
    --line: #2c3532;
    --accent: #4fb79b;
    --accent-ink: #08130f;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;                       /* vh is wrong under mobile browser chrome */
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;                       /* no sideways scroll at any width */
}

.wrap { max-width: 480px; margin: 0 auto; padding: 14px 16px 40px; }

h1 { font-size: 25px; line-height: 1.2; margin: 4px 0 8px; letter-spacing: -.02em; }
h2 { font-size: 19px; margin: 26px 0 10px; }
p  { margin: 0 0 12px; }
.lede { font-size: 17px; color: var(--muted); margin-bottom: 12px; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

.ticks { list-style: none; padding: 0; margin: 0 0 20px; }
.ticks li { padding: 5px 0 5px 26px; position: relative; }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}

/* The three objection-killers, kept above the form but on one row, so the form
   itself stays above the fold on a 360x640 phone inside an in-app browser. */
.ticks-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.ticks-inline li { padding: 0 0 0 16px; font-size: 14px; line-height: 1.4; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0 0 18px;
}

.field { display: block; margin: 0 0 18px; }
.field > .q { display: block; font-weight: 600; margin-bottom: 6px; }

input[type=text], input[type=tel], input[type=password], textarea, select {
  -webkit-appearance: none;                 /* iOS otherwise restyles these */
  appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  font-size: 16px;                          /* below 16px iOS force-zooms on focus */
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
textarea { min-height: 60px; }
select { background-image: none; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

/* Radios as full-width cards. Tiny circles are a bad target on a phone. */
.options { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer;
}
.opt input { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: none; }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

[hidden] { display: none !important; }

button, .btn {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-height: 52px;
  padding: 14px 16px;
  font-size: 17px; font-weight: 600; font-family: inherit;
  color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 10px; cursor: pointer;
  text-align: center; text-decoration: none;
}
.btn-wa { background: #25d366; color: #072b14; }

.err { color: #c62828; font-size: 14px; margin-top: 4px; display: block; }
@media (prefers-color-scheme: dark) { .err { color: #ff8a80; } }
.field-error input { border-color: #c62828; }

.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- /leads console. Internal tool: wider, denser, JS allowed. --------------- */

.console { max-width: 1200px; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
@media (min-width: 720px) { .counters { grid-template-columns: repeat(6, 1fr); } }
.counter {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; text-align: center; text-decoration: none; color: inherit; display: block;
}
.counter b { display: block; font-size: 22px; }
.counter span { font-size: 12px; color: var(--muted); }

.filterbox summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.filterbox[open] summary { margin-bottom: 12px; }

.filters { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(4, 1fr); } }
.filters select[multiple] { min-height: 96px; }
.filters label { font-size: 13px; color: var(--muted); display: block; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.actions button, .actions .btn { width: auto; min-height: 44px; padding: 10px 14px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th a { color: inherit; }
/* Already did Sudarshan Kriya, so not the target — but only dim them while they
   are still in the queue. A lead who attended or paid must never read as "ignore". */
tr.learnt td { opacity: .55; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.s-new { background: #fff3cd; color: #7a5b00; }
.s-called { background: #e3f2fd; color: #0d47a1; }
.s-joined_group { background: #e8f5e9; color: #1b5e20; }
.s-attended { background: #ede7f6; color: #4527a0; }
.s-converted { background: #1f6f5c; color: #fff; }
.s-not_interested { background: #eceff1; color: #546e7a; }

/* Number and both one-tap actions stay on one line — the icons are the whole point
   of this column and a wrapped icon reads as a broken cell. */
.rowlinks { white-space: nowrap; }
.rowlinks a { display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px;
              text-align: center; text-decoration: none; font-size: 18px; vertical-align: middle; }

/* Inline editors inside a table row: compact, not full-width page buttons. */
.statuscell select, td textarea { width: auto; min-width: 130px; min-height: 40px;
                                 padding: 6px 8px; font-size: 14px; }
td textarea { width: 100%; min-width: 0; }
.save { width: auto; min-height: 36px; padding: 6px 10px; font-size: 13px; margin-top: 4px; }
.statuscell .pill { display: block; width: fit-content; margin-bottom: 4px; }

/* Under 768px the table becomes cards — follow-up calls happen away from a desk. */
@media (max-width: 767px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
       margin-bottom: 12px; padding: 10px; }
  td { border: 0; padding: 4px 0; }
  td::before { content: attr(data-label) ": "; font-size: 12px; color: var(--muted); }
  td.nolabel::before { content: ""; }
}
