/* JDMIS Connect — lead capture & needs assessment
   Mobile-first. One column ≤640px, comfortable on tablet ≥720px. */

:root {
  --ink: #2b2620;
  --ink-soft: #6b5f52;
  --ink-faint: #a39686;
  --paper: #faf7f1;
  --card: #ffffff;
  --gold: #a88037;
  --gold-strong: #8a6727;
  --gold-soft: #f3e9d7;
  --gold-chip: #fbf4e6;
  --line: #e8e0d2;
  --green: #2e7d4f;
  --green-soft: #e6f4ec;
  --red: #b3472f;
  --red-soft: #fbeeEB;
  --blue: #3d5a80;
  --blue-soft: #e9eff7;
  --shadow: 0 1px 2px rgba(43, 38, 32, .05), 0 8px 24px rgba(43, 38, 32, .07);
  --radius: 18px;
  --tap: 48px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

#app { max-width: 680px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
@media (min-width: 720px) { #app { max-width: 760px; padding-top: 8px; } }

/* ---------- splash ---------- */
.splash { text-align: center; padding: 18vh 20px; }
.splash-mark {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px;
  background: linear-gradient(135deg, var(--gold), #c9a45c);
  color: #fff; font-weight: 800; font-size: 26px; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center;
}
.splash-title { font-size: 22px; font-weight: 800; }
.splash-sub { color: var(--ink-faint); margin-top: 6px; }

/* ---------- headers ---------- */
.masthead { display: flex; align-items: center; gap: 12px; padding: 18px 2px 10px; }
.masthead .mark {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--gold), #c9a45c);
  color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.masthead .t { flex: 1; min-width: 0; }
.masthead .t .name { font-weight: 800; font-size: 17px; }
.masthead .t .sub { color: var(--ink-faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-strong);
}
.badge.live { background: var(--green-soft); color: var(--green); }

/* ---------- progress ---------- */
.progress { display: flex; gap: 6px; padding: 4px 2px 14px; }
.progress i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); transition: background .25s; }
.progress i.on { background: var(--gold); }

/* ---------- cards / steps ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 18px; margin-bottom: 16px;
}
.step-head .kicker { color: var(--gold-strong); font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.step-head h1 { margin: 6px 0 4px; font-size: 24px; line-height: 1.2; font-weight: 800; }
.step-head p.lead { margin: 4px 0 0; color: var(--ink-soft); font-size: 15px; }
.hint { color: var(--ink-faint); font-size: 13px; margin: 10px 0 0; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 14px; padding: 10px 16px; font-size: 15px; font-weight: 600;
  min-height: var(--tap); display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; transition: all .15s; user-select: none;
}
.chip:active { transform: scale(.97); }
.chip.on { border-color: var(--gold); background: var(--gold-chip); color: var(--gold-strong); }
.chip .tag {
  font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--gold); color: #fff; border-radius: 99px; padding: 2px 7px;
}

/* option cards (grid) */
.opt-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
@media (min-width: 560px) { .opt-grid { grid-template-columns: 1fr 1fr; } }
.opt {
  position: relative; border: 1.5px solid var(--line); border-radius: 16px; background: #fff;
  padding: 14px; cursor: pointer; transition: all .15s; min-height: var(--tap);
}
.opt:active { transform: scale(.985); }
.opt.on { border-color: var(--gold); background: var(--gold-chip); }
.opt .ic { font-size: 24px; }
.opt .ti { font-weight: 700; font-size: 15.5px; margin-top: 4px; }
.opt .su { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.opt .pop {
  position: absolute; top: -9px; right: 10px; background: var(--gold); color: #fff;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 99px;
}
.opt .tick {
  position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 99px;
  border: 2px solid var(--line); display: none; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800;
}
.opt.on .tick { display: flex; background: var(--gold); border-color: var(--gold); }

/* segmented control */
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 14px; background: #fff; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 12px 6px; font-size: 14.5px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; min-height: var(--tap); border-left: 1.5px solid var(--line);
}
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--gold-chip); color: var(--gold-strong); font-weight: 700; }

