:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --surface-3: #eef1f4;
  --border: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.11);
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-dark: #4338ca;
  --accent-rgb: 79, 70, 229;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.09);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --nav-height: 68px;
}

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% -20%, rgba(99, 102, 241, 0.06), transparent 50%),
              radial-gradient(ellipse at 0% 100%, rgba(16, 185, 129, 0.03), transparent 40%),
              var(--bg);
}

.shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Typography */
h1, h2, h3, h4, p { margin: 0; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Buttons */
.btn-primary,
.btn-ghost,
.btn-icon,
.btn-icon-text,
.select-clean {
  font-family: inherit;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: var(--radius);
}

.btn-ghost:hover {
  background: var(--surface-3);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-3);
  transform: translateY(-1px);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
}

.btn-icon:hover { background: var(--surface-3); }

.btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
}

.btn-icon-text svg { flex-shrink: 0; }

/* LOGIN */
.login-grid {
  display: grid;
  gap: 16px;
  padding-bottom: 40px;
}

.brand-card,
.auth-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ===== Premium brand-card (login) ===== */
.brand-card {
  position: relative;
  padding: 40px 32px 36px;
  overflow: hidden;
  isolation: isolate;
  /* Google brand mesh — blue (S) + red (t) + green (r), no yellow so the
     Google Reviews stars stay the only gold element on this card. */
  background:
    radial-gradient(140% 80% at 0% 0%, rgba(66, 133, 244, 0.14) 0%, transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(234, 67, 53, 0.10) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 40px rgba(15, 23, 42, 0.06);
}

.brand-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}
.brand-orb--a { width: 220px; height: 220px; top: -50px; left: -50px;  background: rgba(66, 133, 244, 0.32); }   /* Google blue  */
.brand-orb--b { width: 200px; height: 200px; bottom: -50px; right: -40px; background: rgba(52, 168, 83, 0.26); }   /* Google green */
.brand-orb--c { width: 160px; height: 160px; top: 35%; right: 40%;     background: rgba(234, 67, 53, 0.22); }   /* Google red   */

.brand-top {
  position: relative;
  z-index: 1;
}

/* Rating display */
.brand-rating {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.brand-rating-score {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.brand-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.brand-rating-stars svg {
  width: 14px;
  height: 14px;
  fill: #FBBC05;
}

.brand-rating-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid rgba(15, 23, 42, 0.12);
  margin-left: 2px;
}

/* Wordmark */
.brand-wordmark-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: nowrap;
}

.brand-logo {
  width: clamp(64px, 14vw, 84px);
  height: clamp(64px, 14vw, 84px);
  border-radius: 14px;
  flex-shrink: 0;
  background: #fff;
  object-fit: contain;
  shape-rendering: geometricPrecision;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

.brand-wordmark {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1px;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-size: clamp(36px, 11.5vw, 60px);
  color: var(--ink);
  min-width: 0;
}
.brand-fresco { color: var(--ink); }
.brand-star-text { color: var(--ink); display: inline-flex; }

/* On narrow phones + portrait tablets: compact, single-column brand layout. */
@media (max-width: 600px) {
  /* Hide the trust-signal rating pill on mobile so the login form fits
     in the viewport without scrolling. */
  .brand-rating { display: none; }

  .brand-card {
    padding: 28px 22px 24px;
  }

  /* Logo + wordmark always side-by-side (logo on the left). */
  .brand-wordmark-row {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
  }
  .brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    flex-shrink: 0;
  }
  .brand-wordmark {
    font-size: clamp(26px, 9.5vw, 34px);
  }
  .brand-rating { padding: 5px 10px; gap: 7px; }
  .brand-rating-score { font-size: 0.85rem; }
  .brand-rating-stars svg { width: 12px; height: 12px; }
  .brand-rating-label { font-size: 0.7rem; padding-left: 6px; }

  .brand-tagline {
    font-size: 0.92rem;
    margin-top: 12px;
    line-height: 1.45;
  }

  .brand-google-reviews {
    font-size: 0.72rem;
    padding: 6px 10px 6px 8px;
    gap: 5px;
    margin-top: 12px;
    max-width: 100%;
  }
  .brand-google-icon { width: 14px; height: 14px; }

  /* Brand flow cards: stack vertically so they don't overflow horizontally.
     min-width:0 prevents grid children from forcing the row wider than the
     container, and word-wrap lets long descriptions break safely. */
  .brand-flow {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 24px;
  }
  .brand-flow > * { min-width: 0; }
  .brand-flow-divider {
    transform: rotate(90deg);
    padding: 4px 0;
  }
  .brand-flow-card {
    padding: 12px 14px 12px;
    gap: 6px;
  }
  .brand-flow-card-head { gap: 8px; flex-wrap: wrap; }
  .brand-flow-stars svg { width: 13px; height: 13px; }
  .brand-flow-pill { font-size: 0.62rem; padding: 3px 7px; }
  .brand-flow-pill svg { width: 10px; height: 10px; }
  .brand-flow-title { font-size: 0.92rem; }
  .brand-flow-desc {
    font-size: 0.74rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
}

/* Google Reviews pill — uses a generic star icon (not Google's trademark). */
.brand-google-reviews {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 14px auto 0;
  padding: 7px 12px 7px 9px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  flex-wrap: wrap;
  text-align: center;
  line-height: 1.35;
}
.brand-google-reviews strong { font-weight: 700; color: var(--ink); }
.brand-google-icon {
  width: 18px;
  height: 18px;
  fill: #FBBC05;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(184, 134, 11, 0.20));
}

/* "Star" letters — Google brand colors (blue/red/yellow/green) — a wink to Google */
.g-letter { display: inline-block; }
.g-blue   { color: #4285F4; }
.g-red    { color: #EA4335; }
.g-yellow { color: #FBBC05; }
.g-green  { color: #34A853; }

.brand-tagline {
  margin: 14px 0 0;
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: -0.005em;
  line-height: 1.5;
  max-width: 44ch;
}

/* Split-flow visualization */
.brand-flow {
  position: relative;
  z-index: 1;
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 14px;
}

.brand-flow-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.brand-flow-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}
.brand-flow-card--private {
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.07) 0%, rgba(255, 255, 255, 0.85) 70%);
  border-color: rgba(99, 102, 241, 0.20);
}
.brand-flow-card--public {
  background: linear-gradient(140deg, rgba(251, 188, 4, 0.12) 0%, rgba(255, 255, 255, 0.85) 70%);
  border-color: rgba(251, 188, 4, 0.32);
}

.brand-flow-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.brand-flow-card-head > * {
  min-width: 0;
}
.brand-flow-card-head .brand-flow-stars {
  flex: 1 1 auto;
}
.brand-flow-pill {
  flex-shrink: 0;
}

.brand-flow-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.brand-flow-stars svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
  fill: #FBBC05;
}
.brand-flow-stars svg.brand-flow-star--off {
  fill: rgba(15, 23, 42, 0.14);
}

.brand-flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-flow-pill svg { width: 11px; height: 11px; }

.brand-flow-pill--private {
  background: rgba(99, 102, 241, 0.10);
  color: #4338ca;
}
.brand-flow-pill--public {
  background: rgba(251, 188, 4, 0.20);
  color: #b45309;
}

.brand-flow-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
}

.brand-flow-desc {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0;
}

.brand-flow-divider {
  display: none;
}
.brand-flow-divider svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   AUTH CARD (login right side)
   ============================================================ */
.auth-card {
  padding: 30px 26px 26px;
  display: flex;
  flex-direction: column;
}

.auth-head {
  margin-bottom: 14px;
}

.auth-card h2 {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.15;
}

.auth-card header > p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 38ch;
}
.formHint-accent {
  color: var(--accent);
  font-weight: 600;
}

/* ===== Auth card on phones — tighter, less noise ===== */
@media (max-width: 600px) {
  .auth-card {
    padding: 26px 22px 22px;
  }
  .auth-head { margin-bottom: 12px; }
  .auth-card h2 { font-size: 1.4rem; }
  .auth-card header > p:last-child { font-size: 0.86rem; margin-top: 6px; }
  .auth-submit { padding: 13px 16px; font-size: 0.88rem; }
  .auth-footer { margin-top: 16px; padding-top: 14px; }
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.005em;
  border-radius: 12px;
}
.auth-submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.auth-submit:hover svg {
  transform: translateX(2px);
}

.auth-footer {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Forms */
.field-wrap { margin-top: 16px; }

.field-wrap label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 13px 14px;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder { color: var(--muted-2); }

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-group:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.input-group-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.04);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  letter-spacing: -0.01em;
}

.input-group input {
  border: none;
  border-radius: 0;
  background: transparent;
  padding-left: 12px;
  flex: 1;
  min-width: 0;
}

.input-group input:focus {
  border: none;
  box-shadow: none;
}

.input-group.input-phone .input-group-prefix.input-phone-prefix {
  background: transparent;
  border-right: 1px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0 12px 0 4px;
  min-width: 48px;
  text-align: right;
  transition: color 0.15s ease;
}

.input-phone-prefix.auto-detected {
  color: var(--accent);
}

.input-group.input-phone input {
  letter-spacing: 0.01em;
}

/* Country selector button (replaces static +1 prefix) */
.country-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 12px;
  background: rgba(15, 23, 42, 0.04);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  min-width: 78px;
  transition: background 0.15s ease;
}

.input-group:focus-within .country-select-btn {
  background: rgba(99, 102, 241, 0.06);
}

.country-select-btn:hover {
  background: rgba(15, 23, 42, 0.07);
}

.country-select-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.country-select-dial {
  letter-spacing: -0.01em;
}

.country-select-caret {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.country-select-btn[aria-expanded="true"] .country-select-caret {
  transform: rotate(180deg);
}

/* Dropdown panel (shared, single instance in body) */
.cc-panel {
  position: fixed;
  z-index: 9999;
  width: 280px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.cc-panel.open {
  display: flex;
}

.cc-panel-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}

.cc-panel-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  padding: 4px 0;
}

.cc-panel-search svg {
  color: var(--muted);
  flex-shrink: 0;
}

.cc-panel-list {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.cc-panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  transition: background 0.12s ease;
}

.cc-panel-item:hover,
.cc-panel-item:focus-visible {
  background: rgba(99, 102, 241, 0.08);
  outline: none;
}

.cc-panel-item.active {
  background: rgba(99, 102, 241, 0.12);
  font-weight: 700;
}

.cc-panel-item-flag {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.cc-panel-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-panel-item-dial {
  color: var(--muted);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

.cc-panel-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.field-helper-label {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-right: 6px;
  vertical-align: middle;
}

.field-helper-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-weight: 600;
  color: var(--accent);
  vertical-align: middle;
  letter-spacing: -0.01em;
}

.field-counter {
  display: block;
  text-align: right;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field-counter.over {
  color: var(--error, #ef4444);
}

.field-helper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb, 99, 102, 241), 0.08);
  border: 1px solid rgba(var(--accent-rgb, 99, 102, 241), 0.15);
  border-radius: 8px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  transition: opacity 0.2s ease;
}

