/* Light theme is the default. Every colour the app uses is a token here, so
   dark mode is a matter of redefining tokens rather than chasing hardcoded
   hex values through the stylesheet. */
:root {
  --teal: #1F4E5F;          /* headings, links, brand text */
  --teal-dark: #163942;
  --brand-panel: #1F4E5F;   /* solid brand blocks (topbar, hero panel) */
  --brand-panel-ink: #ffffff;
  --amber: #FFC93C;
  --amber-dark: #F0A500;
  --green: #3DBE8B;

  --bg: #FFF9F0;            /* page background */
  --surface: #ffffff;       /* cards */
  --surface-alt: #FFF9F0;   /* insets: inputs, code, chips */
  --cream: #FFF9F0;         /* kept for older rules */

  --ink: #2B2118;
  --ink-muted: #6b5f52;
  --border: #e8ddc9;

  --ok-bg: #e8f9f1;
  --bad-bg: #fde8e4;
  --bad-border: #c94b3d;
  --info-bg: #fff3d6;
  --warn-ink: #a8442f;
  --highlight-bg: #fffaf0; /* softly emphasised cards */
  --muted-ink: #7a6e60;

  --btn-bg: #1F4E5F;
  --btn-ink: #ffffff;
  /* Text on panels that stay light in BOTH themes (amber, silver badges). */
  --on-light: #2B2118;
  --amber-text: #8a5d00;  /* amber, dark enough to read as text */

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  color-scheme: light;
}

/* Dark theme. Applied when the visitor picks it explicitly (data-theme="dark")
   or when their OS prefers dark and they haven't overridden it. */
:root[data-theme="dark"] {
  --teal: #6ec5db;
  --teal-dark: #8ed6e8;
  --brand-panel: #10333d;
  --brand-panel-ink: #f3ece2;
  --amber: #FFC93C;
  --amber-dark: #ffb627;
  --green: #4fd39c;

  --bg: #16120f;
  --surface: #221b16;
  --surface-alt: #1b1511;
  --cream: #1b1511;

  --ink: #f3ece2;
  --ink-muted: #a9998a;
  --border: #3b3029;

  --ok-bg: #16382b;
  --bad-bg: #3d201a;
  --bad-border: #c9604f;
  --info-bg: #3a2e14;
  --warn-ink: #ffa48f;
  --highlight-bg: #2a2018;
  --muted-ink: #9a8b7b;
  --btn-bg: #6ec5db;
  --btn-ink: #10262d;
  --on-light: #2B2118;
  --amber-text: #ffb627;

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --teal: #6ec5db;
    --teal-dark: #8ed6e8;
    --brand-panel: #10333d;
    --brand-panel-ink: #f3ece2;
    --amber-dark: #ffb627;
    --green: #4fd39c;

    --bg: #16120f;
    --surface: #221b16;
    --surface-alt: #1b1511;
    --cream: #1b1511;

    --ink: #f3ece2;
    --ink-muted: #a9998a;
    --border: #3b3029;

    --ok-bg: #16382b;
    --bad-bg: #3d201a;
    --bad-border: #c9604f;
    --info-bg: #3a2e14;
    --warn-ink: #ffa48f;
    --highlight-bg: #2a2018;
    --muted-ink: #9a8b7b;
    --btn-bg: #6ec5db;
    --btn-ink: #10262d;
    --on-light: #2B2118;
    --amber-text: #ffb627;

    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--teal); }

.topbar {
  background: var(--brand-panel);
  color: var(--brand-panel-ink);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.12); color: white; }

.nav-link--active {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.container--narrow { max-width: 620px; }

.page-head { margin-bottom: 20px; }

.page-head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 1.7rem;
  color: var(--teal);
  letter-spacing: -0.02em;
}

