/* RepConnect — shared styles. Mirrors preview.html palette so subpages
   feel like the same product as the activation form. */

/* ─── Top nav strip — STATIC, in normal flow. Solid background (no blur,
   no translucency) so it visually reads as a real header row, not a
   floating overlay. Static HTML in each page so it always renders. ─── */
.rc-nav {
  position: static;
  width: 100%;
  height: calc(40px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  padding-left: max(env(safe-area-inset-left), 12px);
  padding-right: max(env(safe-area-inset-right), 12px);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px;
  background: #ffffff;
  border-bottom: 1px solid #e6ebf1;
  color: #0a2540;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 13px; line-height: 1;
  flex-shrink: 0;
}
.rc-pill {
  background: #ffffff; color: #0a2540;
  padding: 6px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid #e6ebf1;
  text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}
.rc-pill:hover { background: #fafbfc; border-color: #d3dbe5; text-decoration: none; }
.rc-pill.primary { color: #0061AA; border-color: #c9d8ec; }
.rc-pill.primary:hover { background: #EAF2FA; border-color: #0061AA; }
.rc-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: #EAF2FA center/cover no-repeat;
  display: inline-flex; align-items: center; justify-content: center;
  color: #0061AA; font-size: 10px; font-weight: 700;
  flex-shrink: 0;
  border: 1px solid #d3dbe5;
}
@media (max-width: 380px) {
  .rc-pill { padding: 6px 9px; font-size: 12px; }
  /* Three-pill nav (Profile · Opt-In · Orders) is the new norm post the
     TCPA consent build (2026-05-14). On iPhone SE / 320px Profile pill
     can run long with display_name — let the middle/tail pills hold their
     intrinsic size and let Profile elide. */
  .rc-pill { gap: 4px; }
  .rc-pill > span { overflow: hidden; text-overflow: ellipsis; max-width: 9ch; }
}

:root {
  /* ─── Lumen Glass — calm rep-tooling palette (ref commission 012).
     ADT Blue #0061AA is the ONLY saturated hue; Safety Blue #000782 is the
     deep header ink; status hues (teal-green / brass-ochre / brick-red) are
     reserved and muted. Cool-slate neutrals throughout. The "lit-glass"
     feel comes from a flat tinted fill + hairline + an inner top edge-light
     (--edge-light) — NOT per-element backdrop blur on repeating items. ─── */
  --bg: #f4f7fb;
  --bg-subtle: #fafbfc;
  --card: #ffffff;
  --border: #e6ebf1;
  --border-strong: #d3dbe5;
  --text: #0a2540;
  --text-muted: #425466;
  --text-soft: #6b7c93;
  --text-faint: #8898aa;
  --accent: #0061AA;
  --accent-hover: #00518F;
  --accent-press: #003E72;
  --accent-soft: #EAF2FA;
  --accent-deep: #003E72;          /* Safety Blue — deep header ink */
  --accent-ring: rgba(0, 97, 170, 0.30);
  --green: #0E9C76;
  --green-soft: #E7F4EF;
  --green-text: #0B6E55;
  --red: #C0382E;
  --red-soft: #F6EAE8;
  --red-text: #A52A1E;
  --amber: #B26A12;
  --amber-soft: #F4EEE2;
  --amber-text: #774C12;
  /* lit-glass edge-light: hairline-top inner highlight that makes a flat
     tinted surface read as lit glass without any backdrop blur. */
  --edge-light: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --shadow-card: 0 0 0 1px rgba(10, 37, 64, 0.04), 0 2px 4px rgba(10, 37, 64, 0.05), 0 8px 22px -2px rgba(10, 37, 64, 0.08);
  --radius-md: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { padding: 0; }
main {
  max-width: 480px; margin: 0 auto;
  padding: 16px 16px max(env(safe-area-inset-bottom), 16px);
}

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 4px; color: var(--text); }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--text); }
.sub { color: var(--text-muted); font-size: 14px; margin: 0 0 18px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--edge-light), var(--shadow-card);  /* lit-glass: inner top edge-light + soft elevation */
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 12px; font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

label {
  display: block; font-size: 12px;
  color: var(--text-soft);
  margin: 14px 0 6px;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
label:first-child { margin-top: 0; }
.req { color: var(--red); }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--card); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  font-family: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled { opacity: 0.6; }
input[readonly] {
  background: var(--bg-subtle); cursor: not-allowed; color: var(--text-muted);
}
.input-hint {
  font-size: 11px; color: var(--text-faint);
  margin-top: 6px;
}

/* Password row with embedded Show/Hide toggle. Reserve right-side
   space so typed characters never run under the toggle button. */
.pw-row { position: relative; }
.pw-row input { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-soft);
  font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 8px 10px; border-radius: 8px;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 120ms ease, color 120ms ease;
}
.pw-toggle:hover, .pw-toggle:focus-visible {
  color: var(--accent); background: var(--accent-soft); outline: 0;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  gap: 8px; text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary {
  background: var(--card); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-subtle); }
