/* XO Pure Ambassador Portal — brand: teal #2f9bc3, rose #d85e9f, amber #f59e0b, ink #0f0f14 */
:root {
  --teal: #2f9bc3;
  --teal-dk: #247fa4;
  --rose: #d85e9f;
  --amber: #f59e0b;
  --ink: #0f0f14;
  --muted: #7a8794;
  --line: #e3ebf1;
  --bg: #f4fafd;
  --card: #ffffff;
  --ok: #16a34a;
  --hot: #e11d48;
  --radius: 14px;
  --tap: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

h1, h2, h3 { margin: 0; letter-spacing: -0.3px; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
a { color: var(--teal-dk); }

.hidden { display: none !important; }

/* ---------- brand header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; }
.wordmark .xo { color: var(--teal); }
.sub { font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.samples-pill {
  display: flex; align-items: center; gap: 6px;
  background: #eaf7ff; color: var(--teal-dk);
  border: 1px solid #cfe9f5;
  border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}

/* ---------- layout ---------- */
main { padding: 16px; max-width: 720px; margin: 0 auto; }
.stack > * + * { margin-top: 12px; }
.section-title { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.section-title:first-child { margin-top: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card.tappable:active { transform: scale(0.995); border-color: var(--teal); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 13px; }

/* ---------- route cards ---------- */
.route-card .date { font-size: 12px; font-weight: 700; color: var(--teal-dk); text-transform: uppercase; letter-spacing: 0.8px; }
.route-card.today { border-color: var(--teal); border-width: 2px; background: linear-gradient(180deg, #f2fbff, #fff); }
.badge-today { background: var(--teal); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 999px; text-transform: uppercase; }
.progress { height: 6px; background: #eef4f8; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }

/* ---------- stops ---------- */
.stop { display: flex; gap: 12px; align-items: flex-start; }
.seq {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  background: #eaf7ff; color: var(--teal-dk);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.stop.done .seq { background: var(--ok); color: #fff; }
.stop-body { flex: 1; min-width: 0; }
.stop-name { font-weight: 650; letter-spacing: -0.2px; }
.angle { font-size: 13px; color: #3d4b57; background: #fbf6ee; border-left: 3px solid var(--amber); padding: 7px 10px; border-radius: 0 8px 8px 0; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: #f1f5f8; color: #55636f; }
.chip.sku { background: #eaf7ff; color: var(--teal-dk); }
.chip.franchise { background: #fff1f7; color: #b03a78; }
.chip.done { background: #e7f7ed; color: #157a3c; }

.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  flex: 1; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 14px;
  text-decoration: none;
}
.btn:active { background: #f1f5f8; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:active { background: var(--teal-dk); }
.btn.logged { background: #f4fbf6; border-color: #bfe6cd; color: #157a3c; }
.btn:disabled { opacity: 0.45; }

/* ---------- bottom nav ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs button {
  flex: 1; border: 0; background: none; color: var(--muted);
  padding: 9px 4px 10px; font-size: 10.5px; font-weight: 650;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
nav.tabs button svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; }
nav.tabs button.active { color: var(--teal); }
.dot { position: absolute; transform: translate(13px, -4px); width: 7px; height: 7px; border-radius: 50%; background: var(--rose); }

/* ---------- sheet (logger) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 15, 20, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: #fff; width: 100%; max-width: 720px;
  border-radius: 20px 20px 0 0;
  max-height: 94vh; overflow-y: auto;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up 0.22s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: 0.6; } }
.grabber { width: 38px; height: 4px; background: #dbe3ea; border-radius: 99px; margin: 2px auto 14px; }

.field { margin-top: 18px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.9px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  min-height: var(--tap);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font-weight: 650; font-size: 14px; color: #55636f;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.opt[aria-pressed="true"] { border-color: var(--teal); background: #eaf7ff; color: var(--teal-dk); }
.opt.hot[aria-pressed="true"] { border-color: var(--hot); background: #fff1f4; color: var(--hot); }
.opt.cold[aria-pressed="true"] { border-color: var(--muted); background: #f1f5f8; color: #55636f; }

.sig {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  width: 100%; text-align: left; font-weight: 600; font-size: 14.5px;
}
.sig + .sig { margin-top: 8px; }
.sig .box {
  flex: 0 0 24px; height: 24px; border-radius: 7px;
  border: 2px solid #cfd9e1; background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800;
}
.sig[aria-pressed="true"] { border-color: var(--teal); background: #f2fbff; }
.sig[aria-pressed="true"] .box { background: var(--teal); border-color: var(--teal); }
.sig .hint { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.sig .req { color: var(--rose); font-weight: 700; }

.sample-box { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.sample-box.on { border-color: var(--rose); background: #fff7fb; }
.sample-box.locked { opacity: 0.6; }
.switch { width: 50px; height: 30px; border-radius: 99px; background: #d7dee5; position: relative; flex: 0 0 50px; border: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: 0.16s; }
.switch[aria-pressed="true"] { background: var(--rose); }
.switch[aria-pressed="true"]::after { transform: translateX(20px); }
.gate { font-size: 12px; color: var(--rose); margin-top: 8px; font-weight: 600; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea, select {
  width: 100%; min-height: 48px; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 16px; background: #fff; color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--teal); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.save {
  width: 100%; min-height: 56px; margin-top: 22px;
  border: 0; border-radius: 14px; background: var(--teal); color: #fff;
  font-size: 16.5px; font-weight: 700;
}
.save:active { background: var(--teal-dk); }
.save:disabled { background: #b9ccd7; }
.ghost { width: 100%; min-height: 48px; margin-top: 8px; border: 0; background: none; color: var(--muted); font-weight: 600; }

/* ---------- pipeline ---------- */
.pl-group { margin-bottom: 6px; }
.pl-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.pl-head .n { background: #eef4f8; color: #55636f; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(170deg, #eaf7ff 0%, #f9f0f6 100%); }
.login { background: #fff; border-radius: 20px; padding: 32px 24px; width: 100%; max-width: 400px; text-align: center; border: 1px solid var(--line); }
.login .wordmark { font-size: 26px; }
.login h2 { font-size: 17px; margin: 22px 0 6px; }
.login .muted { margin-bottom: 20px; }
.code-input { text-align: center; font-size: 30px; letter-spacing: 11px; font-weight: 700; padding-left: 11px; }
.err { color: var(--hot); font-size: 13.5px; margin-top: 12px; font-weight: 600; min-height: 18px; }
.disclaimer { font-size: 10.5px; color: var(--muted); margin-top: 24px; line-height: 1.5; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  z-index: 90; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  max-width: 90vw; text-align: center;
  animation: up 0.2s ease-out;
}
.toast.bad { background: var(--hot); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.mini th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); padding: 6px 8px 6px 0; }
table.mini td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; }
.kpi .v { font-size: 25px; font-weight: 700; letter-spacing: -0.6px; }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.9px; color: var(--muted); font-weight: 650; }
.kpi.teal .v { color: var(--teal); }
.kpi.rose .v { color: var(--rose); }

/* ---------- field-notes upgrade ---------- */
.link { color: var(--teal-dk); }
.chev { color: var(--muted); font-weight: 400; }
.chev-big { color: #c3ced8; font-size: 24px; flex: 0 0 auto; line-height: 1; }
.card.tappable { cursor: pointer; }

.back { text-align: left; margin: 0 0 6px; min-height: 40px; }
.addbiz { margin-top: 14px; }

.date { font-size: 12px; font-weight: 700; color: var(--teal-dk);
        text-transform: uppercase; letter-spacing: 0.8px; }

/* multi-select chip sets (SKU interest / objections) */
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 600; color: #55636f;
}
.pick[aria-pressed="true"] { border-color: var(--teal); background: #eaf7ff; color: var(--teal-dk); }
.pick.block[aria-pressed="true"] { border-color: var(--amber); background: #fdf6e9; color: #b45309; }

.chip.sig   { background: #eef4f8; color: #55636f; }
.chip.block { background: #fdf6e9; color: #b45309; }

.stage-pill {
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto;
}

.searchbar { display: flex; gap: 8px; margin-bottom: 6px; }
.searchbar input { min-height: 46px; }

.entry { border-left: 3px solid var(--teal); }
.entry.note { border-left-color: var(--amber); }
.entry .del { min-height: 36px; font-size: 13px; text-align: right; }
.who { margin-top: 10px; font-size: 14.5px; }
.angle.teal { background: #f2fbff; border-left-color: var(--teal); }
