/* Canvassing App 3.0 — layout for the 3.0 screens (loaded after styles.css + styles-v2.css; colors + fonts come from brand/<id>/theme.css).
   Zero inline styles. --brand is the tenant's primary color . */
:root { }
.tab.active { color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* top bar: logo + short name, sync dot, Me */
.topbar .brand { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); font-weight: 700; }
.brand-logo { width: 22px; height: 22px; border-radius: 6px; }
.brand-logo.big { width: 56px; height: 56px; border-radius: 14px; }
.sync-wrap { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 999px; padding: 8px 10px; box-shadow: var(--shadow); }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--idle); }
.sync-dot.dot-ok { background: var(--ok); } .sync-dot.dot-busy { background: var(--info2); } .sync-dot.dot-wait { background: var(--warn); } .sync-dot.dot-local { background: var(--idle); }
.sync-wrap .queue { font-size: 12px; font-weight: 700; color: var(--muted); }
.topbar .me { margin-left: auto; background: var(--surface); border: 0; border-radius: 999px; padding: 8px 12px; font-weight: 700; box-shadow: var(--shadow); }

/* card: 6 big buttons, 3 × 2 + More */
.card .lead-menu, .lead-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow: visible; margin: 0; padding: 8px 0 6px; }
.card .dispo.big, .dispo.big { min-width: 0; min-height: 62px; padding: 6px 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 700; }
.dispo.big i { font-style: normal; font-size: 20px; line-height: 1; }
.dispo.big span { font-size: 13px; line-height: 1.1; text-align: center; }
.dispo.big.on { background: var(--c); color: #fff; }
.dispo.more-btn { --c: var(--muted); grid-column: span 3; min-height: 38px; flex-direction: row; gap: 6px; }
.more-row { grid-column: span 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dispo.small { min-height: 44px; }
.card-today { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.card-head-actions { display: flex; gap: 6px; align-items: center; }

/* segmented controls used by Leaderboard / Team / Export */
.seg.lb-seg, .seg.team-seg, .seg.ex-seg { display: flex; overflow-x: auto; margin: 0 0 12px; }
.seg.lb-seg button, .seg.ex-seg button { flex: 1; padding: 10px; font-size: 15px; }
.seg.team-seg button { flex: 1 0 auto; }

/* leaderboard */
.lb-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 15px; }
.lb-table th, .lb-table td { padding: 12px 4px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.lb-table th:first-child, .lb-table td:first-child { width: 40px; text-align: center; }
.lb-table th:nth-child(2), .lb-table td:nth-child(2) { text-align: left; width: auto; white-space: normal; overflow: visible; line-height: 1.2; }
.lb-table .you { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.lb-table th:nth-child(n+3), .lb-table td:nth-child(n+3) { width: 22%; }
.lb-table th:nth-child(3), .lb-table td:nth-child(3) { width: 17%; }
.lb-table th:nth-child(4), .lb-table td:nth-child(4) { width: 22%; }
.lb-table th:nth-child(5), .lb-table td:nth-child(5) { width: 17%; }
.lb-table .rank { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.lb-table tbody tr:first-child .rank { background: var(--brand); color: var(--brand-ink); }
.lb-table tr.lb-me td { background: var(--soft); font-weight: 700; }
.lb-table tfoot td { border-top: 2px solid var(--line); font-weight: 700; }
.lb-table td .dot { margin-right: 6px; }
.lb-table td .dot { display: inline-block; }
#view-board .pv-scroll { max-height: none; overflow-x: hidden; }
.lb-note { margin-top: 10px; }

/* Team panes */
.team-pane h3 { margin-top: 14px; }
.team-form { display: grid; gap: 8px; margin-top: 12px; }
.team-form input, .team-form select, .cx-row input, .ex-grid select, .ex-grid input { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.invite-row input { width: 100%; padding: 10px; margin-top: 8px; }
.import-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.map-table select { padding: 6px; border: 1px solid var(--line); border-radius: 8px; max-width: 160px; }
.pv-actions label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pv-actions select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.preview h4 { margin: 14px 0 6px; font-size: 14px; }
.report { margin-top: 10px; font-weight: 600; }
.report .btn { margin-left: 6px; }
.danger-zone { margin-top: 18px; }
.app-version { margin-top: 24px; text-align: center; }

/* Connect */
.cx-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cx-row input { flex: 1 1 160px; }
.cx-once { background: var(--tint-warn); border: 1px solid var(--amber); border-radius: 12px; padding: 10px; margin: 8px 0; }
.cx-once input { width: 100%; padding: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin-bottom: 6px; }
.cx-sample { background: var(--soft); border-radius: 10px; padding: 10px; font-size: 11px; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere; max-width: 100%; max-height: 260px; overflow: auto; }

/* Me sheet + Export sheet */
.me-list { display: grid; gap: 10px; }
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.me-row small { display: block; font-weight: 400; color: var(--muted); }
.me-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); }
.me-row select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.ex-grid { display: grid; gap: 10px; }
.ex-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.ex-custom { display: flex; gap: 8px; }
.ex-custom input { flex: 1; }
.ex-count { margin: 10px 0; font-weight: 600; }

/* sign-in */
.signin-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 6px; }
.signin-brand .brand-name { font-weight: 800; font-size: 18px; margin: 0; text-align: center; }
.signin label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.signin select, .signin input { padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; }
.signin-foot { text-align: center; margin-top: 10px; }
.demo-hint { font-size: 12px; text-align: center; background: var(--tint-warn); border-radius: 10px; padding: 8px; color: var(--on-warn); }

/* lock north: the compass shows the map can't turn */
body.lock-north #pill-compass { opacity: .45; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.toggle-row input { width: 22px; height: 22px; accent-color: var(--brand); flex: 0 0 auto; }
#modal-me label:not(.toggle-row), #modal-export label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13px; color: var(--muted); }
#modal-me select, #modal-export select, #modal-export input { padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: var(--surface); color: var(--ink); }
.custom-dates { display: flex; gap: 8px; }
.custom-dates input { flex: 1; min-width: 0; }
/* Me button: fixed top-right on every tab (it lives outside the views) */
#me-name { position: fixed; top: calc(10px + var(--safe-t)); right: 12px; z-index: 25; background: var(--surface); border: 0; border-radius: 999px; padding: 8px 12px; font-weight: 700; box-shadow: var(--shadow); }
.view:not(#view-map) .viewhead { padding-right: 90px; }

/* sign-in: a solid branded backdrop (the map starts after sign-in, so nothing blank shows behind the sheet) */
#modal-signin { background: var(--soft); }
.signin .rejects.ok { color: var(--on-ok); }   /* Supabase mode: "reset link sent" / "password updated" */
body:has(#modal-signin.open) .topbar, body:has(#modal-signin.open) .tabs, body:has(#modal-signin.open) #me-name, body:has(#modal-signin.open) .pills { visibility: hidden; }

/* toast: top, under the bar, so it never covers the card buttons or Save */
.toast { width: max-content; max-width: calc(100% - 24px); font-size: 14px; }
/* Me sheet toggles: checkbox left, text left */
#modal-me .toggle-row { flex-direction: row; justify-content: flex-start; align-items: center; text-align: left; color: var(--ink); font-size: 16px; margin: 0; }
#modal-me .toggle-row span { flex: 1; }
#me-sync-text, #me-version { margin: 6px 0; }
.lb-table tbody tr:not(:first-child) .rank { color: var(--ink); }
.pv-file { font-size: 13px; color: var(--muted); margin: 10px 0 4px; word-break: break-word; }
.import-head a { font-size: 13px; white-space: nowrap; }
.map-table td:last-child { white-space: normal; word-break: break-all; max-width: 110px; }
.grid.wrap th, .grid.wrap td { white-space: normal; padding: 8px 4px; font-size: 13px; vertical-align: middle; }
.grid.wrap .btn { padding: 6px 8px; font-size: 12px; }

/* 3.7 Access + Platform tabs (Supabase mode): seat meter, messages, settings rows. Existing form / grid / toggle styles do the rest. */
.ac-seats { margin: 4px 0 8px; }
.ac-seats meter { display: block; width: 100%; height: 16px; margin: 6px 0 2px; border: 0; background: var(--soft, var(--fill)); }
/* accent-color does not colour a <meter> on WebKit (the phone preview). Style the fill directly. */
.ac-seats meter::-webkit-meter-bar { background: var(--soft, var(--fill)); border: 0; border-radius: 8px; height: 16px; }
.ac-seats meter::-webkit-meter-optimum-value,
.ac-seats meter::-webkit-meter-suboptimum-value,
.ac-seats meter::-webkit-meter-even-less-good-value { background: var(--brand); border-radius: 8px; }
.ac-seats meter.full::-webkit-meter-optimum-value,
.ac-seats meter.full::-webkit-meter-suboptimum-value,
.ac-seats meter.full::-webkit-meter-even-less-good-value { background: var(--danger); }
.ac-seats meter::-moz-meter-bar { background: var(--brand); border-radius: 8px; }
.ac-seats meter.full::-moz-meter-bar { background: var(--danger); }
.ac-seats meter.full { accent-color: var(--danger); }
.ac-msg { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--tint-ok); color: var(--on-ok); font-size: 14px; } .ac-msg.bad { background: var(--tint-red); color: var(--on-bad); } .ac-msg[hidden] { display: none; }
.ac-num { display: flex; flex-direction: column; gap: 4px; padding: 10px 0 0; font-weight: 600; font-size: 14px; } .ac-num input { padding: 10px; border: 1px solid var(--line); border-radius: 10px; max-width: 160px; }
.ac-roles { flex-wrap: wrap; } .ac-roles label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.grid select.ac-role-sel { padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* brand gradient on primary actions (--grad is 'none' for the light tenants) */
.btn.primary, .pill.active, .rank, .badge { background-image: var(--grad); }
.brand-logo.full { width: auto; height: 84px; border-radius: 0; max-width: 100%; }
.signin-brand:has(.brand-logo.full) .brand-name { display: none; }
.brand-logo.splash-logo.full { height: auto; width: min(220px, 62vw); }
.brand-name { font-weight: 800; letter-spacing: .01em; }
body.has-hud .topbar .brand-name { font-family: var(--ts-font-display, inherit); font-size: 15px; letter-spacing: .02em; }
/* splash (shown by core/Brand.js while the app loads; only brands with a tagline get one). Topographic backdrop = spec .ts-topo-bg, through the theme tokens. */
.ts-topo-bg, .splash { background-color: var(--ts-bg-navy, var(--bg));
  background-image: radial-gradient(circle at 50% 25%, var(--ts-blue-glow, transparent) 0%, transparent 55%), radial-gradient(circle at 50% 65%, var(--ts-orange-glow, transparent) 0%, transparent 50%),
    repeating-radial-gradient(circle at 50% 45%, transparent 0, transparent 28px, var(--topo) 29px, transparent 30px); }
.splash { position: fixed; inset: 0; z-index: 90; display: none; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(56px + var(--safe-t)) 24px calc(56px + var(--safe-b));
  color: var(--muted); pointer-events: none; transition: opacity .45s ease; }
.splash.on { display: flex; } .splash.out { opacity: 0; }
.splash-top { text-align: center; } .splash-top p { margin: 0; text-transform: uppercase; }
.splash-kicker { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--muted); }
.splash-tag { margin-top: 4px !important; font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.splash-logo { width: min(220px, 62vw); height: auto; animation: splash-pulse 2.2s ease-in-out infinite; }
.splash-foot { width: min(260px, 72vw); text-align: center; }
.splash-foot p { margin: 0; } .splash-msg { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 8px !important; } .splash-sub { font-size: 11px; color: var(--muted); margin-top: 8px !important; }
.splash-bar { height: 5px; border-radius: 999px; background: var(--ts-bg-elevated, var(--fill)); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 42%; border-radius: 999px; background: linear-gradient(90deg, var(--ts-orange, var(--brand)), var(--ts-blue, var(--accent2))); animation: splash-run 1.4s ease-in-out infinite; }
@keyframes splash-run { 0% { transform: translateX(-100%); } 100% { transform: translateX(240%); } }
@keyframes splash-pulse { 50% { opacity: .82; transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .splash-bar span { animation: none; width: 68%; } .splash-logo { animation: none; } }

/* 3.9 "My Today" HUD (brands with hud: true) — pill on the map + a card with Contacts / Closes, benchmark, latest signal. Approved map controls stay where they are. */
.hud-pill, .hud-card { display: none; }
body.has-hud .hud-pill { display: inline-flex; align-items: center; gap: 8px; position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; max-width: calc(100% - 100px); white-space: nowrap;
  background: var(--glass); color: var(--ink); border: 1px solid var(--line); border-radius: var(--ts-radius-pill, 999px); padding: 8px 14px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); }
.hud-live { color: var(--ok); font-size: 9px; }
body.has-hud .hud-card:not([hidden]) { display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; background: var(--bg); border-top: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 12px 14px calc(14px + var(--safe-b)); box-shadow: 0 -6px 30px rgba(0, 0, 0, .45); }
.hud-head { display: flex; align-items: center; justify-content: space-between; } .hud-head h3 { margin: 0; font-size: 16px; }
.hud-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.hud-kpi, .hud-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.hud-kpi b { display: block; font-family: var(--ts-font-display, inherit); font-size: 34px; line-height: 1.05; color: var(--ink); } .hud-kpi.accent b { color: var(--brand); }
.hud-kpi span, .hud-label { font-size: 12px; color: var(--muted); margin: 0; }
.hud-box { margin-bottom: 10px; } .hud-signal { border-left: 3px solid var(--accent2); } .hud-signal p:last-child { margin: 4px 0 0; font-weight: 600; font-size: 14px; }
.hud-bar { width: 100%; height: 6px; margin-top: 8px; border: 0; border-radius: 999px; background: var(--fill); appearance: none; overflow: hidden; }
.hud-bar::-webkit-progress-bar { background: var(--fill); } .hud-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--brand), var(--accent2)); border-radius: 999px; } .hud-bar::-moz-progress-bar { background: var(--brand); }
/* header: LIVE SYNC label next to the sync dot (spec 4) — brands with a HUD only; the dot's own states are unchanged */
body.has-hud .sync-wrap:has(.dot-ok)::after { content: 'LIVE SYNC'; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--ok); }

/* form fields follow the theme tokens (light tenants keep white fields: --field defaults to #fff) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { background-color: var(--field); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }

/* theme packs: hybrid mode (a partner's name + logo inside the Turf Signal shell) */
.org-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 46%; background: var(--glass); color: var(--ink); padding: 5px 11px 5px 7px; border-radius: 999px; box-shadow: var(--shadow); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.org-badge[hidden] { display: none; }
.org-logo { width: 18px; height: 18px; flex: 0 0 auto; object-fit: contain; }
.org-name { overflow: hidden; text-overflow: ellipsis; }
.signin-org { margin: 2px 0 8px; font-size: 13px; font-weight: 600; color: var(--brand); text-align: center; }
.signin-org[hidden] { display: none; }

/* Settings > Access: campaign picker on the invite form */
.ac-camps { border: 0; margin: 8px 0 12px; padding: 0; min-width: 0; }
.ac-camps legend { font-weight: 600; font-size: 13px; padding: 0; }
.ac-camps .ac-camp { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; color: var(--ink); }
.ac-camps input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); flex: 0 0 auto; }