.btn-danger {
  background: var(--card); color: var(--red); border-color: var(--border-strong);
}
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }

.row { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.row .btn { flex: 1; min-width: 120px; }

.msg {
  margin-top: 14px; padding: 12px; border-radius: var(--radius-md);
  font-size: 14px; line-height: 1.4; display: none;
  border: 1px solid transparent;
}
.msg.show { display: block; }
.msg.ok { background: var(--green-soft); color: var(--green-text); border-color: rgba(14, 156, 118, 0.22); }
.msg.err { background: var(--red-soft); color: var(--red-text); border-color: rgba(192, 56, 46, 0.25); }

.welcome {
  background: var(--green-soft); border: 1px solid rgba(14, 156, 118, 0.22);
  color: var(--green-text); padding: 12px 14px; border-radius: var(--radius-md);
  font-size: 14px; margin-bottom: 18px; line-height: 1.4;
}

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; vertical-align: middle;
  border: 1px solid transparent;
}
.badge.pending   { background: var(--amber-soft); color: var(--amber-text); border-color: rgba(178, 106, 18, 0.22); }
.badge.revealed  { background: var(--accent-soft); color: var(--accent); border-color: rgba(0, 97, 170, 0.20); }
.badge.processed { background: var(--green-soft); color: var(--green-text); border-color: rgba(14, 156, 118, 0.22); }
.badge.expired   { background: var(--bg-subtle); color: var(--text-soft); border-color: var(--border); }

.skeleton {
  height: 64px; border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-subtle), var(--bg), var(--bg-subtle));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.err-block {
  padding: 14px 16px; background: var(--red-soft); border: 1px solid rgba(192, 56, 46, 0.25);
  color: var(--red-text); border-radius: var(--radius-md); font-size: 14px;
}
.warn-block {
  padding: 12px 14px; background: var(--amber-soft); border: 1px solid rgba(178, 106, 18, 0.22);
  color: var(--amber-text); border-radius: var(--radius-md); font-size: 13px; line-height: 1.45;
}

/* Visually hidden but still focusable + clickable. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ====================================================================
   Desktop / tablet app shell — sidebar-only (Slack / Notion / Linear /
   Vercel shape). Brand at top, destinations middle, user-pill bottom.
   No top utility bar — there's nothing global to live there yet (no
   search, no notifications, no workspace switcher). Add a topbar back
   when those land.

   Visibility matrix:
     <768px  signed-in : hidden (bottom tab bar takes over)
     768–1023 signed-in : COLLAPSED 64px icon rail
     ≥1024px  signed-in : EXPANDED 240px sidebar with labels
     Anywhere signed-out : hidden (static .rc-nav fallback shows)

   Body padding-left compensates for the fixed sidebar so page content
   doesn't sit under it. Scoped to html.signed-in so anonymous visitors
   still see the full-bleed activation form.
   ==================================================================== */