.form-title { margin: 0 0 16px; font-size: 1.25rem; color: var(--teal); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.card-head h2, .card-head h3 { margin: 0; }

.banner {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 18px;
  border: 2px solid;
}

.banner--ok { background: var(--ok-bg); border-color: var(--green); }
.banner--bad { background: var(--bad-bg); border-color: var(--bad-border); }
.banner--info { background: var(--info-bg); border-color: var(--amber-dark); }

/* Landing page */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 40px;
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--teal);
  letter-spacing: -0.03em;
}

.hero-sub { font-size: 1.05rem; line-height: 1.6; color: var(--ink-muted); margin: 0 0 22px; }

.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.hero-note { font-size: 0.82rem; color: var(--ink-muted); margin-top: 16px; }

.hero-card {
  background: var(--brand-panel);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-visual {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  width: 100%;
  text-align: center;
  border: 3px solid var(--amber);
}

.chip-visual-label { font-weight: 700; color: var(--teal); margin-bottom: 8px; }
.chip-visual-wave { color: var(--amber-dark); font-size: 1.8rem; letter-spacing: 3px; margin-bottom: 10px; }
.chip-visual-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--ink-muted);
  word-break: break-all;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.feature h3 { margin: 0 0 8px; color: var(--teal); font-size: 1.05rem; }
.feature p { margin: 0; color: var(--ink-muted); font-size: 0.9rem; line-height: 1.55; }

.cta-band {
  color: var(--on-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--amber);
  border-color: var(--amber-dark);
}

.cta-band h2 { margin: 0 0 4px; }

.steps { list-style: none; padding: 0; margin: 0 0 20px; }

.step { display: flex; gap: 18px; align-items: flex-start; }

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-panel);
  color: var(--brand-panel-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.step h3 { margin: 4px 0 6px; color: var(--teal); font-size: 1.05rem; }
.step p { margin: 0; color: var(--ink-muted); line-height: 1.6; }

.faq h3 { margin: 0 0 8px; color: var(--teal); font-size: 1rem; }
.faq p { margin: 0 0 8px; color: var(--ink-muted); line-height: 1.6; font-size: 0.92rem; }

.footer-links { margin-top: 8px; }
.footer-links a { color: var(--teal); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 12px; }

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: top;
}

.data-table .num { text-align: right; font-weight: 700; color: var(--teal); }
.data-table th.num { text-align: right; }
.data-table code {
  background: var(--surface-alt);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.card-list { list-style: none; margin: 12px 0 0; padding: 0; }

.card-list li {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 12px 0 16px;
  font-size: 0.92rem;
}

.detail-list dt { color: var(--ink-muted); font-weight: 600; }
.detail-list dd { margin: 0; }

.card-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-detail-head h3 { margin: 0 0 4px; color: var(--teal); }
.card-detail-taps { text-align: right; display: flex; flex-direction: column; }
.card-detail-taps .kpi-value { font-size: 1.6rem; }

.inline-edit { display: flex; gap: 10px; margin: 12px 0 8px; flex-wrap: wrap; }

.inline-edit input {
  flex: 1;
  min-width: 240px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface-alt);
  color: var(--ink);
}

.tap-url-input--wide { max-width: 100%; }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-ghost {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 2px;
}

.pill-admin { background: var(--brand-panel); color: var(--brand-panel-ink); }

/* Plans */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.plan-card { margin-bottom: 0; }

.plan-card--current {
  border-color: var(--amber-dark);
  background: var(--highlight-bg);
}

.plan-card h3 { margin: 0; color: var(--teal); font-size: 1.1rem; }

.plan-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--teal);
  margin: 6px 0;
}

.plan-price span { font-size: 0.85rem; font-weight: 600; color: var(--ink-muted); }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  font-size: 0.85rem;
}

.plan-features li {
  padding: 5px 0;
  border-top: 1px solid var(--border);
  color: var(--ink);
}

.plan-features li.no { color: var(--muted-ink); }
.plan-features li.yes { color: var(--ink); }

/* Locked / upsell panels */
.locked {
  background: repeating-linear-gradient(
    45deg, var(--surface), var(--surface) 12px, var(--highlight-bg) 12px, var(--highlight-bg) 24px
  );
  border-style: dashed;
  position: relative;
}