.field-helper-label {
  color: var(--muted);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.field-helper-value {
  color: var(--accent);
  letter-spacing: 0.015em;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#codeInput {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.4rem;
  font-weight: 700;
}

#countryHint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.select-clean {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 14px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack > .btn-primary,
.stack > .btn-ghost { margin-top: 4px; }

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn-primary { flex: 1; }

.status {
  margin: 10px 0 0;
  min-height: 1.2rem;
  font-weight: 500;
  font-size: 0.88rem;
}

.status.ok { color: var(--success); }
.status.err { color: var(--error); }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* APP LAYOUT */
.app {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
  padding-bottom: calc(var(--nav-height) + 16px);
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

.app-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-brand .muted {
  margin-top: 1px;
  font-size: 0.78rem;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
}

.brand-title {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1;
}

.brand-fresco {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-star {
  display: inline-flex;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.g-letter {
  display: inline-block;
  font-weight: 800;
}

.g-blue   { color: #4285F4; }
.g-red    { color: #EA4335; }
.g-yellow { color: #FBBC05; }
.g-green  { color: #34A853; }

.brand-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 1px 1px rgba(251, 188, 5, 0.25));
}

.brand-star-icon {
  width: 13px;
  height: 13px;
  fill: url(#brand-star-gradient);
  fill: #FBBC05;
  transition: transform 200ms ease;
}

.brand-stars:hover .brand-star-icon {
  transform: translateY(-1px);
}

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Bottom nav */
.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 0 8px calc(env(safe-area-inset-bottom, 0px));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.nav-item svg { stroke-width: 2; }

.nav-item.active { color: var(--accent); }

.nav-item.active svg { stroke-width: 2.5; }

/* Views */
.view {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.25s ease;
}

.view.view-active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}

.section-head h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head .muted {
  margin-top: 2px;
  font-size: 0.84rem;
}

.fab {
  display: none;
}

@media (max-width: 640px) {
  #openClaimBtn {
    display: none;
  }
  #reviewsListContainer {
    padding-bottom: 96px;
  }
  #singleReviewDashboard {
    padding-bottom: 96px;
  }
  #activeRevPagination {
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px !important;
    margin-top: 14px !important;
  }
  #activeRevPagination .prev-page,
  #activeRevPagination .next-page {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  #activeRevPagination .prev-page::before {
    content: '';
    width: 10px;
    height: 10px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-right: 2px;
  }
  #activeRevPagination .next-page::after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-left: 2px;
  }
  #activeRevPagination .prev-page:disabled,
  #activeRevPagination .next-page:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  #activeRevPagination .prev-page:not(:disabled):active,
  #activeRevPagination .next-page:not(:disabled):active {
    transform: scale(0.97);
    background: var(--surface-2);
  }
  #activeRevPagination .page-info {
    flex: 1 1 100%;
    order: -1;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 2px;
  }
  .fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    border: 0;
    cursor: pointer;
    box-shadow:
      0 10px 28px rgba(79, 70, 229, 0.32),
      0 2px 6px rgba(15, 23, 42, 0.08);
    z-index: 60;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .fab:active {
    transform: scale(0.94);
    box-shadow:
      0 6px 18px rgba(79, 70, 229, 0.28),
      0 1px 4px rgba(15, 23, 42, 0.06);
  }
}

@media (max-width: 480px) {
  .fab {
    width: 48px;
    height: 48px;
    bottom: calc(var(--nav-height) + 16px);
    right: 16px;
  }
}

/* Cards */
.card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-head h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state.compact {
  padding: 24px 16px;
}

.empty-icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
}

.empty-state > p:first-of-type {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.empty-taps-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px 28px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.empty-taps-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 24px;
}

.empty-taps-state__icon svg {
  width: 52px;
  height: 52px;
}

.empty-taps-state__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  text-align: center;
}

.empty-taps-state__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.empty-taps-state__description {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0;
}

.empty-taps-state__cta {
  margin-top: 2px;
}

/* Tag list */
.tags-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.tap-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
}

.tap-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.tap-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.03);
  border-color: rgba(79, 70, 229, 0.25);
}

.tap-card:hover::before {
  opacity: 1;
}

.tap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  background: #ffffff;
}

.tap-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.8), 0 2px 6px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.04);
}

.tap-icon-wrap[data-type="google_reviews"] {
  background: #fdf2f8; 
  color: #db2777;
  border-color: #fbcfe8;
}

.tap-icon-wrap[data-type="business_card"] {
  background: #f0fdf4;
  color: #059669;
  border-color: #bbf7d0;
}

