/* ═══════════════════════════════════════════════════════════
   Rural Community Help Desk — "Warm Civic Trust" design system
   Forest-teal + warm cream + clay. Built for older, rural,
   low-bandwidth, online + offline users.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── Brand: Warm Civic Trust (forest-teal + cream + clay) ── */
  --primary: #1f5a52;        /* deep forest-teal — civic, trustworthy */
  --primary-dark: #143f39;   /* darker teal — nav row, banner, hovers */
  --secondary: #c25a3a;      /* warm clay / terracotta — THE primary action */
  --accent: #d99a4e;         /* warm heritage gold — offline tab, highlights */

  /* ── Status (muted heritage; each AA on its paired text) ── */
  --success: #2f7d4a;
  --warning: #b06f1f;
  --danger:  #a23b32;

  /* ── Surfaces & paper neutrals ── */
  --bg: #f6f1e7;             /* warm cream page */
  --card: #fffdf8;           /* warm white panel (legacy alias) */
  --surface: #fffdf8;
  --surface-alt: #efe7d6;    /* sand / inset wash / selected fill */

  /* ── Ink & lines ── */
  --text: #26241f;           /* warm near-black ink (~13:1 on cream) */
  --text-light: #5d564b;     /* legacy alias */
  --text-muted: #5d564b;
  --border: #d8ccb6;         /* warm sand hairline */
  --border-strong: #c2b497;

  /* ── Persistent connection HUD (tri-state) ── */
  --conn-online: #2f7d4a;
  --conn-syncing: #b06f1f;
  --conn-offline: #5d564b;

  /* ── Status tint pairs (bg / text) ── */
  --tint-open-bg: #d8ece8;     --tint-open-text: #154a42;
  --tint-l1-bg:   #f1e2cb;     --tint-l1-text:   #8a4a26;
  --tint-l2-bg:   #ecdce2;     --tint-l2-text:   #7d3754;
  --tint-resolved-bg: #d9e9d8; --tint-resolved-text: #275f33;
  --tint-pending-bg:  #e7ddca; --tint-pending-text:  #6b5230;
  --tint-urgent-bg:   #f3d9cf; --tint-urgent-text:   #8c2f26;
  --tint-offline-bg:  #e7e1d4; --tint-offline-text:  #4f4a40;
  --tint-cat-bg:      #def0ec; --tint-cat-text:      #1f5a52;

  /* ── Priority rail / dot colors (earthy) ── */
  --pri-low: #2f7d4a;
  --pri-medium: #d99a4e;
  --pri-high: #c25a3a;
  --pri-urgent: #8c4a63;

  /* ── Type ── */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Consolas, 'Liberation Mono', monospace;
  --line-body: 1.6;
  --line-tight: 1.2;

  /* ── Spacing scale ── */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;

  /* ── Radius scale ── */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* ── Shadow & depth (low, warm-tinted) ── */
  --shadow: 0 2px 10px rgba(60,45,25,0.07);
  --shadow-lg: 0 12px 40px rgba(40,30,15,0.18);

  /* ── Interaction ── */
  --tap-min: 48px;
  --tap-lg: 56px;
  --rail: 4px;
  --rail-lg: 6px;
  --focus-ring: 0 0 0 3px rgba(31,90,82,0.32);
  --transition: .15s ease;
}

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

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; }              /* base bumped for older/low-vision readers */

body {
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  line-height: var(--line-body);
  -webkit-font-smoothing: antialiased;
}

/* Monospace "data" face — IDs, phone numbers, timestamps, reference #s */
.mono { font-family: var(--font-mono); letter-spacing: -0.01em; }