.locked-badge {
  display: inline-block;
  background: var(--amber);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.locked h2 { color: var(--ink-muted); }

.link-btn--danger { color: var(--bad-border); }

.topbar-inner .business-id { margin-left: auto; }

.wordmark {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark span { color: var(--amber); }

.business-id {
  display: flex;
  align-items: center;
  gap: 10px;
}

.business-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.tier-badge {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.tier-gold { background: var(--amber); color: var(--on-light); }
.tier-silver { background: #d9dfe2; color: var(--on-light); }
.tier-bronze { background: #c98552; color: #ffffff; }

.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
}

.kpi-estimate {
  border-color: var(--amber-dark);
  background: var(--highlight-bg);
}

.kpi-estimate .kpi-value { color: var(--amber-text); }

.kpi-footnote {
  font-size: 0.72rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--teal);
}

.muted { color: var(--ink-muted); font-weight: 400; font-size: 0.85rem; }

.chart-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .chart-row { grid-template-columns: 1fr; }
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 200px;
  margin-top: 20px;
  padding-top: 10px;
}

.bar-chart--hourly { gap: 3px; }

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.bar {
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, var(--green), #2fa878);
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
  transition: height 0.2s ease;
}

.bar--hour {
  max-width: 14px;
  background: linear-gradient(180deg, var(--amber), var(--amber-dark));
  border-radius: 4px 4px 2px 2px;
}

.bar-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 4px;
}

.bar-label {
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-top: 6px;
  white-space: nowrap;
}

.bar-label--hour { font-size: 0.6rem; }

.card-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.card-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}

.card-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.card-table .num { text-align: right; font-weight: 700; color: var(--teal); }
.card-table th.num { text-align: right; }

.card-table code {
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-active { background: var(--green); }
.status-inactive { background: #c9c0b3; }

.page-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

/* Admin page */
.admin-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.form-field input,
.form-field select {
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface-alt);
  color: var(--ink);
}

.btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--teal-dark); }

.btn-amber { background: var(--amber-dark); color: var(--on-light); }
.btn-amber:hover { background: var(--amber); }

.business-block {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.business-block h3 {
  margin: 0 0 4px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
}

.business-block ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.business-block li {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.dashboard--narrow { max-width: 620px; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form { display: inline; margin: 0; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--teal);
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover { color: var(--amber-dark); }

.btn-cancel {
  display: inline-block;
  margin-left: 12px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

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

.form-field--check label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}

.form-field--check input { width: auto; }

.warn-text {
  font-size: 0.78rem;
  color: var(--warn-ink);
  line-height: 1.4;
}

/* Auth pages */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-shell { width: 100%; max-width: 420px; }

.auth-wordmark {
  display: block;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--teal);
  text-decoration: none;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.auth-wordmark span { color: var(--amber-dark); }

.auth-card { padding: 28px; margin-bottom: 0; }

.auth-card h1 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  color: var(--teal);
}

.auth-card .muted { display: block; margin-bottom: 18px; }

.auth-error {
  background: var(--bad-bg);
  border: 2px solid var(--bad-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.btn-block { width: 100%; margin-top: 4px; }

.auth-alt {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 18px 0 0;
}

.user-chip {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: white;
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.logout-btn:hover { background: rgba(255, 255, 255, 0.15); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--teal);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
  z-index: 100;
}

.skip-link:focus { left: 0; }

/* Visible keyboard focus everywhere — the default outline disappears against
   the teal topbar, which made the nav unusable by keyboard. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Account dropdown */
.account-menu { position: relative; }

.avatar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--brand-panel-ink);
  font: inherit;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber);
  color: #2B2118;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.avatar-caret { font-size: 0.65rem; opacity: 0.8; }

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 260px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  z-index: 60;
  overflow: hidden;
}

.dropdown[hidden] { display: none; }

.dropdown-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-name { font-weight: 700; color: var(--teal); font-size: 0.92rem; }
.dropdown-email { font-size: 0.78rem; color: var(--ink-muted); word-break: break-all; }
.dropdown-head .pill { align-self: flex-start; margin-top: 4px; }

.dropdown-body { padding: 6px; }
.dropdown-foot { padding: 6px; border-top: 1px solid var(--border); }

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.menu-item:hover { background: var(--surface-alt); }
.menu-item--danger { color: var(--bad-border); }

.menu-icon {
  width: 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.menu-item--danger .menu-icon { color: var(--bad-border); }

/* Mobile nav */
.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--brand-panel-ink);
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; order: 2; margin-left: auto; }
  .topbar-account { order: 3; }
  .main-nav {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
  }
  .main-nav--open { display: flex; }
  .nav-link { padding: 10px 12px; }
}