.tap-icon-wrap[data-type="link"],
.tap-icon-wrap[data-type="website"] {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

.tap-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.tap-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.tap-badge-type {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.tap-badge-status {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tap-badge-status::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse-ring 2s infinite;
}

.tap-card-body {
  padding: 0 20px 16px;
}

.tap-title {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tap-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  padding: 8px 12px;
  background: #eef2ff;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  margin-top: 4px;
  max-width: 100%;
}

.tap-link span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tap-link:hover {
  background: #4f46e5;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.tap-link svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.tap-hardware {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.hw-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  max-width: 100%;
}

.hw-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-item svg {
  color: #94a3b8;
}

.tap-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: #ffffff;
  margin-top: auto;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-action svg {
  width: 16px;
  height: 16px;
}

.btn-action.primary {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-action.primary:hover {
  background: #000000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-action.secondary {
  background: #f1f5f9;
  color: #475569;
}
.btn-action.secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-action.icon-only {
  padding: 0;
  width: 38px;
  background: transparent;
  color: #94a3b8;
  margin-left: auto;
}
.btn-action.icon-only:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* Metrics */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.8;
}

.metric-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 14px;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
}

.metric-card.qr::before { background: #2563eb; }
.metric-card.qr .metric-icon { color: #2563eb; background: rgba(37, 99, 235, 0.08); }
.metric-card.nfc::before { background: #7c3aed; }
.metric-card.nfc .metric-icon { color: #7c3aed; background: rgba(124, 58, 237, 0.08); }
.metric-card.tags::before { background: #059669; }
.metric-card.tags .metric-icon { color: #059669; background: rgba(5, 150, 105, 0.08); }
.metric-card.active::before { background: #ea580c; }
.metric-card.active .metric-icon { color: #ea580c; background: rgba(234, 88, 12, 0.08); }

.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* Charts */
.chart {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.chart-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
}

.chart-grid-line {
  width: 100%;
  border-top: 1px dashed var(--border);
}

.chart-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 130px;
  padding-bottom: 22px;
}

.chart-bar-wrap {
  flex: 1;
  max-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  height: 100%;
  position: relative;
}

.chart-bar {
  width: 100%;
  max-width: 28px;
  background: var(--accent);
  border-radius: 8px 8px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
  position: relative;
}

.chart-bar::after {
  content: attr(data-count);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chart-bar-wrap:hover .chart-bar::after {
  opacity: 1;
}

.chart-day {
  position: absolute;
  bottom: 0;
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  transform: translateY(18px);
}

.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simple-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.88rem;
}

.simple-list-name {
  font-weight: 500;
  color: var(--ink);
}

.simple-list-value {
  font-weight: 700;
  color: var(--accent);
}

/* Per-tag stats */
.per-tag-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.per-tag-preview {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.per-tag-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.per-tag-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.per-tag-type {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-top: 2px;
}

.per-tag-visit {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.08);
  white-space: nowrap;
}

.per-tag-visit.disabled {
  color: var(--muted-2);
  background: var(--surface-3);
  cursor: not-allowed;
}

.per-tag-codes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.per-tag-code {
  font-size: 0.72rem;
  font-family: 'SF Mono', Menlo, monospace;
  color: var(--ink-2);
  word-break: break-all;
}

.per-tag-code .code-label {
  min-width: 34px;
  margin-right: 4px;
}

.per-tag-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.per-tag-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.per-tag-metric-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.per-tag-metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.per-tag-chart-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.per-tag-chart-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.per-tag-chart {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  height: 70px;
  padding-bottom: 16px;
  position: relative;
}

.per-tag-chart-bar-wrap {
  flex: 1;
  max-width: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  height: 100%;
  position: relative;
}

.per-tag-chart-bar {
  width: 100%;
  max-width: 18px;
  background: var(--accent);
  border-radius: 6px 6px 0 0;
  min-height: 3px;
  position: relative;
}

.per-tag-chart-bar::after {
  content: attr(data-count);
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.per-tag-chart-bar-wrap:hover .per-tag-chart-bar::after {
  opacity: 1;
}

.per-tag-chart-day {
  position: absolute;
  bottom: 0;
  font-size: 0.64rem;
  color: var(--muted);
  white-space: nowrap;
  transform: translateY(16px);
}

/* Reviews */
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.step-number {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
}

.steps-list .positive { color: var(--success); font-weight: 600; }
.steps-list .negative { color: var(--muted); }

/* Feature cards */
.feature-card {
  text-align: center;
  padding: 28px 20px;
}

.feature-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card .muted {
  font-size: 0.86rem;
  margin-bottom: 18px;
}

.feature-actions {
  display: flex;
  justify-content: center;
}

/* Settings */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: 0; }

.setting-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.username-form {
  width: 100%;
  margin-top: 12px;
}

.username-preview {
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}

.field-wrap--inline {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-wrap--inline:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.username-at {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.field-wrap--inline input {
  flex: 1;
  border: 0;
  border-radius: 0;
  height: 44px;
  padding: 0 12px;
  background: transparent;
  font-size: 0.95rem;
}

.field-wrap--inline input:focus {
  box-shadow: none;
}

.status--compact {
  margin-top: 8px;
  min-height: 20px;
  font-size: 0.8rem;
}

.btn-row--right {
  justify-content: flex-end;
  margin-top: 12px;
}

.setting-row--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  /* `dvh` shrinks when the iOS keyboard opens so the modal stays usable. */
  max-height: min(90vh, calc(100dvh - env(safe-area-inset-top, 0px) - 16px));
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  z-index: 2;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-header .btn-icon {
  background: transparent;
}

#modalBody {
  padding: 18px;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Safe area at the bottom so the last field/CTA clears the iOS keyboard
     and the home indicator. */
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  scroll-behavior: smooth;
}

/* Keep focused inputs visible above the keyboard with breathing room. */
#modalBody:focus-within {
  scroll-padding-top: 24px;
  scroll-padding-bottom: 80px;
}

.field-wrap input,
.field-wrap textarea,
.field-wrap select {
  scroll-margin-top: 24px;
  scroll-margin-bottom: 80px;
}

/* Responsive desktop */
@media (min-width: 768px) {
  .shell {
    max-width: 1100px;
  }

  .login-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 24px;
    align-items: stretch;
    min-height: calc(100vh - 64px);
  }

  .brand-card {
    padding: 64px 56px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .brand-top { max-width: 520px; }
  .brand-wordmark-row { gap: 20px; margin-top: 26px; }
  .brand-logo { width: clamp(68px, 5.8vw, 84px); height: clamp(68px, 5.8vw, 84px); border-radius: 16px; }
  .brand-wordmark { font-size: clamp(52px, 5.5vw, 68px); }
  .brand-google-reviews { font-size: 0.86rem; padding: 8px 14px 8px 11px; }
  .brand-google-icon { width: 20px; height: 20px; }
  .brand-tagline { font-size: 1.05rem; }
  .brand-flow { margin-top: 40px; gap: 16px; }
  .brand-flow-card { padding: 22px 22px 20px; }
  .brand-flow-title { font-size: 1.05rem; }
  .brand-flow-desc { font-size: 0.84rem; line-height: 1.5; }
  .brand-flow-stars svg { width: 16px; height: 16px; }
  .brand-flow-pill { padding: 4px 9px; font-size: 0.68rem; }
  .brand-flow-pill svg { width: 12px; height: 12px; }
  .brand-rating-score { font-size: 1rem; }
  .brand-rating-stars svg { width: 16px; height: 16px; }

  .auth-card {
    align-self: center;
    padding: 38px 36px 32px;
  }
  .auth-card h2 { font-size: 1.85rem; }

  .app {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "top top"
      "nav content";
    gap: 0 24px;
    padding-bottom: 24px;
  }

  .app-top {
    grid-area: top;
    padding: 8px 8px 20px;
  }

  .app-nav {
    grid-area: nav;
    position: static;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    align-self: start;
    height: auto;
    background: transparent;
    border: 0;
    padding: 0;
    gap: 4px;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    gap: 12px;
    color: var(--muted);
  }

  .nav-item:hover { background: var(--surface-2); }
  .nav-item.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

  .mobile-only { display: none !important; }

  .app-content {
    grid-area: content;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .view {
    display: none;
    gap: 18px;
  }

  .view.view-active { display: grid; }

  .metrics-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal {
    align-items: center;
  }

  .modal-card {
    border-radius: var(--radius-lg);
    animation: fadeIn 0.2s ease;
  }
}

.reveal { animation: rise 0.45s ease both; }
.delay-1 { animation-delay: 0.1s; }

/* Reviews dashboard */
.reviews-metrics .metric-card.highlight {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border-color: var(--accent);
}

.reviews-metrics .metric-card.positive {
  border-bottom: 3px solid #22c55e;
}

.reviews-metrics .metric-card.negative {
  border-bottom: 3px solid #ef4444;
}

.metric-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 6px 0 4px;
}

.metric-stars svg {
  width: 16px;
  height: 16px;
}

.rating-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 28px 1fr 32px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.12s ease;
}

.breakdown-row:hover {
  background: var(--surface-2);
}

.breakdown-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  text-align: right;
}

.breakdown-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.breakdown-fill.low {
  background: #ef4444;
}

.breakdown-fill.mid {
  background: #f59e0b;
}

.breakdown-fill.high {
  background: #22c55e;
}

.breakdown-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  text-align: right;
}

.reviews-list-card {
  overflow: hidden;
}

.reviews-list-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.reviews-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: var(--surface-3);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.review-card-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.review-card-stars {
  display: flex;
  gap: 2px;
}

.review-card-stars svg {
  width: 16px;
  height: 16px;
}

.review-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.review-card-email {
  font-size: 0.72rem;
  color: var(--muted);
}

.review-card-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}

.review-card-text {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}

.review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.review-card-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.review-card-status {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
}

.review-card-status.new {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
}

.review-card-status.archived {
  background: var(--surface-3);
  color: var(--muted);
}

@media (min-width: 640px) {
  .reviews-list-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Google Reviews config */
.place-id-assistant {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-text {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.btn-text:hover {
  text-decoration: underline;
}

.assistant-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.code-block {
  display: block;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink-2);
  word-break: break-all;
}

.small {
  font-size: 0.78rem;
}

.btn-compact {
  padding: 8px 16px;
  font-size: 0.85rem;
  height: auto;
  border-radius: calc(var(--radius) - 2px);
}

.review-tags-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-tag-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Premium Inline Tag Routing Selector */
.tag-routing-selector {
  display: flex;
  background: var(--surface-3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.routing-tab-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.routing-tab-btn:hover {
  color: var(--ink);
}

.routing-tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.routing-panel {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  animation: fade-in 0.3s ease;
}

.smart-input-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inline-search-spinner {
  position: absolute;
  right: 12px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.inline-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
}

.inline-search-results li {
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.inline-search-results li:last-child {
  border-bottom: none;
}

.inline-search-results li:hover {
  background: var(--surface-2);
}

.tag-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.62rem;
  border-radius: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-badge.default {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.tag-badge.custom {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
}

.review-tag-name {
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  font-size: 0.95rem;
}

.review-tag-info p {
  margin: 0;
}

@media (min-width: 640px) {
  .review-tag-row {
    padding: 20px;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Desktop nav extra items */
@media (min-width: 768px) {
  .desktop-only {
    display: flex !important;
  }
}


@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}

/* Search & Premium Business Setup */
.google-reviews-setup-card {
  padding: 24px;
}

.setup-tabs {
  display: flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.setup-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.setup-tab-btn svg {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.setup-tab-btn:hover {
  color: var(--ink);
}

.setup-tab-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.setup-tab-btn.active svg {
  opacity: 1;
}

.premium-search-container {
  position: relative;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon-left {
  position: absolute;
  left: 16px;
  color: var(--muted-2);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.premium-search-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all 0.2s ease;
}

.premium-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.search-spinner-right {
  position: absolute;
  right: 16px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.premium-results-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: calc(var(--radius) - 6px);
  transition: background 0.15s ease;
}

.premium-result-item:hover {
  background: var(--surface-2);
}

.premium-result-item .pin-icon {
  font-size: 1.25rem;
  margin-top: 2px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05));
}

.premium-result-item .text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.premium-result-item .business-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.premium-result-item .business-address {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Selected Business Card (Premium Text UI) */
.selected-business-card {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
  transition: all 0.2s ease;
}

.selected-business-card:hover {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}

.business-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.business-card-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -10px;
}

.business-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
}

.business-details-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.business-icon-wrapper {
  background: rgba(16, 185, 129, 0.1);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.business-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.business-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.selected-business-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.selected-business-card .muted {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.business-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px dashed rgba(16, 185, 129, 0.2);
  margin-top: 4px;
}

.selected-business-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.selected-business-card .muted {
  margin: 0;
}

.business-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(16, 185, 129, 0.1);
}

.review-link-preview {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* View Sub-navigation Tabs (Expert Mobile-First UI) */
.view-tabs {
  display: flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: calc(var(--radius) + 4px);
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab-btn {
  flex: 1;
  min-width: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.view-tab-btn:hover {
  color: var(--ink);
}

.view-tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}

.view-tab-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-tab-content.hidden {
  display: none;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Filter Pills (Analytics view) */
.filter-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.filter-pill:hover { color: var(--ink); }

.filter-pill.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border);
}

.filter-pill svg {
  flex-shrink: 0;
}

.filter-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================================
   Digital Business Cards — Dashboard (v2 - clean contact card)
   ========================================================= */

.cards-list-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cards-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px) {
  .cards-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.business-card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  display: flex;
  flex-direction: column;
}

.business-card-item:hover {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.2);
}

/* Card header: avatar + name + status */
.business-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 14px;
  background: var(--surface);
  position: relative;
}

.business-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(99, 102, 241, 0.18) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  letter-spacing: -0.02em;
  border: 1px solid rgba(79, 70, 229, 0.1);
}

.business-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.business-card-avatar svg {
  width: 30px;
  height: 30px;
  opacity: 0.5;
}

.business-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.business-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.business-card-role {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-weight: 500;
}

.business-card-tag {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 4px 0 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.business-card-tag svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.business-card-status-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.5;
}

.business-card-status-badge[data-status="active"] {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.18);
}

.business-card-status-badge[data-status="direct"] {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.18);
}

.business-card-status-badge[data-status="inactive"] {
  background: rgba(239, 68, 68, 0.08);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.18);
}

/* Card actions (footer) */
.business-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  margin-top: auto;
  gap: 2px;
}

.bc-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 8px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.bc-action-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.bc-action-btn:active {
  transform: scale(0.97);
}

.bc-action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.bc-action-btn svg { flex-shrink: 0; }

.bc-action-btn--edit { color: var(--accent); }
.bc-action-btn--share { color: #059669; }
.bc-action-btn--stats { color: var(--accent); }
.bc-action-btn--delete { color: var(--error); }
.bc-action-btn--delete:hover { background: rgba(239, 68, 68, 0.08); }

/* ============================================================
   PER-TAP STATS BUTTON (Google Review tap card)
   ============================================================ */
.bc-stats-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.bc-stats-btn:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.bc-stats-btn:active { transform: scale(0.97); }
.bc-stats-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bc-stats-btn svg { flex-shrink: 0; }

.bc-action-btn--icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--error);
  opacity: 0.55;
  transition: all 0.15s ease;
}

.bc-action-btn--icon:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.08);
}

/* Inline toggle rows inside card */
.business-card-toggles {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.bc-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border);
}

.bc-toggle-row:last-child {
  border-bottom: none;
}

.bc-toggle-row:hover {
  background: var(--surface-2);
}

.bc-toggle-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bc-toggle-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bc-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.bc-toggle-desc {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.toggle-switch--sm {
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch--sm .toggle-slider:before {
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
}

.toggle-switch--sm input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

@media (max-width: 480px) {
  .bc-action-btn span:not(.bc-sr) { display: none; }
  .bc-action-btn--icon span { display: none; }
  .bc-action-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    flex: 0 0 auto;
  }
}

.bc-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Toggle Switch Component */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}
.toggle-wrapper:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 16px;
}
.toggle-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: #10b981; /* FrescoStar Green */
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Card Builder */
.card-builder-form {
  padding-top: 8px;
}

.card-preview-panel {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.card-preview-header {
  padding: 10px 14px;
  background: rgba(79, 70, 229, 0.06);
  border-bottom: 1px solid var(--border);
}

.card-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.card-preview-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.mini-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.mini-info {
  flex: 1;
  min-width: 0;
}

.mini-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-name.placeholder-text {
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
}

.mini-role {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-role.placeholder-text {
  font-style: italic;
  opacity: 0.6;
}

.builder-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.builder-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface-2);
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease;
}

.builder-section-toggle:hover {
  background: var(--surface-3);
}