:root {
  --sidebar-w: 240px;
  --sidebar-w-mini: 64px;
  --shell-ink: #6b7c93;
  --shell-ink-active: #0061AA;
  --shell-bg: #ffffff;
  --shell-bg-active: rgba(0, 97, 170, 0.08);
  --shell-border: #e6ebf1;
}

.app-sidebar { display: none; }

.app-sidebar {
  position: fixed; left: 0;
  top: env(safe-area-inset-top); bottom: 0;
  width: var(--sidebar-w);
  background: var(--shell-bg);
  border-right: 1px solid var(--shell-border);
  z-index: 55;
  flex-direction: column;
  padding: 12px 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

/* Brand row at top of sidebar */
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--shell-border);
  text-decoration: none;
  color: var(--text, #0a2540);
  font-weight: 700; letter-spacing: -0.01em; font-size: 14px;
}
.sidebar-brand img { width: 28px; height: 28px; display: block; flex-shrink: 0; }
.sidebar-brand .brand-text { display: inline-block; }

/* Destination links — grow to push the user pill to the bottom */
.sidebar-nav {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

/* User-pill at the bottom of the sidebar (Slack/Linear/Notion pattern) */
.sidebar-user {
  flex: 0 0 auto;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--shell-border);
  position: relative;
}

.user-menu-trigger {
  display: inline-flex; align-items: center; gap: 10px;
  width: 100%; justify-content: flex-start;
  background: transparent; border: 1px solid transparent;
  padding: 8px 10px; border-radius: 10px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text, #0a2540); cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  text-align: left;
}
.user-menu-trigger:hover {
  background: var(--bg-subtle, #fafbfc);
  border-color: var(--shell-border);
}
.user-menu-trigger .user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft, #eef4fa) center/cover no-repeat;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent, #0061AA); font-size: 12px; font-weight: 700;
  border: 1px solid var(--shell-border);
  flex-shrink: 0;
}
.user-menu-trigger .user-name {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu-trigger .chev {
  width: 12px; height: 12px;
  stroke: currentColor; stroke-width: 2.4;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.5; flex-shrink: 0;
}
/* Dropdown opens UPWARD from above the user pill (it sits at the
   bottom of the sidebar). */
.user-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 6px); left: 0; right: 0;
  background: var(--shell-bg);
  border: 1px solid var(--shell-border);
  border-radius: 10px;
  box-shadow: 0 -8px 24px rgba(10, 37, 64, 0.12);
  padding: 6px;
  display: none;
  z-index: 70;
}
.user-menu-dropdown[data-open="true"] { display: block; }
.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block; width: 100%;
  background: transparent; border: 0; text-align: left;
  padding: 9px 12px; border-radius: 6px;
  font: inherit; font-size: 13px; color: var(--text, #0a2540);
  text-decoration: none; cursor: pointer;
}
.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--bg-subtle, #fafbfc);
  text-decoration: none;
}
.user-menu-dropdown .signout {
  color: var(--red, #C0382E);
  border-top: 1px solid var(--shell-border);
  margin-top: 4px; padding-top: 10px; border-radius: 0 0 6px 6px;
}

.app-sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  color: var(--shell-ink);
  text-decoration: none;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
  min-height: 40px;
}
.app-sidebar .nav-item + .nav-item { margin-top: 2px; }
.app-sidebar .nav-item:hover {
  background: var(--bg-subtle, #fafbfc);
  color: var(--text, #0a2540);
  text-decoration: none;
}
.app-sidebar .nav-item svg {
  width: 20px; height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.app-sidebar .nav-item[aria-current="page"] {
  color: var(--shell-ink-active);
  background: var(--shell-bg-active);
}
.app-sidebar .nav-item[aria-current="page"]::before {
  content: "";
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--shell-ink-active);
}

/* Tablet / small laptop: collapsed icon rail */
@media (min-width: 768px) {
  .app-sidebar { display: flex; width: var(--sidebar-w-mini); padding: 12px 6px; }
  .app-sidebar .nav-item { justify-content: center; padding: 9px 6px; gap: 0; }
  .app-sidebar .nav-item .label { display: none; }
  .sidebar-brand { justify-content: center; padding: 6px 4px 14px; }
  .sidebar-brand .brand-text { display: none; }
  .user-menu-trigger { justify-content: center; padding: 8px 4px; gap: 0; }
  .user-menu-trigger .user-name,
  .user-menu-trigger .chev { display: none; }
  html.signed-in body {
    padding-left: var(--sidebar-w-mini);
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
  html.signed-in .rc-nav { display: none; }
}

/* Full desktop: expanded labeled sidebar */
@media (min-width: 1024px) {
  .app-sidebar { width: var(--sidebar-w); padding: 12px 8px; }
  .app-sidebar .nav-item { justify-content: flex-start; padding: 9px 12px; gap: 12px; }
  .app-sidebar .nav-item .label { display: inline; }
  .sidebar-brand { justify-content: flex-start; padding: 6px 12px 14px; }
  .sidebar-brand .brand-text { display: inline-block; }
  .user-menu-trigger { justify-content: flex-start; padding: 8px 10px; gap: 10px; }
  .user-menu-trigger .user-name { display: block; }
  .user-menu-trigger .chev { display: block; }
  html.signed-in body {
    padding-left: var(--sidebar-w);
  }
}

/* Below 768: app shell is invisible; bottom tab bar is the nav. */
@media (max-width: 767.99px) {
  .app-sidebar { display: none !important; }
}

/* Subtle Blackwolf attribution at the bottom of the expanded sidebar.
   Mirrors Tech Connect ops-shell pattern: tiny, very muted, ≥1024px only
   (hidden in collapsed icon-rail mode and on mobile tab-bar mode). */
.app-sidebar::after {
  content: "";
  display: none;
}
@media (min-width: 1024px) {
  .app-sidebar::after {
    content: "Powered by Blackwolf AI USA";
    display: block;
    flex: 0 0 auto;
    font-size: 10px;
    color: var(--text-faint);
    opacity: 0.45;
    text-align: center;
    padding: 8px 12px 12px;
    letter-spacing: 0.02em;
  }
}


/* ====================================================================
   Bottom tab bar — app-grade primary navigation for installed PWA.

   Pattern selected 2026-05-15 after research (see directives/tabbar_research.md):
   bottom tab bar with 4 destinations (Home / My Orders / Send Opt-In /
   Profile) — matches iOS HIG, Material 3, and what Instagram / Spotify /
   Shopify / Linear / Slack all run. Native-app primitive on both iOS and
   Android, so a future Capacitor / RN wrap lifts the destinations 1:1.

   Anonymous users (no session in localStorage) → no tab bar (top
   .rc-nav pills stay as the lightweight web fallback).
   Authenticated users → tab bar, top .rc-nav hidden.
   Desktop ≥768px → no tab bar (room for a sidebar pattern later).
   ==================================================================== */
:root {
  --tabbar-h: 56px;
  --tabbar-bg: rgba(255, 255, 255, 0.92);
  --tabbar-border: rgba(10, 37, 64, 0.10);
  --tabbar-ink: #6b7c93;
  --tabbar-ink-active: #0061AA;
}

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  display: none;                              /* hidden by default; html.signed-in shows it */
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--tabbar-border);
  z-index: 50;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  /* View Transitions API: the tab bar persists across page navigations
     (Chrome 126+, Safari 18.2+). Without this each .html load would
     rebuild the bar visibly. Fallback path is a normal load — no harm. */
  view-transition-name: tabbar;
}
.tabbar a.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--tabbar-ink);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease;
}
.tabbar a.tab:hover { color: var(--tabbar-ink-active); text-decoration: none; }
.tabbar a.tab svg {
  width: 24px; height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 120ms ease;
}
.tabbar a.tab[aria-current="page"] { color: var(--tabbar-ink-active); }
.tabbar a.tab[aria-current="page"] svg { transform: translateY(-1px); }
/* Top accent bar marks the active destination. iOS-leaning visual. */
.tabbar a.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--tabbar-ink-active);
  border-radius: 0 0 3px 3px;
}