/* KPI trend */
.kpi-trend {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 2px;
}

.trend-up { color: var(--green); }
.trend-down { color: var(--bad-border); }
.trend-flat { color: var(--ink-muted); }
.kpi-trend .kpi-footnote { font-weight: 400; }

/* Printable card sheet */
.sheet {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.sheet-head { border-bottom: 2px solid var(--border); padding-bottom: 12px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0 0 4px; color: var(--teal); }

.sheet-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.sheet-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem;
  flex-shrink: 0;
}

.sheet-detail { flex: 1; min-width: 0; }
.sheet-label { font-weight: 700; margin-bottom: 4px; }
.sheet-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  word-break: break-all;
  color: var(--teal);
}
.sheet-meta { font-size: 0.75rem; color: var(--ink-muted); margin-top: 4px; }
.sheet-check { font-size: 1.4rem; color: var(--ink-muted); }
.sheet-note { font-size: 0.8rem; color: var(--ink-muted); margin-top: 16px; }

@media print {
  .topbar, .no-print, .page-footer, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .container { padding: 0; max-width: 100%; }
  .sheet { border: none; padding: 0; background: #fff; }
  .sheet-url, .sheet-head h2 { color: #000; }
  .sheet-row { break-inside: avoid; }
}

/* Contact page */
.contact-email {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 8px 0 12px;
  word-break: break-all;
}

.contact-email a { color: var(--teal); text-decoration: none; border-bottom: 3px solid var(--amber); }
.contact-email a:hover { border-bottom-color: var(--amber-dark); }

.contact-list { margin: 10px 0 0; padding-left: 20px; }
.contact-list li { margin-bottom: 8px; color: var(--ink-muted); line-height: 1.55; font-size: 0.92rem; }
.contact-list strong { color: var(--ink); }

/* Toggle on pages with no nav bar (login, signup, setup) */
.bare-toggle {
  position: absolute;
  top: 18px;
  right: 20px;
}

.bare-toggle .theme-toggle {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--ink);
}

.bare-toggle .theme-toggle:hover { background: var(--border); }

/* Theme toggle */
.theme-toggle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--brand-panel-ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-toggle:hover { background: rgba(255, 255, 255, 0.22); }

/* Show the icon for the theme you'd switch TO. */
.theme-toggle .icon-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .icon-light { display: none; }
}

.domain-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 6px 0 0;
}

.domain-line code {
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--teal);
  font-weight: 600;
}

.card-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.tap-url {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tap-url-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--ink-muted);
  width: 100%;
  max-width: 320px;
}

.copy-btn { font-size: 0.75rem; white-space: nowrap; }

.admin-note {
  background: var(--info-bg);
  border: 2px solid var(--amber-dark);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* Deployment readiness checks */
.check-list { list-style: none; padding: 0; margin: 8px 0 0; }

.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.check:first-child { border-top: none; }

.check-mark {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}

.check--ok .check-mark { background: var(--ok-bg); color: var(--green); }
.check--bad .check-mark { background: var(--bad-bg); color: var(--bad-border); }

.check-label { font-weight: 700; margin-bottom: 3px; }
.check-detail { font-size: 0.86rem; color: var(--ink-muted); line-height: 1.5; }
.check--bad .check-detail { color: var(--warn-ink); }