.builder-section-toggle svg {
  transition: transform 0.2s ease;
  color: var(--muted);
}

.builder-section-toggle.active svg {
  transform: rotate(180deg);
}

.builder-section-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade-in 0.25s ease;
}

.builder-section-content.hidden {
  display: none;
}

.builder-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

input[type="color"] {
  padding: 4px;
  height: 44px;
  cursor: pointer;
}

.photo-uploader {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.2s ease;
  overflow: hidden;
}

.photo-uploader:hover,
.photo-uploader.drag-over {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.03);
}

.photo-uploader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.photo-uploader-empty * {
  pointer-events: auto;
}

.photo-uploader-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 4px;
}

.photo-uploader-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.photo-uploader-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 8px;
}

.photo-uploader-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.photo-uploader-preview {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: fade-in 0.3s ease;
}

.photo-uploader-current {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-uploader-current:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.photo-uploader-current:active {
  transform: scale(0.98);
}

.photo-uploader-current img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-uploader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.photo-uploader-current:hover .photo-uploader-overlay,
.photo-uploader-current:focus-visible .photo-uploader-overlay {
  opacity: 1;
}

.photo-uploader-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-uploader-side-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.photo-uploader-side-desc {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.photo-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.photo-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-family: inherit;
}

.photo-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}

.photo-action-btn.photo-action-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.photo-action-btn.photo-action-primary:hover {
  background: var(--accent-2, var(--accent));
  border-color: var(--accent-2, var(--accent));
  color: #fff;
  opacity: 0.95;
}

.photo-action-btn.photo-action-danger {
  color: var(--error, #ef4444);
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
}

.photo-action-btn.photo-action-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--error, #ef4444);
}

@media (max-width: 480px) {
  .photo-uploader-preview {
    flex-direction: column;
    text-align: center;
  }
  .photo-preview-actions {
    justify-content: center;
  }
}

.photo-uploader-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 600;
}

.photo-uploader-status .spinner {
  border-color: rgba(15, 23, 42, 0.12);
  border-top-color: var(--accent);
  width: 28px;
  height: 28px;
}

/* Toast for copy feedback */
.dashboard-toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  z-index: 100;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.dashboard-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 640px) {
  .builder-two-col {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .business-card-actions button,
  .business-card-actions a {
    font-size: 0.85rem;
  }
}

@media (min-width: 768px) {
  .cards-list {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Premium Analytics UI */
.premium-analytics-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

.premium-analytics-head h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.refresh-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

/* ===== Premium metric grid (stats cards) ===== */
.premium-metrics {
  gap: 12px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 560px) {
  .premium-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card analytics: only 2 stats (QR + NFC) — keep them side by side on all sizes */
.card-stats-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px !important;
}

@media (min-width: 560px) {
  .card-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ============================================================
   CARD ANALYTICS — Stat cards (premium, world-class UI/UX)
   ============================================================ */
.card-stats-card {
  position: relative;
  padding: 0;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.card-stats-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, var(--stat-tint, rgba(79, 70, 229, 0.06)) 0%, transparent 65%);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.card-stats-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: var(--stat-color, var(--accent));
  opacity: 0.85;
  transition: height 0.3s ease, opacity 0.3s ease;
}

.card-stats-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 8px rgba(15, 23, 42, 0.04),
    0 24px 48px rgba(15, 23, 42, 0.1);
  border-color: var(--stat-color, var(--accent));
  border-color: color-mix(in srgb, var(--stat-color, var(--accent)) 30%, transparent);
}

.card-stats-card:hover::after {
  height: 4px;
  opacity: 1;
}

.card-stats-card:hover::before {
  opacity: 1;
}

.card-stats-card .metric-content {
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 168px;
  position: relative;
}

.card-stats-card .metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
}

.card-stats-card .metric-label {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-stats-card .metric-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stat-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stat-color, var(--accent)) 15%, transparent);
}

.card-stats-card .metric-icon {
  margin-bottom: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--stat-color, var(--accent)) 12%, var(--surface));
  color: var(--stat-color, var(--accent));
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card-stats-card .metric-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0.6;
}

.card-stats-card:hover .metric-icon {
  transform: scale(1.08) rotate(-4deg);
}

.card-stats-card .metric-value {
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: linear-gradient(180deg, var(--ink) 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-stats-card .metric-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.card-stats-card .metric-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-stats-card .metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid transparent;
}

.card-stats-card .metric-trend[data-direction="up"]   { background: rgba(16, 185, 129, 0.1);  color: #047857; border-color: rgba(16, 185, 129, 0.2); }
.card-stats-card .metric-trend[data-direction="down"] { background: rgba(239, 68, 68, 0.1);   color: #b91c1c; border-color: rgba(239, 68, 68, 0.2); }
.card-stats-card .metric-trend[data-direction="flat"] { background: rgba(100, 116, 139, 0.1); color: var(--muted); border-color: rgba(100, 116, 139, 0.18); }
.card-stats-card .metric-trend[data-direction="new"]  { background: rgba(79, 70, 229, 0.1);   color: var(--accent); border-color: rgba(79, 70, 229, 0.2); }

.card-stats-card .metric-trend svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.card-stats-card .metric-footer-hint {
  font-size: 0.68rem;
  color: var(--muted);
  opacity: 0.85;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Specific NFC icon polish on the card analytics */
.card-stats-card.nfc .metric-icon svg {
  stroke-width: 1.8;
}

@media (max-width: 380px) {
  .card-stats-card .metric-content {
    padding: 18px 18px 16px;
    min-height: 156px;
  }
  .card-stats-card .metric-value {
    font-size: 2.1rem;
  }
  .card-stats-card .metric-icon {
    width: 40px;
    height: 40px;
  }
}

.metric-card.premium-stat-card {
  position: relative;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 18px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.metric-card.premium-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--stat-tint, rgba(79, 70, 229, 0.05)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}

.metric-card.premium-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--stat-color, var(--accent));
  opacity: 0.85;
  transition: height 0.25s ease, opacity 0.25s ease;
}

.metric-card.premium-stat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.05),
    0 16px 36px rgba(15, 23, 42, 0.09);
  border-color: rgba(15, 23, 42, 0.08);
}

.metric-card.premium-stat-card:hover::before {
  opacity: 1;
}

.metric-card.premium-stat-card:hover::after {
  height: 4px;
  opacity: 1;
}