/* Uppercase tracked overline label */
.overline {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Universal visible focus for keyboard / tremor users */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* ── CIVIC RIBBON BANNER ── */
.county-banner {
  background: var(--primary-dark);
  color: #fbf6ea;
  text-align: center;
  padding: .45rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ── HEADER ── */
.site-header {
  background: var(--primary);
  color: #fffdf8;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(20,40,35,0.22);
  position: sticky; top: 0; z-index: 100;
}
.header-logo { display: flex; align-items: center; gap: .8rem; }
.header-logo .logo-mark {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.header-logo .site-name { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.header-logo .site-sub { font-size: .8rem; opacity: .9; }
.header-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
#current-role-display { color: rgba(255,255,255,.9); font-size: .9rem; font-weight: 600; }

/* Switch Role — a real bordered button, not a faint link */
.btn-switch-role {
  background: transparent;
  border: 2px solid rgba(255,255,255,.55);
  color: #fffdf8;
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  min-height: 44px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-switch-role:hover { background: rgba(255,255,255,.15); border-color: #fff; }

/* ── PERSISTENT TRI-STATE CONNECTION CHIP ── */
.conn-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  background: #fffdf8; color: var(--text);
  border: 1px solid rgba(0,0,0,.08);
  padding: .35rem .75rem;
  border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: 700;
  min-height: 36px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.conn-chip .conn-ind {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--conn-online); flex-shrink: 0;
}
.conn-chip.online  .conn-ind { background: var(--conn-online); }
.conn-chip.syncing .conn-ind { background: var(--conn-syncing); animation: pulse 1.1s ease-in-out infinite; }
.conn-chip.offline .conn-ind { background: var(--conn-offline); border-radius: 2px; } /* square = offline */
.conn-chip.online  .conn-label { color: var(--conn-online); }
.conn-chip.syncing .conn-label { color: var(--conn-syncing); }
.conn-chip.offline .conn-label { color: var(--conn-offline); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── NAV TABS ── */
.nav-tabs {
  background: var(--primary-dark);
  display: flex;
  padding: 0 1rem;
  overflow-x: auto;
}
.nav-tab {
  color: rgba(255,253,248,.78);
  padding: .85rem 1.2rem;
  min-height: 48px;
  cursor: pointer;
  border: none;
  background: none;
  font-size: .95rem;
  font-weight: 700;
  border-bottom: 4px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}
.nav-tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-tab.active {
  color: #fff;
  border-bottom-color: var(--secondary);
  background: rgba(255,255,255,.10);
}
.nav-tab.tab-offline { color: var(--accent); }
.nav-tab.tab-offline.active { color: #fff; }

/* ── LAYOUT ── */
.page { display: none; padding: 1.5rem; max-width: 1140px; margin: 0 auto; }
.page.active { display: block; }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  position: relative;
  padding-bottom: .55rem;
}
.card-title::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 2.5rem; height: 3px;
  background: var(--secondary);
  border-radius: 2px;
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fffdf8;
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), var(--shadow);
}
.hero h1 { font-size: 2rem; margin-bottom: .6rem; line-height: var(--line-tight); }
.hero p { opacity: .95; max-width: 620px; margin: 0 auto 1.4rem; font-size: 1.05rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .7rem 1.4rem;
  min-height: var(--tap-min);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--secondary); color: #fff; }       /* the ONE action */
.btn-primary:hover { background: #a8492e; }
.btn-blue { background: var(--primary); color: #fffdf8; }          /* send reply etc */
.btn-blue:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #266a3e; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8c3129; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fffdf8; }
.btn-outline.on-dark { border-color: rgba(255,255,255,.7); color: #fffdf8; }
.btn-outline.on-dark:hover { background: rgba(255,255,255,.16); border-color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: .9rem; min-height: 44px; }
.btn-lg { padding: .9rem 2rem; font-size: 1.1rem; min-height: var(--tap-lg); }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: .95rem; color: var(--text); }
.form-label .req { color: var(--secondary); font-weight: 700; }
.form-control {
  width: 100%;
  padding: .7rem 1rem;
  min-height: var(--tap-min);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--surface);
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
textarea.form-control { min-height: 120px; resize: vertical; line-height: 1.5; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .9rem; color: var(--text-muted); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── TICKET LIST ── */
.ticket-list { display: flex; flex-direction: column; gap: .75rem; }
.ticket-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: var(--rail) solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.ticket-item:hover { border-color: var(--primary); border-left-color: var(--primary); box-shadow: var(--shadow); }
/* Colored LEFT RAIL by priority — dominant scannable cue */
.ticket-item.pri-low    { border-left-color: var(--pri-low); }
.ticket-item.pri-medium { border-left-color: var(--pri-medium); }
.ticket-item.pri-high   { border-left-color: var(--pri-high); }
.ticket-item.pri-urgent { border-left-color: var(--pri-urgent); }
.ticket-item.selected {
  border-color: var(--primary);
  border-left-width: 6px;
  background: #eef5f1;        /* faint sage-cream fill */
}
.ticket-body { flex: 1; min-width: 0; }
.ticket-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.ticket-id { font-weight: 700; color: var(--primary); font-size: .9rem; }
.ticket-title { font-weight: 600; font-size: 1rem; }
.ticket-preview { color: var(--text-muted); font-size: .9rem; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-time { font-size: .85rem; color: var(--text-muted); }

/* secondary priority dot (rail is primary cue) — color comes from the
   parent .ticket-item.pri-* so the dot class never tints the whole card */
.priority-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: .4rem; background: var(--border); }
.ticket-item.pri-low    .priority-dot { background: var(--pri-low); }
.ticket-item.pri-medium .priority-dot { background: var(--pri-medium); }
.ticket-item.pri-high   .priority-dot { background: var(--pri-high); }
.ticket-item.pri-urgent .priority-dot { background: var(--pri-urgent); }

/* ── SLA TIMER CHIP ── */
.sla-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .8rem; font-weight: 700;
  padding: .15rem .55rem;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.sla-ok     { color: var(--success); background: #e2efe2; }
.sla-risk   { color: #8a5a14;        background: #f7ead2; }
.sla-breach { color: var(--danger);  background: #f4ddd6; }
.sla-met    { color: var(--success); background: #e2efe2; }
.sla-missed { color: var(--danger);  background: #f4ddd6; }

/* ── NOTIFICATION BELL ── */
.icon-btn {
  position: relative;
  background: transparent;
  border: 2px solid rgba(255,255,255,.45);
  color: #fffdf8;
  border-radius: var(--radius-sm);
  min-width: 44px; min-height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,.15); border-color: #fff; }
.notif-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--secondary); color: #fff;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--primary);
}
.notif-item {
  display: flex; gap: .75rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.notif-item.unread { background: #f4f8f5; margin: 0 -.5rem; padding: .85rem .5rem; border-radius: var(--radius-sm); }
.notif-ch {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 1.1rem;
}
.notif-ch.email { background: var(--tint-cat-bg); }
.notif-ch.sms   { background: var(--tint-l1-bg); }

/* Sync pip — per-ticket connectivity */
.sync-pip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .8rem; font-weight: 700; color: var(--text-muted);
}
.sync-pip .pip { width: 9px; height: 9px; flex-shrink: 0; }
.sync-pip.saved .pip { background: var(--conn-offline); border-radius: 2px; }   /* square = saved offline */
.sync-pip.pending .pip { background: var(--conn-syncing); border-radius: 50%; }  /* dot = pending sync */

/* ── BADGES (never color alone: color + icon + word) ── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .22rem .65rem;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.4;
}
.badge-open     { background: var(--tint-open-bg);     color: var(--tint-open-text); }
.badge-l1       { background: var(--tint-l1-bg);       color: var(--tint-l1-text); }
.badge-l2       { background: var(--tint-l2-bg);       color: var(--tint-l2-text); }
.badge-resolved { background: var(--tint-resolved-bg); color: var(--tint-resolved-text); }
.badge-pending  { background: var(--tint-pending-bg);  color: var(--tint-pending-text); }
.badge-urgent   { background: var(--tint-urgent-bg);   color: var(--tint-urgent-text); }
.badge-offline  { background: var(--tint-offline-bg);  color: var(--tint-offline-text); }
.badge-cat      { background: var(--tint-cat-bg);      color: var(--tint-cat-text); }

/* ── DETAIL PANEL ── */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
}
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .9rem; margin-bottom: 1rem; }
.detail-header h2 { font-size: 1.2rem; font-weight: 800; line-height: var(--line-tight); }
.detail-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: .9rem; font-size: .92rem; }
.field-grid .fld-val { margin-top: .15rem; }

.convo { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; }
.msg {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  max-width: 85%;
  line-height: 1.5;
}
.msg-user   { background: #eaf2ee; align-self: flex-start; border-left: 3px solid var(--conn-offline); }
.msg-agent  { background: #e6efe9; align-self: flex-end; border-left: 3px solid var(--primary); }
.msg-system { background: var(--surface-alt); align-self: center; font-size: .88rem; color: var(--text-muted); text-align: center; max-width: 100%; font-style: italic; }
.msg-sender { font-size: .82rem; font-weight: 800; margin-bottom: .2rem; }
.msg-meta { font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card.rail-open    { border-top: var(--rail-lg) solid var(--pri-medium); }
.stat-card.rail-urgent  { border-top: var(--rail-lg) solid var(--danger); }
.stat-card.rail-ok      { border-top: var(--rail-lg) solid var(--success); }
.stat-card.rail-primary { border-top: var(--rail-lg) solid var(--primary); }
.stat-number { font-size: 2.25rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { margin-top: .35rem; }

/* ── KB ── */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.kb-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
}
.kb-card:hover, .kb-card:focus-visible { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); background: #f4f8f5; }
.kb-icon { font-size: 2.1rem; margin-bottom: .5rem; }
.kb-title { font-weight: 700; margin-bottom: .25rem; font-size: 1.05rem; color: var(--text); }
.kb-desc { font-size: .9rem; color: var(--text-muted); }
.kb-article-title { font-weight: 700; font-size: 1rem; cursor: pointer; color: var(--primary); padding: .25rem 0; }
.kb-article-body { margin-top: .5rem; font-size: 1rem; line-height: 1.7; white-space: pre-line; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,20,10,.55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; }
.modal-title { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.btn-close { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-muted); line-height: 1; min-height: 44px; min-width: 44px; border-radius: var(--radius-sm); }
.btn-close:hover { background: var(--surface-alt); }
.modal-footer { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }

/* ── SEARCH / FILTERS ── */
.search-bar { display: flex; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.search-bar .form-control { flex: 1; min-width: 220px; }
.filter-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filter-chip {
  padding: .45rem .9rem;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: .9rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  transition: var(--transition);
}
.filter-chip:hover { border-color: var(--primary); }
.filter-chip.active { background: var(--primary); color: #fffdf8; border-color: var(--primary); }

/* ── ALERTS (with left rail) ── */
.alert {
  padding: .9rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .95rem;
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  border-left: var(--rail) solid;
  line-height: 1.5;
}
.alert-info    { background: #e8f1ec; color: #1f4a40; border-left-color: var(--primary); }
.alert-success { background: #e2efe2; color: #285f33; border-left-color: var(--success); }
.alert-warning { background: #f7ead2; color: #6b4a14; border-left-color: var(--accent); }
.alert-danger  { background: #f4ddd6; color: #7e271f; border-left-color: var(--danger); }

/* ── SPLIT LAYOUT ── */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 768px) {
  .split { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .site-header { min-height: auto; padding: .75rem 1rem; }
  .header-actions { width: 100%; justify-content: space-between; }
  .modal-footer .btn, .detail-header .btn { flex: 1; }
}

/* ── STEPS ── */
.steps { display: flex; gap: 0; margin-bottom: 1.5rem; }
.step {
  flex: 1; text-align: center; padding: .8rem .5rem;
  background: var(--surface-alt); font-size: .9rem; font-weight: 700;
  color: var(--text-muted);
}
.step.active { background: var(--primary); color: #fffdf8; box-shadow: inset 0 -4px 0 var(--secondary); }
.step.done { background: var(--success); color: #fff; }
.step:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.step:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── TIMELINE ── */
.timeline { padding-left: 1.5rem; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding-bottom: 1rem; padding-left: 1rem; }
.tl-item::before {
  content: ''; position: absolute; left: -1.45rem; top: .35rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary);
}
.tl-time { font-size: .85rem; color: var(--text-muted); }
.tl-text { font-size: .95rem; }

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th { text-align: left; padding: .55rem .75rem; border-bottom: 2px solid var(--border); background: var(--surface-alt); }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.table-scroll { overflow-x: auto; }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 1.5rem; left: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--primary-dark);
  color: #fffdf8;
  padding: .8rem 1.3rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideIn .3s ease;
  max-width: 340px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: translateX(0); } }

/* ── ROLE SELECTOR ── */
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.role-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.role-card:hover, .role-card.selected, .role-card:focus-visible { border-color: var(--primary); background: #f4f8f5; transform: translateY(-2px); }
.role-icon { font-size: 2.6rem; margin-bottom: .75rem; }
.role-name { font-weight: 800; font-size: 1.05rem; color: var(--primary); }
.role-desc { font-size: .9rem; color: var(--text-muted); margin-top: .3rem; }

/* ── MISC ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.divider { border: none; border-top: 1.5px solid var(--border); margin: 1.25rem 0; }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.flex { display: flex; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
a { color: var(--primary); }

/* ═══ PRICING ═══ */
.price-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
}
.price-card.featured {
  border-color: var(--secondary);
  border-width: 2.5px;
  box-shadow: 0 6px 24px rgba(194,90,58,.18);
}
.price-flag {
  position: absolute; top: -12px; right: 1rem;
  background: var(--secondary); color: #fff;
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: .25rem .7rem; border-radius: var(--radius-pill);
}
.price-name { font-size: 1.2rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.price-amt { font-size: 2.1rem; font-weight: 800; color: var(--secondary); margin-top: .4rem; line-height: 1.1; }
.price-feats { list-style: none; margin: 1rem 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.price-feats li { font-size: .92rem; padding-left: 1.5rem; position: relative; }
.price-feats li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 800; }

/* ═══ AI HELPER ═══ */
.btn-ai {
  background: linear-gradient(135deg, var(--primary) 0%, #2b7d72 100%);
  color: #fffdf8;
}
.btn-ai:hover { filter: brightness(1.08); }

.ai-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ai-chip {
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: .5rem 1rem;
  min-height: 44px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.ai-chip::before { content: '💬 '; }
.ai-chip:hover { border-color: var(--primary); background: #f4f8f5; }

/* Floating action button */
.ai-fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 800;
  display: flex; align-items: center; gap: .6rem;
  background: linear-gradient(135deg, var(--secondary) 0%, #d4733f 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: .85rem 1.4rem;
  min-height: 56px;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.ai-fab:hover { transform: translateY(-2px); filter: brightness(1.05); }
.ai-fab-icon { font-size: 1.4rem; }

/* Chat panel */
.ai-panel {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1100;
  width: 380px; max-width: calc(100vw - 2rem);
  height: 560px; max-height: calc(100vh - 3rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.ai-panel.show { display: flex; }
.ai-head {
  background: var(--primary);
  color: #fffdf8;
  padding: .85rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.ai-head-title { display: flex; align-items: center; gap: .6rem; }
.ai-head-title strong { font-size: 1.05rem; }
.ai-head-sub { font-size: .78rem; opacity: .9; }
.ai-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.ai-head .btn-close { color: #fffdf8; }
.ai-disclaimer {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: .78rem;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}
.ai-messages {
  flex: 1; overflow-y: auto;
  padding: 1rem; display: flex; flex-direction: column; gap: .7rem;
  background: var(--bg);
}
.ai-msg {
  padding: .7rem .9rem;
  border-radius: 14px;
  font-size: .95rem;
  line-height: 1.5;
  max-width: 90%;
}
.ai-msg.user { align-self: flex-end; background: var(--primary); color: #fffdf8; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg-actions { margin-top: .6rem; }
.ai-mini {
  border: 1.5px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: var(--radius-pill);
  padding: .4rem .8rem;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}
.ai-mini.solid { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.ai-mini:hover { filter: brightness(1.05); }
.ai-input-row {
  display: flex; gap: .5rem;
  padding: .75rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ai-input-row .form-control { flex: 1; min-height: 46px; }
.ai-input-row .btn { min-height: 46px; }

/* Voice + accessibility controls */
.ai-toggle {
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.4);
  color: #fffdf8;
  border-radius: var(--radius-pill);
  min-width: 40px; min-height: 40px;
  font-size: 1.05rem; cursor: pointer;
  transition: var(--transition);
}
.ai-toggle:hover { background: rgba(255,255,255,.28); }
.ai-toggle.active { background: var(--secondary); border-color: var(--secondary); }
.ai-mic {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--primary);
  border-radius: var(--radius-sm);
  min-width: 46px; min-height: 46px;
  font-size: 1.15rem; cursor: pointer; flex-shrink: 0;
  transition: var(--transition);
}
.ai-mic:hover { border-color: var(--primary); }
.ai-mic.listening { background: var(--secondary); color: #fff; border-color: var(--secondary); animation: pulse 1.1s ease-in-out infinite; }
.ai-read {
  background: transparent; border: none; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: .25rem;
  border-radius: 6px; opacity: .65; transition: var(--transition);
}
.ai-read:hover { opacity: 1; background: var(--surface-alt); }
.ai-msg-foot { margin-top: .35rem; text-align: right; }
.ai-note { margin-top: .5rem; font-size: .82rem; color: var(--warning); font-weight: 600; }
.ai-live-tag { font-size: .72rem; font-weight: 800; color: var(--success); letter-spacing: .03em; }

/* Typing indicator */
.ai-msg.typing { display: inline-flex; gap: .3rem; align-items: center; }
.ai-msg.typing .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); animation: typing 1.2s infinite ease-in-out; }
.ai-msg.typing .dot:nth-child(2) { animation-delay: .15s; }
.ai-msg.typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 480px) {
  .ai-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 80vh; border-radius: var(--radius) var(--radius) 0 0; }
  .ai-fab-text { display: none; }
  .ai-fab { padding: 0; width: 56px; justify-content: center; }
}

/* ── AI SETUP INTAKE (screen) ── */
.ai-intake-box { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .45rem; margin-top: .4rem; }
.chk { display: flex; align-items: center; gap: .5rem; font-size: .92rem; padding: .5rem .6rem; min-height: 44px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.chk:hover { border-color: var(--primary); }
.chk input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

/* ── PRINTABLE FLYER (hidden on screen) ── */
.print-flyer { display: none; }
.flyer { color: #111; font-family: var(--font-base); max-width: 7.6in; margin: 0 auto; padding: .15in; }
.flyer .fl-head { display: flex; align-items: center; gap: .22in; border-bottom: 3px solid #1f5a52; padding-bottom: .1in; margin-bottom: .14in; }
.fl-logo { width: .7in; height: .7in; border-radius: 50%; background: #c25a3a; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20pt; flex-shrink: 0; }
.flyer h1 { font-size: 22pt; margin: 0; color: #1f5a52; }
.flyer .fl-head p { margin: .04in 0 0; font-size: 11pt; color: #444; }
.flyer h2 { font-size: 17pt; color: #c25a3a; margin: .08in 0 .05in; }
.flyer h3 { font-size: 12pt; color: #1f5a52; margin: .14in 0 .05in; border-bottom: 1px solid #ccc; padding-bottom: 2pt; }
.fl-lead { font-size: 11pt; line-height: 1.42; margin: 0; }
.fl-cols { list-style: none; padding: 0; margin: .05in 0; columns: 2; font-size: 10.5pt; }
.fl-cols li { margin: .03in 0; break-inside: avoid; }
.fl-table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.fl-table td { border-bottom: 1px solid #ddd; padding: .07in .04in; vertical-align: top; }
.fl-blurb { color: #555; font-size: 9.5pt; }
.fl-price { text-align: right; white-space: nowrap; font-weight: 800; color: #c25a3a; }
.fl-unit { font-weight: 400; color: #666; font-size: 8.5pt; }
.fl-free { background: #f3efe6; border-left: 4px solid #2f7d4a; padding: .09in; font-size: 10.5pt; margin: .12in 0; }
.fl-cta { display: flex; gap: .18in; margin: .12in 0 .05in; }
.fl-cta > div { flex: 1; border: 2px solid #1f5a52; border-radius: 8px; padding: .1in; text-align: center; }
.fl-cta span { display: block; font-size: 9pt; text-transform: uppercase; letter-spacing: .04em; color: #666; }
.fl-cta strong { font-size: 12.5pt; }
.fl-cta .fl-call strong { font-size: 17pt; color: #1f5a52; }
.fl-qr { display: flex; align-items: center; gap: .18in; margin: .1in 0 .05in; padding: .08in; border: 1px solid #ddd; border-radius: 6px; }
.fl-qr img { width: 1.05in; height: 1.05in; flex-shrink: 0; image-rendering: pixelated; }
.fl-qr-cap { font-size: 9pt; text-transform: uppercase; letter-spacing: .04em; color: #666; }
.fl-area { text-align: center; font-size: 10pt; color: #444; margin: .1in 0 0; }

/* ═══════════════════════════════════════════════════════════
   DARK "MISSION CONTROL" THEME — modern, high-contrast, SpaceX vibe
   Re-skins the whole app via token override + targeted fixes.
   (Print stays black-on-white — see the @media print block below.)
   ═══════════════════════════════════════════════════════════ */
:root {
  --primary: #6ea8ff;        /* light accent — links, titles, focus */
  --primary-dark: #2f6bff;   /* electric blue — solid actions */
  --secondary: #2f6bff;      /* primary CTA / logo / active underline */
  --accent: #34d0ff;         /* cyan highlight */
  --success: #2ec28a;
  --warning: #f0b429;
  --danger:  #ff5c6c;
  --bg: #05070d;
  --card: #0e131c; --surface: #0e131c; --surface-alt: #161d29;
  --text: #e8edf6; --text-light: #94a1b6; --text-muted: #94a1b6;
  --border: rgba(255,255,255,0.10); --border-strong: rgba(255,255,255,0.20);
  --conn-online: #2ec28a; --conn-syncing: #f0b429; --conn-offline: #94a1b6;
  --tint-open-bg: rgba(110,168,255,.14);   --tint-open-text: #a9c8ff;
  --tint-l1-bg: rgba(240,180,41,.15);       --tint-l1-text: #f3cd6e;
  --tint-l2-bg: rgba(124,92,255,.18);       --tint-l2-text: #bcacff;
  --tint-resolved-bg: rgba(46,194,138,.15); --tint-resolved-text: #69e3af;
  --tint-pending-bg: rgba(148,161,182,.16); --tint-pending-text: #bcc6d6;
  --tint-urgent-bg: rgba(255,92,108,.16);   --tint-urgent-text: #ff97a2;
  --tint-offline-bg: rgba(255,255,255,.07); --tint-offline-text: #aeb8c8;
  --tint-cat-bg: rgba(52,208,255,.13);      --tint-cat-text: #86dcff;
  --pri-low: #2ec28a; --pri-medium: #f0b429; --pri-high: #ff7a47; --pri-urgent: #ff5c6c;
  --shadow: 0 1px 0 rgba(255,255,255,.04), 0 10px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  --focus-ring: 0 0 0 3px rgba(110,168,255,.35);
}

body {
  background:
    radial-gradient(1100px 560px at 75% -8%, rgba(47,107,255,.16), transparent 60%),
    radial-gradient(900px 480px at 8% 0%, rgba(52,208,255,.07), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
}

/* Chrome → near-black (not accent-blue) */
.county-banner { background:#070a12; color:var(--text-muted); border-bottom:1px solid var(--border); text-transform:uppercase; letter-spacing:.09em; font-size:.76rem; }
.site-header { background:rgba(8,11,18,.9); backdrop-filter:saturate(140%) blur(8px); border-bottom:1px solid var(--border); box-shadow:none; color:var(--text); }
.header-logo .site-name { text-transform:uppercase; letter-spacing:.04em; }
.header-logo .logo-mark { background:linear-gradient(135deg,#2f6bff,#34d0ff); box-shadow:0 0 18px rgba(47,107,255,.5); }
.nav-tabs { background:rgba(8,11,18,.9); border-bottom:1px solid var(--border); }
.nav-tab { color:var(--text-muted); text-transform:uppercase; letter-spacing:.08em; font-size:.78rem; }
.nav-tab:hover { color:var(--text); background:rgba(255,255,255,.04); }
.nav-tab.active { color:var(--text); background:transparent; border-bottom-color:var(--secondary); }
.nav-tab.tab-offline { color:var(--accent); }
.conn-chip { background:rgba(255,255,255,.06); border:1px solid var(--border); color:var(--text); box-shadow:none; }

/* Hero → space panel */
.hero {
  background:
    radial-gradient(700px 300px at 82% -45%, rgba(52,208,255,.20), transparent 60%),
    linear-gradient(160deg,#0c1320,#070a12);
  border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), var(--shadow);
}
.hero h1 { text-transform:uppercase; letter-spacing:.03em; }

/* Buttons → uppercase, glowy primary */
.btn { text-transform:uppercase; letter-spacing:.05em; }
.btn-primary { background:var(--secondary); box-shadow:0 0 0 1px rgba(255,255,255,.06), 0 6px 22px rgba(47,107,255,.4); }
.btn-primary:hover { background:#4a82ff; }
.btn-blue { background:var(--primary-dark); color:#fff; }
.btn-blue:hover { background:#4a82ff; }
.btn-outline { border-color:var(--border-strong); color:var(--text); }
.btn-outline:hover { background:rgba(255,255,255,.08); color:#fff; border-color:var(--text); }

/* Cards / panels */
.card-title { color:var(--text); letter-spacing:.02em; }
.stat-number { color:var(--primary); }
.kb-card:hover, .kb-card:focus-visible { background:rgba(255,255,255,.04); border-color:var(--primary); }
.role-card:hover, .role-card.selected, .role-card:focus-visible { background:rgba(255,255,255,.04); }

/* Forms */
.form-control { background:var(--surface-alt); color:var(--text); border-color:var(--border-strong); }
.form-control::placeholder { color:#6b7689; }

/* Tickets / messages */
.ticket-item:hover { background:rgba(255,255,255,.03); }
.ticket-item.selected { background:rgba(110,168,255,.10); }
.msg-user { background:rgba(255,255,255,.05); border-left-color:var(--conn-offline); }
.msg-agent { background:rgba(47,107,255,.12); border-left-color:var(--primary); }
.msg-system { background:var(--surface-alt); }

/* Alerts (dark translucent) */
.alert-info { background:rgba(110,168,255,.10); color:#bcd2ff; }
.alert-success { background:rgba(46,194,138,.12); color:#8fe9c2; }
.alert-warning { background:rgba(240,180,41,.12); color:#f3d486; }
.alert-danger { background:rgba(255,92,108,.12); color:#ffb3bb; }

/* SLA chips */
.sla-ok { color:#69e3af; background:rgba(46,194,138,.14); }
.sla-risk { color:#f3cf7c; background:rgba(240,180,41,.14); }
.sla-breach { color:#ff97a2; background:rgba(255,92,108,.16); }
.sla-met { color:#69e3af; background:rgba(46,194,138,.14); }
.sla-missed { color:#ff97a2; background:rgba(255,92,108,.16); }

/* Chips / filters / table / modal / toast */
.filter-chip { background:var(--surface-alt); color:var(--text); }
.filter-chip.active { background:var(--secondary); color:#fff; border-color:var(--secondary); }
.data-table th { background:var(--surface-alt); }
.modal { border:1px solid var(--border); }
.toast { background:#0e131c; border:1px solid var(--border); }

/* AI Helper */
.ai-head { background:linear-gradient(135deg,#0c1320,#0a0e16); border-bottom:1px solid var(--border); }
.ai-fab { background:linear-gradient(135deg,#2f6bff,#34d0ff); box-shadow:0 8px 30px rgba(47,107,255,.45); }
.ai-msg.user { background:var(--secondary); }
.ai-msg.bot { background:var(--surface); border:1px solid var(--border); }

/* "How our help works" tier card */
.tier-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:.75rem; }
.tier-step { display:flex; gap:.7rem; align-items:flex-start; padding:.9rem; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-alt); }
.tier-num { width:34px; height:34px; flex-shrink:0; border-radius:8px; display:flex; align-items:center; justify-content:center; font-weight:800; color:#fff; background:linear-gradient(135deg,#2f6bff,#34d0ff); }
.tier-sub { font-size:.85rem; color:var(--text-muted); margin-top:.15rem; }
.tier-note { margin-top:.85rem; font-size:.9rem; color:var(--text-muted); }

/* Welcome landing / trust / reviews */
.welcome-hero { text-align: center; }
.welcome-badge { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--border); border-radius: 999px; padding: .3rem .9rem; margin-bottom: .8rem; }
.welcome-secondary { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .8rem; }
.trust-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.trust-list li { padding-left: 1.6rem; position: relative; }
.trust-list li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.review { border-left: 3px solid var(--secondary); background: var(--surface-alt); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .75rem 1rem; margin-bottom: .6rem; }
.review-stars { color: #f0b429; letter-spacing: .12em; }
.review p { margin: .25rem 0; font-style: italic; }
.review-by { font-size: .85rem; color: var(--text-muted); font-weight: 700; }

/* Section headings uppercase */
#page-agent > .flex h2, #page-admin > .flex h2 { text-transform:uppercase; letter-spacing:.04em; }

/* ── PRINT ── */
.print-form { display: none; }
@media print {
  .no-print, .site-header, .nav-tabs, .county-banner, .modal-overlay, .toast-container, .ai-fab, .ai-panel { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .card-title::after { display: none; }
  .mono { font-family: var(--font-mono); }

  /* Default print = the offline request form */
  body:not(.printing-flyer) .page { display: none !important; }
  body:not(.printing-flyer) #page-offline { display: block !important; }
  body:not(.printing-flyer) .card { box-shadow: none; border: 1px solid #000; }
  body:not(.printing-flyer) .print-form, body:not(.printing-flyer) .print-only { display: block !important; }

  /* Flyer print mode */
  body.printing-flyer .page { display: none !important; }
  body.printing-flyer .print-flyer { display: block !important; }
}

/* ════════ SITE FOOTER (public trust + policies) ════════ */
.site-footer {
  margin-top: 2.5rem;
  padding: 1.75rem 1rem 2rem;
  border-top: 1px solid var(--border, rgba(255,255,255,.1));
  background: rgba(255,255,255,.02);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  text-align: center;
}
.footer-brand { display: flex; flex-direction: column; gap: .15rem; }
.footer-brand strong { font-size: 1rem; }
.footer-brand span { color: var(--text-muted, #9aa4b2); font-size: .85rem; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem 1.1rem;
}
.footer-links a {
  color: var(--secondary, #2f6bff);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
}
.footer-links a:hover { text-decoration: underline; }
.footer-legal { color: var(--text-muted, #9aa4b2); font-size: .78rem; line-height: 1.5; }
@media print { .site-footer { display: none !important; } }

/* ════════ GIFT CERTIFICATE (print only) ════════ */
.print-gift { display: none; }
.gift-cert { display: none; }
@media screen {
  body.printing-gift .page,
  body.printing-gift .site-header,
  body.printing-gift .nav-tabs,
  body.printing-gift .county-banner,
  body.printing-gift .site-footer,
  body.printing-gift .ai-fab { display: none !important; }
  body.printing-gift .print-gift,
  body.printing-gift .gift-cert { display: block !important; }
}
@media print {
  body.printing-gift .print-gift,
  body.printing-gift .gift-cert { display: block !important; }
}
.gift-cert { color: #111; background: #fff; padding: .25in; }
.gc-border {
  border: 3px double #2f6bff;
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 7.2in;
  margin: 0 auto;
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
}
.gc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.gc-logo {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; color: #fff;
  background: linear-gradient(135deg, #2f6bff, #34d0ff);
}
.gc-head h1 { font-size: 1.25rem; margin: 0; color: #0b1f4d; }
.gc-head p { margin: 0; font-size: .82rem; color: #555; }
.gc-title { text-align: center; font-size: 1.9rem; font-weight: 800; color: #2f6bff; margin: 10px 0 18px; letter-spacing: .5px; }
.gc-grid { display: flex; gap: 24px; }
.gc-grid .gc-row { flex: 1; }
.gc-row { margin: 12px 0; }
.gc-row > span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #2f6bff; font-weight: 700; }
.gc-line { border-bottom: 1.5px solid #2f6bff; min-height: 26px; padding: 4px 2px 0; font-size: 1.05rem; }
.gc-redeem { margin-top: 18px; font-size: .9rem; line-height: 1.5; background: #eef3ff; border-radius: 10px; padding: 12px 14px; }
.gc-foot { margin-top: 14px; text-align: center; font-size: .76rem; color: #555; }

/* Prepay (multi-month membership) options on plan cards */
.prepay { margin-top: .6rem; font-size: .9rem; text-align: left; }
.prepay summary { cursor: pointer; color: var(--secondary, #2f6bff); font-weight: 700; list-style: none; }
.prepay summary::-webkit-details-marker { display: none; }
.prepay summary::before { content: "▸ "; }
.prepay[open] summary::before { content: "▾ "; }
.prepay-opts { display: flex; flex-direction: column; gap: .4rem; margin-top: .55rem; }
.prepay-opts .btn-sm { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.save { color: #28c76f; font-weight: 800; }

/* ════════ SELF-SERVICE BOOKING (pick your own day & time) ════════ */
.sb-days { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.sb-day {
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-alt); color: var(--text); cursor: pointer;
  font-size: .9rem; font-weight: 600; line-height: 1.2; min-width: 62px; text-align: center;
  transition: border-color .15s, background .15s, transform .05s;
}
.sb-day:hover { border-color: var(--accent); }
.sb-day:active { transform: translateY(1px); }
.sb-day.sel { background: var(--secondary); color: #fff; border-color: var(--secondary); box-shadow: 0 0 0 1px var(--secondary); }
.sb-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: .5rem; margin-top: .5rem; }
.sb-slot {
  padding: .7rem .4rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-alt); color: var(--text); cursor: pointer;
  font-size: .92rem; font-weight: 600; transition: border-color .15s, background .15s, transform .05s;
}
.sb-slot:hover:not(:disabled) { border-color: var(--accent); background: rgba(255,255,255,.04); }
.sb-slot:active:not(:disabled) { transform: translateY(1px); }
.sb-slot:disabled { opacity: .32; cursor: not-allowed; text-decoration: line-through; }
.sb-hint { color: var(--text-muted); padding: .45rem 0; }

/* "Everything we help with" full-service grid */
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: .6rem; margin-top: .8rem; }
.help-cat { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); }
.help-cat > span { font-size: 1.3rem; line-height: 1.1; flex: 0 0 auto; }
.help-cat strong { display: block; font-size: .95rem; }
.help-cat small { color: var(--text-muted); font-size: .82rem; line-height: 1.3; display: block; margin-top: .12rem; }

/* Welcome hero photo */
.welcome-photo { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; margin-bottom: 1rem; border: 1px solid var(--border); box-shadow: var(--shadow); }

/* FAQ accordion */
.faq { border: 1px solid var(--border); border-radius: 10px; padding: .15rem .85rem; margin-bottom: .5rem; background: var(--surface-alt); }
.faq summary { cursor: pointer; font-weight: 600; padding: .65rem 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋ "; color: var(--primary); font-weight: 800; }
.faq[open] summary::before { content: "– "; }
.faq > div { padding: 0 0 .75rem; color: var(--text-muted); line-height: 1.5; }

/* Header "Call" button — the prominent action for our senior audience */
.btn-header-call { display: inline-flex; align-items: center; gap: .35rem; background: var(--success, #2ec28a); color: #04130d; font-weight: 800; text-decoration: none; padding: .5rem .8rem; border-radius: 10px; font-size: .95rem; white-space: nowrap; box-shadow: 0 4px 14px rgba(46,194,138,.32); }
.btn-header-call:hover { filter: brightness(1.08); }
/* Hide internal role controls on the public customer site */
body.public-site .btn-switch-role, body.public-site #current-role-display { display: none !important; }

/* Sticky mobile call/book bar (phones only) */
.mobile-cta-bar { display: none; }
@media (max-width: 640px) {
  .mobile-cta-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; gap: 2px; box-shadow: 0 -4px 18px rgba(0,0,0,.45); }
  .mobile-cta-bar > * { flex: 1; border: 0; padding: .95rem .5rem; font-size: 1.05rem; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
  .mcb-call { background: #2ec28a; color: #04130d; }
  .mcb-book { background: var(--secondary, #2f6bff); color: #fff; }
  body.public-site { padding-bottom: 66px; }
  body.public-site .ai-fab { bottom: 76px; }
  .btn-header-call .hd-call-num { display: none; }
  .btn-header-call { padding: .45rem .55rem; font-size: 1.05rem; }
}