/* Signed-in state — flipped by the inline <head> pre-render script
   based on localStorage. Synchronous, zero flicker, bfcache-safe. */
html.signed-in .tabbar { display: grid; }
html.signed-in .rc-nav { display: none; }
html.signed-in body {
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)) !important;
}

/* Desktop / tablet hide — bottom tab bar is mobile only. Desktop gets
   the .app-sidebar shell defined further up. */
@media (min-width: 768px) {
  .tabbar { display: none !important; }
}

/* Reduce-motion: skip the icon lift on active so we don't fight
   accessibility preferences. */
@media (prefers-reduced-motion: reduce) {
  .tabbar a.tab svg { transition: none; }
  .tabbar a.tab[aria-current="page"] svg { transform: none; }
}

/* View Transitions opt-in for cross-document MPA navigation. Same
   origin pages only; falls back to a normal load if unsupported. */
@view-transition { navigation: auto; }
/* Keep the tab bar in place — no animation on the persistent element. */
::view-transition-group(tabbar) { animation: none; }

/* ────────────────────────────────────────────────────────────────
   Canvass tab (5th slot) — simplified 2026-05-25c.
   Single-line greyed tab. Tap opens a bottom sheet (nav.js).
   When <body data-flag-canvass="on">, the tab returns to normal
   tabbar styling and routes to /canvass.
   ──────────────────────────────────────────────────────────────── */