.metric-content {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.metric-card .metric-icon {
  margin-bottom: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.metric-card .metric-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0.6;
}

.metric-card:hover .metric-icon {
  transform: scale(1.08) rotate(-4deg);
}

.metric-card .metric-label {
  margin-bottom: 0;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.metric-card .metric-value {
  font-size: 1.85rem;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-card .metric-suffix {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

/* Trend chip (▲ / ▼ + percentage) */
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 6px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid transparent;
}

.metric-trend[data-direction="up"]   { background: rgba(16, 185, 129, 0.1);  color: #059669; border-color: rgba(16, 185, 129, 0.18); }
.metric-trend[data-direction="down"] { background: rgba(239, 68, 68, 0.1);   color: #dc2626; border-color: rgba(239, 68, 68, 0.18); }
.metric-trend[data-direction="flat"] { background: rgba(100, 116, 139, 0.1); color: var(--muted); border-color: rgba(100, 116, 139, 0.18); }
.metric-trend[data-direction="new"]  { background: rgba(79, 70, 229, 0.1);   color: var(--accent); border-color: rgba(79, 70, 229, 0.18); }

.metric-trend svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* Footer of each stat card (period label / context) */
.metric-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.metric-footer-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.75;
}

/* ===== Color variants ===== */
.metric-card.premium-stat-card.qr {
  --stat-color: #2563eb;
  --stat-tint: rgba(37, 99, 235, 0.06);
}
.metric-card.premium-stat-card.nfc {
  --stat-color: #7c3aed;
  --stat-tint: rgba(124, 58, 237, 0.07);
}
.metric-card.premium-stat-card.tags {
  --stat-color: #059669;
  --stat-tint: rgba(5, 150, 105, 0.06);
}
.metric-card.premium-stat-card.active {
  --stat-color: #ea580c;
  --stat-tint: rgba(234, 88, 12, 0.06);
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 992px) {
  .analytics-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.premium-chart-card, .premium-list-card, .premium-detail-card {
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.05);
  background: var(--surface);
  height: 100%;
}

.premium-chart-card .card-head, .premium-list-card .card-head, .premium-detail-card .card-head {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.premium-chart {
  padding: 24px;
  min-height: 250px;
}

.chart-bar-wrap {
  border-radius: 4px;
  transition: background 0.2s ease;
}

.chart-bar-wrap:hover {
  background: rgba(0,0,0,0.02);
}

.chart-bar {
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(79, 70, 229, 0.6) 100%);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
  transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-simple-list {
  padding: 12px;
}

.premium-simple-list li {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.2s ease;
  border-bottom: none;
}

.premium-simple-list li:hover {
  background: var(--surface-hover);
}

.premium-select-wrapper {
  padding: 24px 24px 0;
}

.premium-select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--bg);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.premium-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.premium-stats-content {
  padding: 24px;
}

/* Premium Per-Tag Stats UI */
.per-tag-preview {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(79, 70, 229, 0.01) 100%);
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.per-tag-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.per-tag-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.per-tag-type {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.per-tag-visit {
  display: inline-block;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.per-tag-visit:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.per-tag-visit.disabled {
  color: var(--muted);
  border-color: var(--border);
  background: var(--bg);
  cursor: not-allowed;
}

.per-tag-visit.disabled:hover {
  background: var(--bg);
  color: var(--muted);
}

.per-tag-codes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.per-tag-code {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--ink);
}

.code-label {
  font-weight: 700;
  color: var(--muted);
  margin-right: 8px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
}

.per-tag-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .per-tag-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.per-tag-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.per-tag-metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.per-tag-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.per-tag-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.per-tag-chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
}

.per-tag-chart {
  display: flex;
  align-items: flex-end;
  height: 120px;
  gap: 8px;
}

.per-tag-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  group: hover;
}

.per-tag-chart-bar {
  width: 100%;
  max-width: 30px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(79, 70, 229, 0.6) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.per-tag-chart-bar:hover {
  opacity: 1;
  transform: scaleY(1.05);
  transform-origin: bottom;
}

.per-tag-chart-day {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Premium Chart Specifics */
.premium-chart-bars {
  height: 200px; /* Make the chart taller */
}

.premium-chart-bar-wrap {
  transition: transform 0.2s ease;
}

.premium-chart-bar-wrap:hover {
  transform: translateY(-2px);
}

.premium-chart-bar {
  background: linear-gradient(180deg, var(--accent) 0%, rgba(79, 70, 229, 0.4) 100%);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.premium-chart-day {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ===== Cards view: per-card analytics drill-down ===== */
.cards-single-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.analytics-card-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: 18px;
}
.analytics-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.15);
}
.analytics-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.analytics-card-info {
  flex: 1;
  min-width: 200px;
}
.analytics-card-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.analytics-card-name-row h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.analytics-card-codes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.analytics-tag-code {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
  font-family: 'SFMono-Regular', Consolas, monospace;
  letter-spacing: 0.01em;
}
.analytics-tag-code.qr { color: #4338ca; background: rgba(79, 70, 229, 0.08); border-color: rgba(79, 70, 229, 0.18); }
.analytics-tag-code.nfc { color: #047857; background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.18); }

/* ============================================================
   CARD ANALYTICS — Header (premium, world-class UI/UX)
   ============================================================ */
.analytics-card-header.card-stats-header {
  padding: 22px 24px;
  border-radius: 22px;
  gap: 20px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid rgba(79, 70, 229, 0.14);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(79, 70, 229, 0.08);
  position: relative;
  overflow: hidden;
}

.analytics-card-header.card-stats-header::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.analytics-card-header.card-stats-header > * {
  position: relative;
  z-index: 1;
}

.analytics-card-header.card-stats-header .analytics-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 1.45rem;
  border: 0;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow:
    0 8px 24px rgba(79, 70, 229, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  letter-spacing: -0.02em;
}

.analytics-card-header.card-stats-header .analytics-card-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 55%);
  pointer-events: none;
}

.analytics-card-header.card-stats-header .analytics-card-name-row h3 {
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.analytics-card-header.card-stats-header #singleCardPreviewLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent);
  color: #ffffff;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 0;
}

.analytics-card-header.card-stats-header #singleCardPreviewLink:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.32);
}

.analytics-card-header.card-stats-header #singleCardPreviewLink svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.bc-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bc-status-chip.active { background: rgba(16, 185, 129, 0.12); color: #059669; }
.bc-status-chip.inactive { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.bc-status-chip.direct { background: rgba(79, 70, 229, 0.12); color: #4338ca; }

/* QR Modal — premium, square, never stretched */
.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 4px 2px 2px;
}

.qr-modal-pill {
  display: flex;
  justify-content: center;
}

.qr-modal-qrwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-modal-qr {
  width: 280px;
  height: 280px;
  aspect-ratio: 1 / 1;
  padding: 16px;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.qr-modal-qr::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(99, 102, 241, 0) 60%);
}

.qr-modal-qr canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.qr-modal-hint {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

.qr-modal-hint strong {
  color: var(--ink);
  font-weight: 600;
}

.qr-modal-actions {
  display: flex;
  gap: 8px;
}

.qr-modal-actions .btn-primary,
.qr-modal-actions .btn-ghost {
  flex: 1;
  justify-content: center;
}

@media (max-width: 420px) {
  .qr-modal-qr {
    width: 240px;
    height: 240px;
  }
}

/* Segmented range selector */
.range-segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  align-self: flex-start;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.range-seg-btn {
  border: none;
  background: transparent;
  padding: 9px 16px;
  min-height: 38px;            /* comfortable touch target on mobile */
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.range-seg-btn:hover { color: var(--ink); }
.range-seg-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
.range-seg-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Top cards list — clickable */
.top-cards-clickable li {
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.15s ease;
  padding: 10px 10px;
  margin: 0 -10px;
}
.top-cards-clickable li:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}
.top-cards-clickable li:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.premium-simple-list li.clickable { cursor: pointer; }
.premium-simple-list li.clickable:hover {
  background: var(--surface-2);
  transform: translateX(2px);
}

/* ============================================================
   ANALYTICS VIEW — Premium redesign (world-class UI/UX)
   ============================================================ */

/* Range chip in the section head */
.analytics-range-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.analytics-range-chip svg { color: var(--muted); }

/* ===== Analytics metrics grid: 4 cards ===== */
.analytics-metrics {
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 20px;
}

@media (min-width: 900px) {
  .analytics-metrics {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

/* Color variant: Total */
.metric-card.premium-stat-card.total {
  --stat-color: #4f46e5;
  --stat-tint: rgba(79, 70, 229, 0.06);
}
.metric-card.premium-stat-card.total .metric-icon {
  background: rgba(79, 70, 229, 0.10);
  color: #4f46e5;
}

/* Premium polish on all analytics stat cards */
.analytics-metrics .premium-stat-card {
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 10px 28px rgba(15, 23, 42, 0.05);
}

.analytics-metrics .premium-stat-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 4px 8px rgba(15, 23, 42, 0.05),
    0 22px 48px rgba(15, 23, 42, 0.1);
  border-color: color-mix(in srgb, var(--stat-color, var(--accent)) 25%, transparent);
}

.analytics-metrics .premium-stat-card .metric-content {
  padding: 18px 18px 16px;
  gap: 16px;
  min-height: 158px;
}

.analytics-metrics .premium-stat-card .metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--stat-color, var(--accent)) 12%, var(--surface));
  color: var(--stat-color, var(--accent));
  position: relative;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--stat-color, var(--accent)) 12%, transparent),
    0 4px 10px color-mix(in srgb, var(--stat-color, var(--accent)) 18%, transparent);
}

/* Soft inner highlight + dot indicator */
.analytics-metrics .premium-stat-card .metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.analytics-metrics .premium-stat-card .metric-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stat-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stat-color, var(--accent)) 15%, transparent);
}

.analytics-metrics .premium-stat-card .metric-value {
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--ink) 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--ink);
}

.analytics-metrics .premium-stat-card .metric-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.analytics-metrics .premium-stat-card .metric-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.analytics-metrics .premium-stat-card .metric-footer-hint {
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: 0.02em;
}

/* Trend chip inside analytics stats */
.analytics-metrics .metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.analytics-metrics .metric-trend svg { width: 11px; height: 11px; }

/* ===== Chart card + series controls ===== */
.analytics-chart-card {
  margin-top: 4px;
  border-radius: 22px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}

.analytics-chart-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 22px;
}

.analytics-chart-card .card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.analytics-chart-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.series-pill {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  letter-spacing: 0.01em;
}

.series-pill:hover { color: var(--ink); }

.series-pill.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 4px 10px rgba(15, 23, 42, 0.05);
}