/* day × slot availability */
.dayrow { display: flex; gap: 8px; margin-top: 14px; }
.dayrow .d {
  flex: 1; text-align: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 0;
  font-weight: 700; font-size: 13.5px; cursor: pointer; background: #fff; color: var(--ink-soft);
  min-height: var(--tap); display: flex; align-items: center; justify-content: center;
}
.dayrow .d.on { border-color: var(--gold); background: var(--gold-chip); color: var(--gold-strong); }

/* ---------- forms ---------- */
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 13px; background: #fff;
  padding: 12px 14px; font-size: 16px; font-family: inherit; color: var(--ink); min-height: var(--tap);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field .req { color: var(--red); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.check span { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; border: 0; border-radius: 15px;
  background: linear-gradient(135deg, var(--gold), #b58c3e); color: #fff;
  font-size: 17px; font-weight: 800; cursor: pointer; transition: transform .12s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(168, 128, 55, .35);
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; box-shadow: none; }
.btn.ghost {
  background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); box-shadow: none; font-weight: 700;
}
.btn.small { min-height: 42px; font-size: 14.5px; width: auto; padding: 0 18px; border-radius: 12px; }
.navrow { display: flex; gap: 10px; margin-top: 20px; }
.navrow .btn.ghost { flex: 0 0 auto; width: auto; padding: 0 22px; }
.navrow .btn:not(.ghost) { flex: 1; }

/* ---------- thank you ---------- */
.done-card { text-align: center; padding: 34px 20px; }
.done-card .big { font-size: 52px; }
.done-card h2 { margin: 10px 0 6px; font-size: 22px; }
.done-card p { color: var(--ink-soft); }
.next-steps { text-align: left; margin: 18px auto 0; max-width: 420px; }
.next-steps .ns { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.next-steps .ns:first-child { border-top: 0; }
.next-steps .ns b { color: var(--gold-strong); }

/* =========================================================== */
/* STAFF CONSOLE                                               */
/* =========================================================== */
body.mode-staff { --paper: #f4f1ea; }

.ctxbar {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 14px;
}
.ctxbar .av {
  width: 46px; height: 46px; border-radius: 99px; flex: none;
  background: var(--gold-soft); color: var(--gold-strong); font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.ctxbar .who { flex: 1; min-width: 0; }
.ctxbar .who .n { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctxbar .who .m { color: var(--ink-faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctxbar .pill { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); flex: none; }
.ctxbar .pill.hot { background: var(--red-soft); color: var(--red); }
.ctxbar .pill.ok { background: var(--green-soft); color: var(--green); }

.searchbox { position: relative; }
.searchbox .sugg {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 320px; overflow: auto;
}
.sugg .row { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; align-items: center; gap: 10px; }
.sugg .row:last-child { border-bottom: 0; }
.sugg .row:active, .sugg .row:hover { background: var(--gold-chip); }
.sugg .row .n { font-weight: 700; font-size: 14.5px; }
.sugg .row .d { color: var(--ink-faint); font-size: 12px; }
.sugg .row .id { margin-left: auto; color: var(--ink-faint); font-size: 11.5px; flex: none; }

/* section steps */
.snum {
  width: 26px; height: 26px; border-radius: 99px; background: var(--gold); color: #fff;
  font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
  margin-right: 9px; flex: none;
}
.step-head.tight h1 { font-size: 19px; display: flex; align-items: center; }

.script {
  background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 0 12px 12px 0;
  padding: 10px 14px; margin-top: 14px; font-size: 14.5px; color: var(--ink);
}
.script b { color: var(--blue); }
.script .why { display: block; color: var(--ink-faint); font-size: 12px; margin-top: 4px; }

/* question block with close/ignore */
.q { border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; margin-top: 12px; background: #fff; }
.q .qt { font-weight: 700; font-size: 15px; }
.q .qctl { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.q .qctl .qd {
  border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-faint); cursor: pointer; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
}
.q .qd.on-open    { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.q .qd.on-closed  { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.q .qd.on-ignored { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.q .qnote { margin-top: 9px; }
.q .qnote textarea { min-height: 60px; font-size: 14.5px; }

/* interest rows with level segmented */
.introw { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 10px; background: #fff; flex-wrap: wrap; }
.introw .nm { flex: 1; min-width: 150px; font-weight: 700; font-size: 14.5px; }
.introw .seg { margin: 0; flex: 2; min-width: 230px; }
.introw .seg button { padding: 8px 4px; font-size: 12.5px; min-height: 40px; }
.introw .rm { border: 0; background: none; color: var(--ink-faint); font-size: 17px; cursor: pointer; padding: 6px; }

/* schedule offer rows */
.cls { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 10px; background: #fff; }
.cls.pick { border-color: var(--gold); background: var(--gold-chip); }
.cls .r1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cls .nm { font-weight: 800; font-size: 15px; flex: 1; min-width: 160px; }
.cls .when { color: var(--ink-soft); font-size: 13.5px; }
.cls .r2 { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; color: var(--ink-soft); font-size: 13px; }
.cls .price { font-weight: 800; color: var(--ink); }
.cls .dep { color: var(--ink-faint); font-weight: 600; }
.cls .seats { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.cls .seats.low { background: var(--red-soft); color: var(--red); }
.cls .offer-btn { margin-left: auto; }

/* kit drawer */
.kit-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  min-height: 52px; padding: 0 20px; width: auto; border-radius: 99px;
  display: flex; align-items: center; gap: 8px; font-size: 15px;
  background: linear-gradient(135deg, var(--ink), #4a4238); box-shadow: 0 8px 22px rgba(43,38,32,.4);
}
.kit {
  position: fixed; inset: 0; z-index: 70; display: none;
}
.kit.open { display: block; }
.kit .veil { position: absolute; inset: 0; background: rgba(43,38,32,.45); }
.kit .panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 760px; margin: 0 auto;
}
.kit .grip { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.kit h3 { margin: 4px 0 2px; font-size: 18px; }
.kit .ktabs { display: flex; gap: 8px; margin: 12px 0; }
.kit .ktabs button {
  flex: 1; border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 12px;
  padding: 9px 4px; font-weight: 700; font-size: 13.5px; cursor: pointer; min-height: 44px;
}
.kit .ktabs button.on { border-color: var(--gold); color: var(--gold-strong); background: var(--gold-chip); }
.kit .qlinks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.kit .qlinks a {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; font-weight: 700; font-size: 14px;
}
.kit .qlinks a small { color: var(--ink-faint); font-weight: 600; }

/* price table */
.ptable { width: 100%; border-collapse: collapse; margin-top: 10px; background: #fff; border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.ptable th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); padding: 8px 10px; border-bottom: 1.5px solid var(--line); }
.ptable td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.ptable td.p { font-weight: 800; }

/* summary */
.sumlist { border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 14px; }
.sumlist .sr { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; background: #fff; }
.sumlist .sr:last-child { border-bottom: 0; }
.sumlist .k { color: var(--ink-faint); flex: 0 0 130px; font-weight: 700; font-size: 12.5px; }
.sumlist .v { flex: 1; font-weight: 600; }

.alert { border-radius: 13px; padding: 11px 14px; font-size: 14px; font-weight: 600; margin-top: 12px; }
.alert.err { background: var(--red-soft); color: var(--red); }
.alert.ok { background: var(--green-soft); color: var(--green); }

.busy { display: inline-block; width: 16px; height: 16px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 99px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer-note { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 18px 0 6px; }
a { color: var(--gold-strong); }