/* Bump the tabbar grid from 4 → 5 cells. */
.tabbar { grid-template-columns: repeat(5, 1fr); }

/* Disabled-state Canvass tab — grey, same layout as sibling tabs */
body[data-flag-canvass="off"] .tab-canvass,
body[data-flag-canvass="off"] .tab-canvass svg,
body[data-flag-canvass="off"] .tab-canvass .tab-label {
  color: #a8b2c1;
}
body[data-flag-canvass="off"] .tab-canvass svg { stroke-width: 1.5; }
body[data-flag-canvass="off"] .tab-canvass .tab-label { font-weight: 600; }

/* Active-state (flag flipped on) — inherit standard tabbar styling */
body[data-flag-canvass="on"] .tab-canvass[aria-current="page"] svg,
body[data-flag-canvass="on"] .tab-canvass[aria-current="page"] .tab-label {
  color: var(--accent);
}

/* Sidebar nav-item version */
body[data-flag-canvass="off"] .nav-item-canvass svg { color: #a8b2c1; }
body[data-flag-canvass="off"] .nav-item-canvass .label {
  color: #a8b2c1;
  font-weight: 500;
}

/* Bottom sheet — "Canvass is on the way" disclosure when flag is off. */
.canvass-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 37, 64, 0.36);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
.canvass-sheet-backdrop[data-open="true"] {
  opacity: 1; pointer-events: auto;
}
.canvass-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  z-index: 61;
  background: var(--card);
  border-top: 1px solid var(--border-strong);
  border-radius: 16px 16px 0 0;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  /* When closed, translate by own height + the gap above the tabbar so the
     sheet ends up fully below the viewport — not sitting on top of the
     tabbar as a sliver. */
  transform: translateY(calc(100% + var(--tabbar-h) + env(safe-area-inset-bottom) + 20px));
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -8px 24px rgba(10, 37, 64, 0.10);
  max-width: 520px;
  margin: 0 auto;
}
.canvass-sheet[data-open="true"] {
  transform: translateY(0);
  pointer-events: auto;
}
.canvass-sheet h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.canvass-sheet p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft, #56627a);
}
.canvass-sheet .sheet-actions {
  display: flex; justify-content: flex-end;
}
.canvass-sheet .sheet-dismiss {
  appearance: none; -webkit-appearance: none;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}
.canvass-sheet .sheet-dismiss:hover { background: var(--accent-hover); }

/* On desktop, the sidebar is the primary nav; the sheet anchors there too. */
@media (min-width: 768px) {
  .canvass-sheet { bottom: 24px; left: 24px; right: auto; width: 360px; }
}