.series-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.series-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.series-dot.total { color: #4f46e5; background: #4f46e5; }
.series-dot.qr    { color: #2563eb; background: #2563eb; }
.series-dot.nfc   { color: #7c3aed; background: #7c3aed; }

/* Chart bars (premium, animated, tooltips) */
.analytics-chart-card .premium-chart {
  padding: 22px 22px 18px;
  min-height: 280px;
  position: relative;
}

.chart-grid {
  position: absolute;
  inset: 22px 22px 50px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
}

.chart-grid-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 12%, var(--border) 88%, transparent);
  opacity: 0.7;
}

.chart-bars {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  height: 220px;
  gap: 10px;
  padding-top: 14px;
}

@media (min-width: 600px) {
  .chart-bars { gap: 16px; height: 240px; }
  .analytics-chart-card .premium-chart { padding: 28px 28px 22px; }
  .chart-grid { inset: 28px 28px 52px 28px; }
}

.premium-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-chart-bar-wrap:hover { transform: translateY(-3px); }

.premium-chart-bar {
  width: 100%;
  max-width: 36px;
  min-height: 6px;
  background: linear-gradient(180deg, var(--stat-color, #4f46e5) 0%, color-mix(in srgb, var(--stat-color, #4f46e5) 55%, transparent) 100%);
  border-radius: 8px 8px 3px 3px;
  box-shadow:
    0 4px 10px color-mix(in srgb, var(--stat-color, #4f46e5) 22%, transparent),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -2px 0 color-mix(in srgb, var(--stat-color, #4f46e5) 50%, transparent);
  position: relative;
  transition: height 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              filter 0.2s ease,
              transform 0.2s ease;
}

.premium-chart-bar-wrap:hover .premium-chart-bar {
  filter: brightness(1.08) saturate(1.1);
  transform: scaleY(1.02);
  transform-origin: bottom;
}

/* Bar value pill (above bar) */
.chart-bar-value {
  position: absolute;
  top: -22px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.premium-chart-bar-wrap:hover .chart-bar-value,
.premium-chart-bar-wrap:focus-visible .chart-bar-value {
  opacity: 1;
  transform: translateY(0);
}

.premium-chart-day {
  margin-top: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.premium-chart-bar-wrap.is-today .premium-chart-day {
  color: var(--ink-2);
  position: relative;
}

.premium-chart-bar-wrap.is-today .premium-chart-day::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--stat-color, var(--accent));
}

/* Chart empty state */
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
  text-align: center;
  gap: 10px;
  color: var(--muted);
}

.chart-empty .chart-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
}

.chart-empty p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
}

/* ===== Top Taps card ===== */
.analytics-top-card {
  margin-top: 20px;
  border-radius: 22px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.analytics-top-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.analytics-top-card .card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.analytics-top-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.analytics-top-list {
  padding: 8px 8px 16px;
}

/* Each row */
.top-tap-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 14px;
  transition: background 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}

.top-tap-row + .top-tap-row { border-top: 1px solid var(--border); }

.top-tap-row:hover {
  background: var(--surface-2);
}

.top-tap-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.top-tap-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-tap-chevron {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.top-tap-row:hover .top-tap-chevron {
  background: var(--surface-3);
  color: var(--ink-2);
}

.top-tap-row.is-expanded .top-tap-chevron {
  transform: rotate(180deg);
  background: var(--accent);
  color: #fff;
}

/* Rank badge */
.top-tap-rank {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.top-tap-row[data-rank="1"] .top-tap-rank {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.top-tap-row[data-rank="2"] .top-tap-rank {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #334155;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.25);
}

.top-tap-row[data-rank="3"] .top-tap-rank {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
}

/* Main info */
.top-tap-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-tap-meta {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
}

.top-tap-tag-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.top-tap-tag-type.is-custom {
  background: rgba(100, 116, 139, 0.1);
  color: var(--muted);
}

.top-tap-progress {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.top-tap-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Right total */
.top-tap-total {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.top-tap-count {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--ink) 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-tap-count-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Empty state for top taps */
.top-taps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 12px;
  color: var(--muted);
}

.top-taps-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(99, 102, 241, 0.12) 100%);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-taps-empty h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-2);
}

.top-taps-empty p {
  margin: 0;
  font-size: 0.85rem;
  max-width: 280px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .analytics-chart-card .card-head { flex-direction: column; align-items: flex-start; }
  .top-tap-name { font-size: 0.9rem; max-width: 160px; }
  .top-tap-count { font-size: 1.1rem; }
}

/* ============================================================
   ANALYTICS v2 — Premium icons, range selector, per-tap drill-down
   ============================================================ */

/* ===== Section head: range selector (segmented) ===== */
.analytics-section-head {
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}

.analytics-range-seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  gap: 2px;
}

.analytics-range-seg .range-seg-btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.analytics-range-seg .range-seg-btn:hover { color: var(--ink); }

.analytics-range-seg .range-seg-btn.active {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.analytics-range-seg .range-seg-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .analytics-section-head { flex-direction: column; align-items: stretch; }
  .analytics-range-seg { width: 100%; justify-content: space-between; }
  .analytics-range-seg .range-seg-btn { flex: 1; padding: 8px 0; font-size: 0.82rem; }
}

/* ============================================================
   PER-TAP ANALYTICS DRILL-DOWN
   ============================================================ */
#singleTapAnalyticsDashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Sticky back bar (above the tap analytics view) =====
   Always visible on mobile scroll so the owner can leave the analytics
   drill-down without scrolling all the way back up. The wrapper itself
   has no background (would otherwise render as a white block); only
   the inner pill carries the surface color and shadow. */
.tap-analytics-back-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  margin: -6px -2px 0;
  padding: 4px 0;
  background: transparent;
}
.tap-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  color: var(--ink, #0f172a);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tap-back-pill:hover {
  color: var(--accent, #4f46e5);
  border-color: color-mix(in srgb, var(--accent, #4f46e5) 30%, var(--border, #e2e8f0));
  transform: translateX(-2px);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 6px 18px rgba(79, 70, 229, 0.14);
}
.tap-back-pill:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent, #4f46e5) 35%, transparent),
    0 4px 12px rgba(15, 23, 42, 0.05);
}
.tap-back-pill svg { transition: transform 0.15s ease; }
.tap-back-pill:hover svg { transform: translateX(-2px); }
@media (max-width: 540px) {
  .tap-analytics-back-bar { margin: -2px -2px 0; }
  .tap-back-pill { padding: 8px 12px 8px 8px; font-size: 0.8rem; }
}

/* ===== Tap hero (compact, premium) =====
   Replaces the old dark gradient hero + the two duplicated QR/NFC stat
   cards below. The name + tag-code chip live in a soft gradient panel;
   the QR / NFC / Total mini-stats are inline so the owner doesn't have
   to scroll to see totals. */
.tap-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  padding: 22px 22px 20px;
  background:
    radial-gradient(ellipse at 110% -10%, rgba(99, 102, 241, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at -10% 110%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border: 1px solid rgba(79, 70, 229, 0.14);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(79, 70, 229, 0.08);
  isolation: isolate;
}
.tap-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.tap-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.45;
}
.tap-hero__orb--a {
  width: 200px; height: 200px;
  top: -70px; right: -40px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.85) 0%, transparent 65%);
}
.tap-hero__orb--b {
  width: 160px; height: 160px;
  bottom: -60px; left: -30px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.7) 0%, transparent 65%);
}
.tap-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.tap-hero__meta {
  min-width: 0;
  flex: 1 1 240px;
}
.tap-hero__eyebrow {
  margin: 0 0 4px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent, #4f46e5) 90%, var(--ink, #0f172a));
}
.tap-hero__name {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.tap-hero__chip {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent, #4f46e5) 85%, var(--ink, #0f172a));
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tap-hero__stats {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px rgba(79, 70, 229, 0.08);
  backdrop-filter: blur(6px);
}
.tap-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 2px 6px;
}
.tap-stat__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}
.tap-stat__value {
  margin-top: 2px;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink, #0f172a);
  line-height: 1.05;
}
.tap-stat--qr  .tap-stat__value { color: #1d4ed8; }
.tap-stat--nfc .tap-stat__value { color: #6d28d9; }
.tap-stat--total .tap-stat__value { color: var(--accent, #4f46e5); }

.tap-hero__sep {
  width: 1px;
  background: linear-gradient(180deg,
    transparent,
    rgba(79, 70, 229, 0.18) 50%,
    transparent);
  margin: 4px 0;
  flex-shrink: 0;
}

@media (max-width: 540px) {
  .tap-hero { padding: 18px 16px 16px; border-radius: 18px; }
  .tap-hero__content { gap: 14px; }
  .tap-hero__name { font-size: 1.18rem; }
  .tap-hero__chip { font-size: 0.7rem; padding: 3px 9px; }
  .tap-hero__stats { padding: 8px 10px; gap: 8px; width: 100%; justify-content: space-between; }
  .tap-stat { min-width: 0; flex: 1; padding: 2px 4px; }
  .tap-stat__value { font-size: 1.1rem; }
  .tap-stat__label { font-size: 0.58rem; }
}
@media (max-width: 380px) {
  .tap-hero { padding: 16px 14px 14px; }
  .tap-hero__name { font-size: 1.05rem; }
  .tap-stat__value { font-size: 1rem; }
}

/* ===== Sticky range bar (segmented control + subtitle) ===== */
.tap-range-bar {
  position: sticky;
  top: 52px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 10px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface, #fff) 95%, transparent) 0%,
    color-mix(in srgb, var(--surface, #fff) 70%, transparent) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 70%, transparent);
}
.tap-range-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  flex-shrink: 0;
}

@media (max-width: 540px) {
  .tap-range-bar { top: 48px; flex-wrap: wrap; row-gap: 6px; }
  .tap-range-subtitle { font-size: 0.72rem; }
}


/* ===== Chart card ===== */
.analytics-chart-card {
  margin-top: 2px;
  padding: 18px 18px 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.analytics-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.analytics-chart-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.analytics-chart-head .muted {
  margin-top: 2px;
  font-size: 0.78rem;
}

.analytics-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.analytics-chart-legend .legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-left: 8px;
  display: inline-block;
}
.analytics-chart-legend .legend-dot:first-of-type { margin-left: 0; }
.analytics-chart-legend .legend-dot--qr  { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.analytics-chart-legend .legend-dot--nfc { background: linear-gradient(135deg, #a855f7, #6d28d9); }

.analytics-chart {
  padding: 8px 4px 4px;
  min-height: 280px;
  position: relative;
}

/* Per-tap activity table (replaces the SVG bar chart) */
.analytics-table-card {
  /* inherits .card / .analytics-chart-card shape */
}

.analytics-table-wrap {
  padding: 4px 20px 20px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.analytics-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
  color: var(--ink);
}

.analytics-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.analytics-table-th--num {
  text-align: right;
}

.analytics-table-th--total {
  width: 32%;
}

.analytics-table-legend {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.analytics-table-legend--qr {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.analytics-table-legend--nfc {
  background: linear-gradient(135deg, #a855f7, #6d28d9);
}

.analytics-table-row {
  transition: background-color 0.18s ease;
}

.analytics-table-row + .analytics-table-row .analytics-table-cell {
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.analytics-table-row:hover .analytics-table-cell {
  background-color: rgba(79, 70, 229, 0.04);
}

.analytics-table-cell {
  padding: 10px 12px;
  vertical-align: middle;
  background: transparent;
}

.analytics-table-cell--num {
  text-align: right;
  white-space: nowrap;
}

.analytics-table-cell--date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.analytics-table-date-primary {
  font-weight: 600;
  color: var(--ink);
}

.analytics-table-date-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: fit-content;
}

.analytics-table-pill {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.analytics-table-pill--qr {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.analytics-table-pill--nfc {
  background: linear-gradient(135deg, #a855f7, #6d28d9);
}

.analytics-table-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.analytics-table-cell--total {
  text-align: right;
}

.analytics-table-total-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
}

.analytics-table-bar {
  /* legacy class kept for safe removal; new style is .analytics-table-dot */
  display: none;
}

.analytics-table-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  /* size + opacity both react to --dot-pct so heavier days pop more */
  opacity: calc(0.35 + var(--dot-pct) * 0.0065);
  width: calc(6px + var(--dot-pct) * 0.04px);
  height: calc(6px + var(--dot-pct) * 0.04px);
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.12);
  flex: 0 0 auto;
}

.analytics-table-row.is-zero .analytics-table-dot {
  display: none;
}

.analytics-table-row.is-today .analytics-table-dot {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.analytics-table-row.is-today .analytics-table-cell {
  background: rgba(79, 70, 229, 0.07);
}

.analytics-table-row.is-today .analytics-table-cell:first-child {
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.analytics-table-row.is-zero .analytics-table-num {
  color: var(--muted);
}

.analytics-table-row.is-today .analytics-table-num {
  color: var(--ink);
}

.analytics-table tfoot .analytics-table-cell {
  background: rgba(15, 23, 42, 0.03);
  border-top: 2px solid var(--border);
  padding-top: 12px;
  padding-bottom: 12px;
}

.analytics-table tfoot .analytics-table-cell:first-child {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-table tfoot .analytics-table-num {
  font-size: 0.95rem;
}

@media (max-width: 560px) {
  .analytics-table-wrap {
    padding: 4px 14px 16px;
  }
  .analytics-table {
    font-size: 0.82rem;
  }
  .analytics-table thead th {
    padding: 9px 8px;
    font-size: 0.66rem;
  }
  .analytics-table-cell {
    padding: 9px 8px;
  }
  .analytics-table-bar {
    width: 56px;
    display: none;
  }
  .analytics-table-th--total {
    width: 28%;
  }
}
}

/* ===== Premium activity timeline ===== */
/* Replaces both the old 'Activity by day' table and the separate 'Last
 * scans' panel. Days are stacked vertically as expandable header cards;
 * inside each, the individual scans render as a vertical timeline with
 * a colored rail, the wall-clock time in AM/PM, a QR/NFC pill, country
 * flag + IP. Built mobile-first because most owners open the dashboard
 * from their phone the moment a customer leaves a bad review.
 */

.activity-timeline-card {
  margin-top: 14px;
}

.activity-timeline-wrap {
  padding: 4px 4px 12px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.2) transparent;
}
.activity-timeline-wrap::-webkit-scrollbar { width: 8px; }
.activity-timeline-wrap::-webkit-scrollbar-track { background: transparent; }
.activity-timeline-wrap::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}
.activity-timeline-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.28);
}

/* Timezone badge on the card header — confirms to the owner that the
 * displayed times are the business's wall-clock, not their own TZ. */
.activity-timeline-tz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #4f46e5) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #4f46e5) 22%, transparent);
  color: var(--accent, #4f46e5);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.activity-timeline-tz-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.activity-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== Per-day card ===== */
.activity-day {
  position: relative;
  border-radius: 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 14px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.activity-day:hover {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 8px 22px rgba(15, 23, 42, 0.08);
}

.activity-day-header {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent, #4f46e5) 4%, var(--surface, #fff)) 0%,
    var(--surface, #fff) 100%);
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  outline: none;
}
.activity-day-header:hover {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent, #4f46e5) 7%, var(--surface, #fff)) 0%,
    var(--surface, #fff) 100%);
}
.activity-day-header:focus-visible {
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent, #4f46e5) 40%, transparent);
}
.activity-day-header.is-collapsed {
  border-bottom-color: transparent;
}
.activity-day-header.is-today {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent, #4f46e5) 10%, var(--surface, #fff)) 0%,
    var(--surface, #fff) 100%);
}

.activity-day-header__rail {
  display: flex;
  justify-content: center;
  align-items: center;
}

.activity-day-header__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border, #cbd5e1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--border, #cbd5e1) 30%, transparent);
}
.activity-day-header__dot.is-today {
  background: var(--accent, #4f46e5);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #4f46e5) 22%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #4f46e5) 22%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent, #4f46e5) 8%, transparent); }
}

.activity-day-header__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.activity-day-header__row1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.activity-day-header__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.activity-day-today-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent, #4f46e5);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.activity-day-header__row2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
}
.activity-day-header__date { font-weight: 500; }
.activity-day-header__sep  { opacity: 0.6; }
.activity-day-header__count { font-weight: 700; color: var(--ink, #0f172a); }
.activity-day-header__split {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.activity-day-header__split--qr  { background: rgba(37, 99, 235, 0.12);  color: #2563eb; }
.activity-day-header__split--nfc { background: rgba(124, 58, 237, 0.14); color: #7c3aed; }

.activity-day-header__chevron {
  color: var(--muted, #94a3b8);
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}
.activity-day-header.is-collapsed .activity-day-header__chevron {
  transform: rotate(-90deg);
  color: var(--ink, #475569);
}
.activity-day-header:hover .activity-day-header__chevron {
  color: var(--ink, #0f172a);
}

/* ===== Per-scan rows inside a day ===== */
.activity-day-body {
  padding: 4px 16px 14px 16px;
  border-top: 1px dashed var(--border, #e2e8f0);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent, #4f46e5) 1.5%, var(--surface, #fff)) 0%,
    var(--surface, #fff) 100%);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scan-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 0 10px 0;
  border-radius: 8px;
  outline: none;
  cursor: default;
  transition: background 0.15s ease;
}
.scan-row:hover { background: rgba(15, 23, 42, 0.025); }
.scan-row:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent, #4f46e5) 40%, transparent);
}
.scan-row + .scan-row {
  border-top: 1px dashed rgba(15, 23, 42, 0.06);
}

/* Vertical rail on the left of each scan, with a colored dot per channel. */
.scan-row__rail {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2px;
}
.scan-row__rail::before {
  /* The connector line that visually links each scan under the day dot. */
  content: '';
  position: absolute;
  top: 0;
  bottom: -10px;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--accent, #4f46e5) 28%, transparent) 0%,
    color-mix(in srgb, var(--accent, #4f46e5) 8%, transparent) 100%);
  transform: translateX(-50%);
}
.scan-row:last-child .scan-row__rail::before { display: none; }
.scan-row__dot {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent, #4f46e5);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #4f46e5) 10%, transparent);
}
.scan-row__dot--qr  { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.scan-row__dot--nfc { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); }
.scan-row__dot--red { border-color: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1); }

.scan-row__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.scan-row__time-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.scan-row__time {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.scan-row__date {
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  font-weight: 500;
}

.scan-row__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
}
.scan-row__ip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--ink, #475569);
}
.scan-row__ip svg { opacity: 0.6; }

/* Scan pill (shared with the old code) */
.scan-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}
.scan-pill--qr  { background: rgba(37, 99, 235, 0.12);  color: #2563eb; }
.scan-pill--nfc { background: rgba(124, 58, 237, 0.14); color: #7c3aed; }
.scan-pill--red { background: rgba(15, 23, 42, 0.08);   color: var(--ink, #0f172a); }

/* ===== Range total footer ===== */
.activity-timeline-footer {
  display: flex;
  gap: 24px;
  padding: 12px 16px 4px;
  margin-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.activity-timeline-footer__col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-timeline-footer__label {
  font-size: 0.66rem;
  color: var(--muted, #94a3b8);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.activity-timeline-footer__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  font-variant-numeric: tabular-nums;
}
.activity-timeline-footer__value--qr  { color: #2563eb; }
.activity-timeline-footer__value--nfc { color: #7c3aed; }

/* ===== Mobile (≤560px) ===== */
@media (max-width: 560px) {
  .activity-timeline-wrap { padding: 4px 2px 8px; }
  .activity-day-header { padding: 12px 14px; }
  .activity-day-header__title { font-size: 0.92rem; }
  .activity-day-header__row2 { font-size: 0.72rem; gap: 4px 8px; }
  .activity-day-body { padding: 4px 12px 12px; }
  .scan-row__time { font-size: 0.98rem; }
  .scan-row__date { font-size: 0.72rem; }
  .scan-row__meta { font-size: 0.72rem; gap: 6px 10px; }
  .activity-timeline-footer { gap: 18px; padding: 12px 14px 4px; }
  .activity-timeline-tz-badge { font-size: 0.66rem; padding: 3px 8px; }
}

.premium-tap-chart {
  width: 100%;
  height: auto;
  display: block;
  font-family: inherit;
}

.premium-tap-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.7;
}

.premium-tap-axis {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-anchor: end;
}

.premium-tap-value {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  pointer-events: none;
}

.premium-tap-bar {
  transition: filter 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}
.premium-tap-bar--qr.is-today,
.premium-tap-bar--nfc.is-today {
  filter: drop-shadow(0 4px 10px rgba(79, 70, 229, 0.35));
}

.premium-tap-bar:hover {
  filter: brightness(1.08) saturate(1.1);
}

.premium-tap-empty {
  fill: var(--border);
}

.premium-tap-hover {
  fill: rgba(0,0,0,0);
  cursor: pointer;
}
.premium-tap-hover:hover ~ .premium-tap-value {
  fill: var(--accent);
}

@media (max-width: 540px) {
  .analytics-chart { min-height: 220px; }
  .premium-tap-chart { height: 220px; }
}

/* ===== Premium icon polish (deeper, layered) ===== */
.analytics-metrics .premium-stat-card .metric-icon {
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--stat-color, var(--accent)) 22%, transparent) 0%, transparent 70%),
    color-mix(in srgb, var(--stat-color, var(--accent)) 10%, var(--surface));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--stat-color, var(--accent)) 18%, transparent),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    0 6px 14px color-mix(in srgb, var(--stat-color, var(--accent)) 22%, transparent);
}

.analytics-metrics .ic-premium {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
}

/* ===== Top Taps — premium row with business name + split ===== */
.top-tap-row {
  grid-template-columns: 34px 1fr auto;
  gap: 16px;
}

.top-tap-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.top-tap-rank {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 0.9rem;
}

.top-tap-business {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-tap-business::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--stat-color, var(--accent));
  opacity: 0.6;
  flex-shrink: 0;
}

.top-tap-meta {
  gap: 8px;
  flex-wrap: wrap;
}

.top-tap-code {
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--muted-2);
  font-weight: 500;
}

.top-tap-split {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.top-tap-split .split-qr { color: #2563eb; }
.top-tap-split .split-nfc { color: #7c3aed; }
.top-tap-split .split-sep { color: var(--muted-2); opacity: 0.7; }

.top-tap-progress {
  position: relative;
  height: 8px;
  margin-top: 12px;
}

.top-tap-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  z-index: 1;
}

.top-tap-split-bar {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  overflow: hidden;
}

.top-tap-split-bar .split-bar-qr {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, rgba(37, 99, 235, 0.4) 100%);
  border-radius: inherit;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Top tap drill-down panel ===== */
.top-tap-row.is-expanded {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.035) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  cursor: default;
  display: grid;
  grid-template-areas:
    "rank main total"
    "detail detail detail";
  grid-template-rows: auto auto;
}

.top-tap-row.is-expanded .top-tap-rank  { grid-area: rank; }
.top-tap-row.is-expanded .top-tap-main  { grid-area: main; }
.top-tap-row.is-expanded .top-tap-right { grid-area: total; }

.top-tap-detail {
  grid-area: detail;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(79, 70, 229, 0.18);
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.top-tap-detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
}

.top-tap-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tt-detail-info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.tt-detail-chip svg { color: var(--muted); }

.tt-detail-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 560px) {
  .tt-detail-mini-stats { grid-template-columns: repeat(4, 1fr); }
}

.tt-mini-stat {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
}

.tt-mini-stat .tt-mini-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  line-height: 1;
}

.tt-mini-stat .tt-mini-label {
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.tt-mini-stat.qr { border-color: rgba(37, 99, 235, 0.18); }
.tt-mini-stat.qr .tt-mini-value { color: #2563eb; }
.tt-mini-stat.nfc { border-color: rgba(124, 58, 237, 0.18); }
.tt-mini-stat.nfc .tt-mini-value { color: #7c3aed; }
.tt-mini-stat.redirect { border-color: rgba(234, 88, 12, 0.18); }
.tt-mini-stat.redirect .tt-mini-value { color: #ea580c; }

.tt-detail-chart {
  display: flex;
  align-items: flex-end;
  height: 90px;
  gap: 5px;
  padding: 4px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px 6px;
  background: linear-gradient(180deg, rgba(79,70,229,0.025) 0%, transparent 100%);
  overflow-x: auto;
}

.tt-bar-wrap {
  flex: 1;
  min-width: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}

.tt-bar {
  width: 100%;
  max-width: 18px;
  min-height: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(79, 70, 229, 0.5) 100%);
  border-radius: 4px 4px 1px 1px;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.tt-bar-label {
  font-size: 0.6rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tt-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-detail-action {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.tt-detail-action:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.tt-detail-action:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ===== Mobile premium tuning ===== */
@media (max-width: 480px) {
  .analytics-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .analytics-metrics .premium-stat-card .metric-content {
    padding: 14px 14px 12px;
    min-height: 138px;
    gap: 12px;
  }
  .analytics-metrics .premium-stat-card .metric-value { font-size: 1.75rem; }
  .analytics-metrics .premium-stat-card .metric-icon { width: 36px; height: 36px; border-radius: 10px; }
  .analytics-metrics .premium-stat-card .metric-icon svg { width: 19px; height: 19px; }
  .analytics-metrics .premium-stat-card .metric-footer { font-size: 0.66rem; padding-top: 8px; }

  .analytics-chart-card .premium-chart { padding: 16px 14px 14px; min-height: 230px; }
  .chart-grid { inset: 16px 14px 46px 14px; }
  .chart-bars { gap: 6px; height: 200px; padding-top: 10px; }
  .premium-chart-bar { max-width: 26px; border-radius: 6px 6px 2px 2px; }
  .premium-chart-day { font-size: 0.64rem; margin-top: 6px; }

  .chart-bars-compact .premium-chart-bar { max-width: 14px; }
  .chart-bars-compact .premium-chart-day { transform: rotate(-45deg); transform-origin: center top; }

  .analytics-top-card .card-head { padding: 16px 16px 12px; }
  .analytics-top-list { padding: 6px 6px 12px; }
  .top-tap-row { padding: 12px; gap: 12px; }
  .top-tap-rank { width: 28px; height: 28px; font-size: 0.78rem; border-radius: 9px; }
  .top-tap-name { font-size: 0.92rem; }
  .top-tap-business { font-size: 0.74rem; }
  .top-tap-meta { gap: 6px; font-size: 0.7rem; }
  .top-tap-code { font-size: 0.68rem; }
  .top-tap-split { font-size: 0.68rem; }
  .top-tap-count { font-size: 1.1rem; }
  .top-tap-count-label { font-size: 0.62rem; }

  .tt-detail-mini-stats { grid-template-columns: repeat(3, 1fr); }
  .tt-mini-stat { padding: 8px 10px; }
  .tt-mini-stat .tt-mini-value { font-size: 1rem; }
  .tt-mini-stat .tt-mini-label { font-size: 0.6rem; }
  .tt-detail-chart { height: 72px; gap: 3px; padding: 6px 4px 4px; }
  .tt-bar-wrap { min-width: 14px; }
  .tt-bar { max-width: 14px; }
  .tt-bar-label { font-size: 0.56rem; }
}

/* Premium chart compact (30d/90d)-horizontal scroll */
.chart-bars-compact { min-width: 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.chart-bars-compact::-webkit-scrollbar { height: 6px; }
.chart-bars-compact::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

@media (max-width: 480px) and (max-height: 700px) {
  .chart-bars { height: 170px; }
}

@media (min-width: 900px) {
  .analytics-metrics .premium-stat-card .metric-value { font-size: 2.3rem; }
  .analytics-metrics .premium-stat-card .metric-content { min-height: 170px; }
}

/* iOS Safari auto-zooms any focused input whose computed font-size is < 16px.
   Force every text-entry control to 16px on iOS to keep the viewport stable
   across the whole app (claim modal, settings fields, OTP, etc.). */
@supports (-webkit-touch-callout: none) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* ============================================================
   ANALYTICS v3 — Premium semantic icons (clean, recognizable)
   ============================================================ */

/* Total: hand-pointer + ripples (touch) */
.analytics-metrics .premium-stat-card.total .metric-icon svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* QR: simplified QR with finder corners */
.analytics-metrics .premium-stat-card.qr .metric-icon svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* NFC: clean wave + chip */
.analytics-metrics .premium-stat-card.nfc .metric-icon svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Active: tag with check */
.analytics-metrics .premium-stat-card.tags .metric-icon svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Empty state polish */
.chart-empty {
  gap: 14px;
}

.chart-empty .chart-empty-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(99, 102, 241, 0.12) 100%);
  color: var(--accent);
}

.chart-empty h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-2);
}

.chart-empty p {
  max-width: 280px;
  line-height: 1.5;
}

.settings-view {
  width: 100%;
  max-width: 940px;
}

.settings-head {
  margin-bottom: 2px;
}

.review-alert-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  isolation: isolate;
}

.review-alert-card__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}

.review-alert-card__orb--one {
  width: 220px;
  height: 220px;
  top: -150px;
  right: -45px;
  background: radial-gradient(circle, rgba(251, 188, 5, 0.24), transparent 68%);
}

.review-alert-card__orb--two {
  width: 180px;
  height: 180px;
  top: 20px;
  left: -125px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 68%);
}

.review-alert-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 88% -20%, rgba(251, 188, 5, 0.22), transparent 36%),
    linear-gradient(135deg, #1e1b4b 0%, #3730a3 55%, #4f46e5 100%);
}

.review-alert-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  color: #fef3c7;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.review-alert-icon svg {
  width: 27px;
  height: 27px;
}

.review-alert-heading {
  min-width: 0;
}

.review-alert-eyebrow {
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.review-alert-heading h3 {
  margin: 0;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.review-alert-heading > p:last-child {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.84rem;
  line-height: 1.4;
}

.review-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.review-alert-badge > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
}

.review-alert-badge.is-active > span:first-child {
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.15);
}

.review-alert-badge.is-paused > span:first-child {
  background: #fbbf24;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.14);
}

.review-alert-form {
  padding: 22px 24px 24px;
}

.review-alert-master {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--border);
}

.review-alert-master__copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.review-alert-channel-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
}

.review-alert-channel-icon svg {
  width: 20px;
  height: 20px;
}

.review-alert-master__title {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.review-alert-master__desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.4;
}

.review-alert-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.18s ease, transform 0.1s ease;
}

.review-alert-switch:active { transform: scale(0.97); }

.review-alert-switch:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.22);
  outline-offset: 2px;
  border-radius: 999px;
}

.review-alert-switch[aria-checked="true"] {
  color: var(--success);
}

.review-alert-switch[aria-disabled="true"] {
  cursor: wait;
  opacity: 0.6;
}

.review-alert-switch__track {
  position: relative;
  width: 48px;
  height: 28px;
  padding: 3px;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.review-alert-switch[aria-checked="true"] .review-alert-switch__track {
  background: var(--success);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.review-alert-switch__track > span:first-child {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  transition: transform 0.24s cubic-bezier(.4, 0, .2, 1);
}

.review-alert-switch[aria-checked="true"] .review-alert-switch__track > span:first-child {
  transform: translateX(20px);
}

.review-alert-switch__status {
  min-width: 28px;
  text-align: left;
}

.review-alert-switch[aria-disabled="true"] .review-alert-switch__status {
  opacity: 0.5;
}

.review-alert-details {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 22px;
  transition: opacity 0.2s ease;
}

.review-alert-details.is-disabled > :not(.review-alert-summary) {
  opacity: 0.5;
}

.review-alert-field label,
.review-alert-threshold legend {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.review-alert-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.review-alert-field-head label {
  margin: 0;
}

.review-alert-counter {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.review-alert-counter.is-full {
  color: var(--error);
}

.review-alert-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.review-alert-chips:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.11);
}

.review-alert-chips[data-placeholder="true"]::before {
  content: attr(data-placeholder-text, "");
}

.review-alert-chips.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: review-alert-shake 0.32s cubic-bezier(.4, 0, .2, 1);
}

.review-alert-chips.is-disabled {
  background: var(--surface-2);
}

@keyframes review-alert-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.review-alert-chip-list {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-alert-chip-list > li {
  display: list-item;
}

.review-alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.07);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  animation: review-alert-chip-in 0.18s ease;
}

@keyframes review-alert-chip-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.review-alert-chip__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
}

.review-alert-chip__label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.review-alert-chip__remove {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  font: inherit;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.review-alert-chip__remove:hover,
.review-alert-chip__remove:focus-visible {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  outline: none;
}

.review-alert-chip__remove svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.review-alert-chip--owner .review-alert-chip__avatar {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.review-alert-chip--owner::before {
  content: "Owner";
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#reviewAlertEmailInput {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  margin-top: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#reviewAlertEmailInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.11);
}

#reviewAlertEmailInput::placeholder {
  color: var(--muted-2);
}

#reviewAlertEmailInput:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-2);
}

.review-alert-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.review-alert-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.4;
}

.review-alert-threshold {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.review-alert-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.review-alert-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.review-alert-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.review-alert-option__surface {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.review-alert-option:hover .review-alert-option__surface {
  border-color: rgba(79, 70, 229, 0.32);
  transform: translateY(-1px);
}

.review-alert-option input:checked + .review-alert-option__surface {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.045);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.09);
}

.review-alert-option input:focus-visible + .review-alert-option__surface {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-alert-option input:disabled + .review-alert-option__surface {
  cursor: not-allowed;
  transform: none;
}

.review-alert-option__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.review-alert-option__top strong {
  color: var(--ink);
  font-size: 0.79rem;
  line-height: 1.2;
}

.review-alert-option__top > span {
  padding: 3px 5px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.review-alert-option__stars {
  color: #fbbc05;
  font-size: 0.94rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.review-alert-option__stars i {
  color: #dbe1e8;
  font-style: normal;
}

.review-alert-option small {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.3;
}

.review-alert-summary {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: 12px;
  color: var(--ink-2);
  background: rgba(79, 70, 229, 0.045);
}

.review-alert-summary__icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.09);
}

.review-alert-summary__icon svg {
  width: 15px;
  height: 15px;
}

.review-alert-summary p {
  font-size: 0.76rem;
  line-height: 1.4;
}

.review-alert-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.review-alert-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.review-alert-status.ok {
  color: #047857;
}

.review-alert-status.err {
  color: #b91c1c;
}

.review-alert-save {
  flex: 0 0 auto;
  min-width: 164px;
}

.settings-account-card {
  margin-top: 2px;
}

.settings-card-title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 760px) {
  .review-alert-summary {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .review-alert-chip { font-size: 0.74rem; }
  .review-alert-chip__label { max-width: 140px; }
}

@media (max-width: 560px) {
  .settings-head {
    padding-top: 0;
  }

  .review-alert-card {
    border-radius: 18px;
  }

  .review-alert-header {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 20px 18px;
  }

  .review-alert-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .review-alert-icon svg {
    width: 23px;
    height: 23px;
  }

  .review-alert-heading h3 {
    font-size: 1.08rem;
  }

  .review-alert-badge {
    grid-column: 2;
    justify-self: start;
    margin-top: -3px;
    padding: 5px 9px;
    font-size: 0.66rem;
  }

  .review-alert-form {
    padding: 19px 17px 20px;
  }

  .review-alert-master {
    gap: 12px;
    padding-bottom: 18px;
  }

  .review-alert-channel-icon {
    display: none;
  }

  .review-alert-master__desc {
    max-width: 220px;
  }

  .review-alert-details {
    gap: 20px;
    padding-top: 19px;
  }

  .review-alert-options {
    grid-template-columns: 1fr;
  }

  .review-alert-option__surface {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 12px 13px;
  }

  .review-alert-option__top {
    grid-column: 1;
  }

  .review-alert-option__stars {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .review-alert-option small {
    grid-column: 1;
  }

  .review-alert-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .review-alert-save {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-alert-switch__track,
  .review-alert-switch__track > span,
  .review-alert-details,
  .review-alert-option__surface {
    transition: none;
  }
}

/* Star-threshold picker (compact, replaces the old 3-card grid) */
.review-alert-stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 4px 4px;
}

.review-alert-star {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #cbd5e1;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.review-alert-star svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.review-alert-star svg path {
  fill: transparent;
  stroke: currentColor;
}

.review-alert-star:hover:not(:disabled) {
  border-color: rgba(79, 70, 229, 0.32);
  transform: translateY(-1px);
}

.review-alert-star:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-alert-star:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.review-alert-star.is-active,
.review-alert-star.is-partial {
  color: #fbbc05;
}

.review-alert-star.is-active {
  background: rgba(251, 188, 5, 0.12);
  border-color: rgba(251, 188, 5, 0.55);
}

.review-alert-threshold__scale {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 6px 4px 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
