/* Manrope — primary typeface, self-hosted (variable font) for offline / PWA use. */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/Manrope.woff2') format('woff2');
}
/* Inter — kept as a graceful fallback (already cached). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/InterVariable.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/InterVariable-Italic.woff2') format('woff2');
}

/* ════════════════════════════════════════════════════════════════════════════
   Tapfolio Console — design system v2
   Light-first professional SaaS UI. Soft-gray canvas, white surfaces, crisp
   borders, indigo accent. Dark mode is a first-class variant, not an inversion.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ef;
  --border-strong: #d4d8e3;
  --text: #131722;
  --muted: #697386;
  --faint: #98a1b3;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0fe;
  --accent-text: #4440c9;

  --success: #16a34a;  --success-bg: #e9f9ef;  --success-text: #077d55;
  --warning: #d97706;  --warning-bg: #fdf3e0;  --warning-text: #a15c07;
  --danger:  #dc2626;  --danger-bg:  #fdecec;  --danger-text:  #b42323;
  --info-bg: #eaf3fe;  --info-text: #175cd3;

  --radius-lg: 12px;
  --radius: 10px;
  --radius-sm: 8px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .14), 0 4px 10px -4px rgba(16, 24, 40, .08);

  --font: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Glassmorphism — frosted translucent chrome (topbar, sidebar, .glass). */
  --glass-bg: rgba(255, 255, 255, .62);
  --glass-border: rgba(255, 255, 255, .65);
  --glass-hi: rgba(255, 255, 255, .8);
  --glass-blur: saturate(180%) blur(16px);

  /* Legacy aliases (v1 token names still referenced in some view inline styles). */
  --indigo: var(--accent);
  --indigo-600: var(--accent-hover);
  --card: var(--surface);
  --elev: var(--surface-2);
  --fg: var(--text);
}

:root { color-scheme: light; }

/* Dark palette — shared by the explicit choice and the automatic (system) mode. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1118;
  --surface: #171b26;
  --surface-2: #1c2130;
  --border: #262d40;
  --border-strong: #343d57;
  --text: #e8ebf3;
  --muted: #97a0b5;
  --faint: #6d7690;

  --accent: #6c66f7;
  --accent-hover: #7d78f9;
  --accent-soft: rgba(108, 102, 247, .16);
  --accent-text: #a5a1ff;

  --success-bg: rgba(22,163,74,.16);   --success-text: #4ade80;
  --warning-bg: rgba(217,119,6,.16);   --warning-text: #fbbf24;
  --danger-bg:  rgba(220,38,38,.15);   --danger-text:  #f87171;
  --info-bg:    rgba(23,92,211,.18);   --info-text:    #7ab3ff;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
  --shadow-md: 0 4px 10px -2px rgba(0,0,0,.5);
  --shadow-lg: 0 14px 30px -8px rgba(0,0,0,.6);

  --glass-bg: rgba(20, 24, 34, .55);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-hi: rgba(255, 255, 255, .12);
}

/* Automatic: follow the OS unless the user explicitly picked light or dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0e1118;
    --surface: #171b26;
    --surface-2: #1c2130;
    --border: #262d40;
    --border-strong: #343d57;
    --text: #e8ebf3;
    --muted: #97a0b5;
    --faint: #6d7690;

    --accent: #6c66f7;
    --accent-hover: #7d78f9;
    --accent-soft: rgba(108, 102, 247, .16);
    --accent-text: #a5a1ff;

    --success-bg: rgba(22,163,74,.16);   --success-text: #4ade80;
    --warning-bg: rgba(217,119,6,.16);   --warning-text: #fbbf24;
    --danger-bg:  rgba(220,38,38,.15);   --danger-text:  #f87171;
    --info-bg:    rgba(23,92,211,.18);   --info-text:    #7ab3ff;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
    --shadow-md: 0 4px 10px -2px rgba(0,0,0,.5);
    --shadow-lg: 0 14px 30px -8px rgba(0,0,0,.6);

    --glass-bg: rgba(20, 24, 34, .55);
    --glass-border: rgba(255, 255, 255, .09);
    --glass-hi: rgba(255, 255, 255, .12);
  }
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}
/* Ambient colour wash — gives the frosted-glass chrome something to refract.
   Scoped to the authenticated shell so public card templates keep their own look. */
.shell::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(58% 44% at 12% -4%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    radial-gradient(50% 40% at 100% 12%, color-mix(in srgb, #8b5cf6 16%, transparent), transparent 72%),
    radial-gradient(46% 42% at 60% 108%, color-mix(in srgb, #22d3ee 12%, transparent), transparent 72%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
::selection { background: var(--accent-soft); }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 22px 72px; }
.wrap-sm { max-width: 420px; }
.center { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.muted { color: var(--muted); }
.mini { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.link { color: var(--accent-text); font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon { width: 20px; height: 20px; vertical-align: middle; }

/* ── Surfaces ──────────────────────────────────────────────────────────────── */
.surface {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--glass-hi);
}
.shadow { box-shadow: var(--shadow-md); }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: 20px 22px; margin-top: 16px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; font-family: inherit; letter-spacing: -0.006em;
  cursor: pointer; box-shadow: var(--shadow-xs); white-space: nowrap;
  transition: background .13s ease, border-color .13s ease, box-shadow .13s ease, transform .08s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 34%, var(--border)); background: var(--surface); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn .icon { width: 15px; height: 15px; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.field { display: block; min-width: 0; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.input, .textarea, .select, select.input, select.select {
  width: 100%; height: 38px; padding: 0 12px; font-size: 13.5px; font-family: inherit;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; box-shadow: var(--shadow-xs);
  transition: border-color .13s ease, box-shadow .13s ease;
}
textarea.input, .textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
/* Grid/flex items refuse to shrink below their content by default
   (min-width:auto) — that lets wide tables blow a panel out of its track and
   defeat inner overflow-x scrolling. Let them shrink. */
.grid-2 > *, .grid-3 > *, .dash-cols > *, .crm-cols > *, .split-cols > * { min-width: 0; }
/* Fieldsets have a min-width:min-content browser quirk that causes page-wide
   horizontal scroll on mobile forms. */
fieldset { min-width: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.form-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); padding: 20px 22px;
}
.form-section > legend {
  float: left; width: 100%; margin: 0 0 15px; padding: 0;
  font-size: 14px; font-weight: 700; color: var(--text);
  text-transform: none; letter-spacing: -0.012em;
}

/* ── Badges / pills / flash ────────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-pro { background: var(--accent-soft); color: var(--accent-text); }
.badge-verified { color: #0ea5e9; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  text-transform: capitalize;
}
.tag.completed, .tag.paid, .tag.active, .tag.sent   { background: var(--success-bg); border-color: transparent; color: var(--success-text); }
.tag.pending, .tag.scheduled, .tag.sending, .tag.open { background: var(--warning-bg); border-color: transparent; color: var(--warning-text); }
.tag.failed, .tag.refunded, .tag.void, .tag.cancelled, .tag.suspended, .tag.urgent { background: var(--danger-bg); border-color: transparent; color: var(--danger-text); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }
.chip.off { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.role-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.role-badge.admin { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.role-badge.superadmin { background: rgba(168,85,247,.14); border-color: transparent; color: #9333ea; }
.role-badge.support { background: var(--success-bg); border-color: transparent; color: var(--success-text); }

.flash {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500;
  margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.flash::before { content: "•"; font-weight: 800; }
.flash.success { background: var(--success-bg); border-color: transparent; color: var(--success-text); }
.flash.error   { background: var(--danger-bg);  border-color: transparent; color: var(--danger-text); }
.flash.warning { background: var(--warning-bg); border-color: transparent; color: var(--warning-text); }
.flash.info    { background: var(--surface-2); border-color: var(--border); color: var(--text); }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .055em;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr, .tbl tr { transition: background .1s ease; }
.tbl tbody tr:hover, .tbl tr:hover { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.tbl .link { font-weight: 600; }

/* ── Stats / metrics ───────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
@media (max-width: 420px){ .stat-grid { grid-template-columns: 1fr 1fr; } }
.stat { padding: 16px 18px; }
.stat .n { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 5px; font-weight: 500; }
.admin-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 15px 17px; background: var(--surface); box-shadow: var(--shadow-xs); }
.metric .k { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 600; }
.metric .v { font-size: 24px; font-weight: 800; margin-top: 8px; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric .d { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.pkg-price { font-size: 26px; font-weight: 800; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.pkg-price small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ── Charts ────────────────────────────────────────────────────────────────── */
.spark { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 6px; }
.spark .col { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .9; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; justify-content: flex-end; }
.spark-bar { width: 100%; max-width: 36px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent)); transition: opacity .12s; }
.spark-col:hover .spark-bar { opacity: .75; }
.spark-x { font-size: 10px; color: var(--faint); }
.bar-row { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar { height: 8px; border-radius: 6px; background: var(--accent); min-width: 4px; }
.bar-track { background: var(--accent-soft); border-radius: 6px; }

/* ── Section headers / rows ────────────────────────────────────────────────── */
.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 26px 0 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 20px; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: border-color .13s ease, box-shadow .13s ease;
}
.card-row:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow-sm); }
.card-av { width: 38px; height: 38px; border-radius: 10px; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   App shell v2 — fixed sidebar + sticky topbar + canvas content
   ═══════════════════════════════════════════════════════════════════════════ */
.shell { display: flex; min-height: 100dvh; }
.scrim { display: none; }
.hamburger { background: var(--surface); font-family: inherit; }

.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  width: 244px; flex: 0 0 244px; height: 100dvh; overflow-y: auto;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 1px;
  scrollbar-width: thin;
}
.sidebar .brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; letter-spacing: -0.02em; padding: 2px 10px 14px; }
.sidebar .brand .dot { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: inline-block; box-shadow: var(--shadow-sm); flex: 0 0 auto; }
.brand-tag { margin-left: auto; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); background: var(--accent-soft); border-radius: 5px; padding: 2px 6px; }

.nav-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 14px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: background .11s, color .11s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-item.active .icon { opacity: 1; }
.nav-item .icon { width: 16px; height: 16px; opacity: .8; flex: 0 0 auto; }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav-item .count.red { background: var(--danger); }
.sidebar .spacer { flex: 1 1 auto; }
.sidebar .who { border-top: 1px solid var(--border); margin-top: 10px; padding: 12px 10px 2px; }
.sidebar .who .nm { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .who .em { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 54px; padding: 0 26px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}
.hamburger { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--muted); border: 1px solid var(--border); }
.tb-title { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-crumb { color: var(--faint); font-weight: 500; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-link { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 7px; white-space: nowrap; }
.tb-link:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: background .13s, color .13s; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .ti { display: none; align-items: center; }
:root[data-theme="dark"] .theme-toggle .ti-dark,
:root[data-theme="light"] .theme-toggle .ti-light,
:root[data-theme="auto"] .theme-toggle .ti-auto,
:root:not([data-theme]) .theme-toggle .ti-auto { display: inline-flex; }
.tb-chip {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0;
  box-shadow: var(--shadow-xs);
}

.content { flex: 1; padding: 0; width: 100%; min-width: 0; }

/* ── Universal page frame ──────────────────────────────────────────────────────
   Every authenticated view — however it was written (main.wrap, a bare
   .page-head, custom max-widths) — is wrapped in .page by the shell, so all
   pages share one container: same width, gutters and vertical rhythm. */
.page { width: 100%; max-width: 1160px; margin: 0 auto; padding: 26px 32px 64px; }
/* Always reserve the scrollbar gutter so short and long pages align identically. */
html { scrollbar-gutter: stable; }
/* Neutralise the per-view containers so the .page frame alone governs layout. */
.content .page > .wrap,
.content .page main.wrap,
.content .page > main { max-width: none !important; width: auto; margin: 0; padding: 0; }
/* Tighten the very first heading so pages start cleanly. */
.page > .wrap > h2:first-child,
.page > h1:first-child, .page > h2:first-child { margin-top: 0; }

/* Empty state */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); font-size: 13.5px; }

/* ── Mobile: sidebar becomes a drawer ─────────────────────────────────────── */
@media (max-width: 880px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: 268px; transform: translateX(-102%);
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 50;
    background: rgba(9,11,16,.44); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 16px; gap: 8px; }
  /* Small screens: drop the "Workspace /" crumb prefix so the page name fits. */
  .tb-crumb { display: none; }
  .content { padding: 20px 16px 56px; }
}

/* ── Landing / marketing ───────────────────────────────────────────────────── */
.hero { text-align: center; }
.hero h1 { font-size: clamp(34px, 7vw, 58px); line-height: 1.04; margin-top: 20px; letter-spacing: -0.03em; }
.hero p { font-size: 17px; color: var(--muted); max-width: 540px; margin: 16px auto 0; }
.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 54px; }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 22px; text-align: left; border-radius: var(--radius-lg); }
.feature .ic { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 26px; align-items: start; }

/* ── Public profile card (customer-facing product) ─────────────────────────── */
.cover { height: 190px; width: 100%; }
.profile-wrap { max-width: 430px; margin: -78px auto 0; padding: 0 16px 64px; }
.profile { text-align: center; padding: 62px 24px 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.avatar, .avatar-fallback {
  width: 108px; height: 108px; border-radius: 50%; margin: -124px auto 16px;
  box-shadow: 0 0 0 4px var(--surface), var(--shadow-md); object-fit: cover; display: block;
}
.avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: #fff; }
.profile h1 { font-size: 25px; display: inline-flex; align-items: center; gap: 6px; }
.actions { display: grid; gap: 11px; margin-top: 18px; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.action { padding: 14px; border-radius: 13px; font-weight: 600; font-size: 14px; border: 1px solid var(--border); background: var(--surface-2); transition: transform .1s ease, border-color .14s ease; }
.action:hover { border-color: var(--border-strong); }
.action:active { transform: scale(.98); }
.save { color: #fff; font-size: 15px; padding: 15px; border-radius: 13px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s ease; box-shadow: var(--shadow-md); }
.save:active { transform: scale(.985); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.social { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface-2); transition: transform .1s ease; }
.social:active { transform: scale(.94); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 16px; padding: 22px; border-radius: var(--radius-lg); }
.qr-box img, .qr-box svg { width: 180px; height: 180px; }

/* Portfolio */
.pf-public { display: grid; gap: 14px; }
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.pf-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.pf-thumb { height: 88px; background-size: cover; background-position: center; color: var(--muted); }

/* ── Misc ──────────────────────────────────────────────────────────────────── */
.ai-btn {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent-text); cursor: pointer; font-family: inherit;
}
.ai-btn:hover:not(:disabled) { background: var(--accent-soft); }
.ai-btn:disabled { opacity: .5; cursor: not-allowed; color: var(--muted); }
.ai-btn.loading { opacity: .6; pointer-events: none; }

/* Segmented control (account-type toggle) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.seg-opt { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .13s, color .13s, box-shadow .13s; }
.seg-opt.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.seg-opt .icon { width: 15px; height: 15px; }

/* Plan usage meter */
.usage-lbl { font-size: 13px; font-weight: 500; color: var(--text); }
.usage-val { font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-val.warn { color: var(--warning-text); }
.usage-val.over { color: var(--danger-text); }
.usage-track { height: 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.usage-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s ease; }
.usage-fill.warn { background: var(--warning); }
.usage-fill.over { background: var(--danger); }
.usage-nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 11px 14px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; }

.rise { animation: rise .45s cubic-bezier(.22,1,.36,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .rise { animation: none; } .btn, .sidebar { transition: none; } }

/* ── Legal / policy pages ──────────────────────────────────────────────────── */
.legal { max-width: 760px; margin: 0 auto; padding: 56px 22px 90px; }
.legal-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:28px; flex-wrap:wrap; }
.legal-brand { display:inline-flex; align-items:center; gap:9px; font-weight:800; font-size:16px; color:var(--text); }
.legal-brand .dot { width:22px; height:22px; border-radius:7px; background:linear-gradient(135deg,#6366f1,#8b5cf6); }
.legal h1 { font-size:30px; letter-spacing:-.02em; margin:0 0 6px; }
.legal .updated { color:var(--muted); font-size:13.5px; margin:0 0 30px; }
.legal h2 { font-size:19px; margin:34px 0 10px; }
.legal p, .legal li { color:var(--text); font-size:15px; line-height:1.7; }
.legal p { margin:0 0 14px; }
.legal ul { margin:0 0 16px; padding-left:20px; }
.legal li { margin:0 0 7px; }
.legal a { color:var(--accent-text); font-weight:600; }
.legal .legal-foot { margin-top:44px; padding-top:20px; border-top:1px solid var(--border); font-size:13.5px; color:var(--muted); }

/* ── Auth split-screen (login / signup / verify / checkout) ──────────────────── */
.auth-split { min-height:100dvh; display:grid; grid-template-columns:1.05fr 1fr; }
.auth-aside { position:relative; overflow:hidden; color:#fff; padding:48px 52px; display:flex; flex-direction:column;
  background:linear-gradient(150deg,#4f46e5 0%,#7c3aed 55%,#a855f7 100%); }
.auth-aside::before { content:''; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(50% 40% at 85% 8%, rgba(255,255,255,.22), transparent 60%),
            radial-gradient(45% 45% at 5% 100%, rgba(0,0,0,.18), transparent 60%); }
.auth-aside > * { position:relative; z-index:1; }
.auth-abrand { display:inline-flex; align-items:center; gap:10px; font-weight:800; font-size:19px; color:#fff; }
.auth-abrand .dot { width:26px; height:26px; border-radius:8px; background:rgba(255,255,255,.22); box-shadow:inset 0 0 0 1px rgba(255,255,255,.4); }
.auth-ahead { margin-top:auto; }
.auth-ahead h2 { color:#fff; font-size:32px; line-height:1.15; letter-spacing:-.02em; margin:0 0 14px; max-width:15ch; }
.auth-ahead p { color:rgba(255,255,255,.82); font-size:15.5px; line-height:1.6; margin:0; max-width:42ch; }
.auth-feats { margin:26px 0 0; display:grid; gap:13px; }
.auth-feat { display:flex; align-items:flex-start; gap:11px; font-size:14.5px; color:rgba(255,255,255,.94); }
.auth-feat .fi { width:26px; height:26px; border-radius:8px; background:rgba(255,255,255,.16); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.auth-quote { margin:auto 0 0; padding:18px 20px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18); border-radius:16px; backdrop-filter:blur(6px); }
.auth-quote p { color:#fff; font-size:14.5px; line-height:1.6; margin:0 0 12px; }
.auth-quote .who { display:flex; align-items:center; gap:10px; }
.auth-quote .av { width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.28); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; }
.auth-quote .nm { font-weight:700; font-size:13.5px; } .auth-quote .rl { font-size:12px; color:rgba(255,255,255,.75); }
.auth-stats { display:flex; gap:26px; margin-top:22px; }
.auth-stats .n { font-size:22px; font-weight:800; } .auth-stats .l { font-size:12px; color:rgba(255,255,255,.72); }

.auth-main { display:flex; align-items:center; justify-content:center; padding:40px 22px; }
.auth-card { width:100%; max-width:400px; animation:authIn .5s cubic-bezier(.2,.7,.3,1) both; }
.auth-brand-m { display:none; }
.auth-head { margin-bottom:22px; }
.auth-head h1 { font-size:26px; letter-spacing:-.02em; margin:0 0 6px; }
.auth-head p { color:var(--muted); font-size:14.5px; margin:0; }
@keyframes authIn { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }

@media (max-width:900px) {
  .auth-split { grid-template-columns:1fr; }
  .auth-aside { display:none; }
  .auth-brand-m { display:inline-flex; align-items:center; gap:9px; font-weight:800; font-size:18px; margin-bottom:22px; }
  .auth-brand-m .dot { width:24px; height:24px; border-radius:7px; background:linear-gradient(135deg,#6366f1,#8b5cf6); }
}
@media (prefers-reduced-motion: reduce) { .auth-card { animation:none; } }

/* ── Feature gate (blur + "upgrade to unlock") ───────────────────────────────── */
.gate { position: relative; border-radius: var(--radius-lg); }
.gate.locked > .gate-body { filter: blur(2.5px) saturate(.72); opacity: .5; pointer-events: none; user-select: none; }
.gate.locked { overflow: hidden; }
.gate-lock { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; padding: 16px;
  background: color-mix(in srgb, var(--surface) 30%, transparent); }
.gate-lock .gate-note { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.pill-pro { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); padding: 3px 10px; border-radius: 999px; text-decoration: none; box-shadow: 0 2px 8px rgba(99,102,241,.35); }

/* Locked-feature placeholder — rendered INSTEAD of the real premium fields, so
   nothing sensitive ships to the browser for plans without the feature. */
.feature-locked { border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--radius-lg);
  padding: 16px 18px; background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.feature-locked .fl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.feature-locked .fl-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; color: var(--text); }
.feature-locked .fl-title svg { color: var(--accent); }
.feature-locked .fl-note { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Accent colour picker (preset swatches + custom) in the card editor. */
.accent-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.accent-sw { width: 28px; height: 28px; border-radius: 8px; background: var(--sw); border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border) inset; cursor: pointer; padding: 0; transition: transform .1s, box-shadow .12s; }
.accent-sw:hover { transform: scale(1.08); }
.accent-sw.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--sw); }
.accent-custom { width: 34px; height: 28px; border-radius: 8px; overflow: hidden; border: 1px dashed var(--border-strong); display: inline-flex; cursor: pointer; }
.accent-custom input[type="color"] { width: 150%; height: 150%; margin: -25%; border: 0; padding: 0; background: transparent; cursor: pointer; }

/* Drag-to-reposition image frame (cover banner + profile photo). */
.imgpos { position: relative; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); touch-action: none; }
.imgpos-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: grab; -webkit-user-drag: none; user-select: none; }
.imgpos-img:active { cursor: grabbing; }
.imgpos-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; }
.imgpos-hint { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.62); color: #fff; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; pointer-events: none; }

/* ══ Global mobile hardening ═══════════════════════════════════════════════════
   Many views set grid-template-columns inline, which beats the per-component
   media queries — so collapse the common layout grids here with !important, make
   data tables scroll instead of stretch the page, and let toolbars wrap. */
@media (max-width: 760px) {
  .page { padding: 22px 16px 56px; }
  /* Any two-plus column grid (incl. inline ones) collapses to a single column. */
  .grid-2, .grid-3, .tiers, .price-grid, .lp-price-grid,
  .dash-cols, .crm-cols, .split-cols { grid-template-columns: 1fr !important; }
  .grid-2, .grid-3 { gap: 14px !important; }
  /* Card rows (My cards / dashboard): stack the info above the action buttons so
     nothing overlaps, and let the buttons wrap across as many lines as needed. */
  .card-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .card-row > .row:last-child { justify-content: flex-start; flex-wrap: wrap; }
  /* Page headers / inline toolbars wrap instead of squashing. */
  .page-head { flex-wrap: wrap; gap: 10px; }
  main.wrap > .row.between:first-of-type,
  .page > .row.between:first-of-type { flex-wrap: wrap; gap: 10px; }
  /* Data tables scroll horizontally within their card. */
  table.tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  /* Side rails (print / studio actions) shouldn't stay pinned once stacked. */
  .panel[style*="sticky"], .surface[style*="sticky"] { position: static !important; }
}

/* ══ Calmer type + spacing on phones ═══════════════════════════════════════════ */
@media (max-width: 560px) {
  h1 { font-size: 19px; }
  h2 { font-size: 16px; }
  .page-head h1 { font-size: 19px; }
  .page-head .sub, .sub { font-size: 12.5px; }
  /* Oversized numeric/price stats set inline across the app. */
  .pprice, .pkg-price, .stat-num, .kpi-value, .metric-value { font-size: 22px !important; }
  /* Big hero-ish headings sometimes used on inner pages. */
  h1[style*="font-size"], h2[style*="font-size"] { font-size: 20px !important; }
  /* Slightly tighter panels + buttons so things aren't so chunky. */
  .panel { padding: 16px; }
  .btn { height: 42px; font-size: 14px; }
  .page { padding: 18px 14px 52px; }
}

/* ══ Premium pricing / plan cards ══════════════════════════════════════════════ */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 20px; margin-top: 22px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px 24px; transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.plan-card.popular {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
             linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899) border-box;
  box-shadow: 0 20px 55px -22px color-mix(in srgb, var(--indigo) 65%, transparent);
}
.plan-card.current { border-color: color-mix(in srgb, #16a34a 45%, var(--border)); }
.plan-ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font: 700 11px/1 var(--font); letter-spacing: .05em;
  text-transform: uppercase; padding: 6px 14px; border-radius: 999px; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--indigo) 70%, transparent); }
.plan-name { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0; }
.plan-card.popular .plan-name { color: var(--accent-text); }
.plan-price { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 12px 0 0; }
.plan-price small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-tagline { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; min-height: 18px; }
.plan-feats { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 11px; }
.plan-feats li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.4; color: var(--text); }
.plan-feats .ck { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, #16a34a 16%, transparent); color: #16a34a; margin-top: .5px; }
.plan-cta { margin-top: auto; padding-top: 24px; }
.plan-cta .btn { height: 46px; font-size: 14.5px; }
.plan-note { text-align: center; font-size: 11.5px; color: var(--muted); margin: 9px 0 0; }

/* ── Google / OAuth sign-in button ──────────────────────────────────────── */
.oauth-sep{display:flex;align-items:center;gap:12px;margin:18px 0;color:var(--muted);font-size:12.5px;font-weight:600}
.oauth-sep::before,.oauth-sep::after{content:"";flex:1;height:1px;background:var(--border)}
.oauth-btn{display:flex;align-items:center;justify-content:center;gap:10px;font-weight:650;
  background:var(--surface);border:1px solid var(--border);color:var(--text)}
.oauth-btn:hover{background:var(--surface-2,var(--bg));border-color:var(--muted)}
.oauth-btn svg{flex:none}

/* ── Shared fixed public header (landing / pricing / legal) ──────────────── */
.site-header{position:fixed;top:0;left:0;right:0;z-index:100;
  background:color-mix(in srgb,var(--surface) 82%,transparent);backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);}
.site-header-in{max-width:1140px;margin:0 auto;height:60px;padding:0 22px;display:flex;align-items:center;gap:18px;}
.site-header-spacer{height:60px;}
.site-brand{display:inline-flex;align-items:center;gap:9px;font-weight:800;font-size:16px;letter-spacing:-.02em;color:var(--text);white-space:nowrap;}
.site-nav{display:flex;gap:4px;margin-left:8px;}
.site-nav a{padding:8px 12px;border-radius:8px;font-size:14px;font-weight:500;color:var(--muted);transition:color .15s,background .15s;}
.site-nav a:hover{color:var(--text);background:var(--surface-2);}
.site-cta{margin-left:auto;display:flex;align-items:center;gap:8px;}
html{scroll-padding-top:76px;}
@media (max-width:760px){
  .site-header-in{height:56px;padding:0 16px;gap:10px;}
  .site-header-spacer{height:56px;}
  .site-nav{display:none;}
  .site-brand{font-size:15px;}
}

/* ── Card editor ───────────────────────────────────────────────────────────
   Two columns on desktop: the form (capped so inputs stay readable) plus a
   sticky rail for the things you look at rather than type into — QR, print,
   template, danger zone. The save bar sticks to the bottom of the form so it
   is always reachable instead of being buried under the page. */
.ed { width: 100%; max-width: 1080px; margin: 0 auto; }
.ed-cols { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.ed-main { min-width: 0; display: grid; gap: 16px; }
.ed-rail { min-width: 0; display: grid; gap: 14px; position: sticky; top: 68px; }
@media (max-width: 900px) {
  .ed-cols { grid-template-columns: 1fr; }
  .ed-rail { position: static; }
}

.ed-save {
  position: sticky; bottom: 12px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 12px;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.ed-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xs); }
.ed-card > h3 { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.ed-card .qr-box { margin-top: 0; padding: 0; gap: 10px; background: none; border: 0; box-shadow: none; }
.ed-card .qr-box img, .ed-card .qr-box svg { width: 150px; height: 150px; }
.ed-danger { border-color: color-mix(in srgb, var(--danger) 32%, var(--border)); }
.ed-photo-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 560px) { .ed-photo-row { grid-template-columns: 1fr; } }

/* ── Form control width discipline ─────────────────────────────────────────
   A single-line input stretched across a 950px panel is unreadable and looks
   unfinished. Cap standalone controls at a comfortable measure; controls that
   share a grid row (or opt out with .field-full) still fill their track. */
.content .field > .input:not([type=file]),
.content .field > .select,
.content .field > .textarea { max-width: 620px; }
.content .grid-2 .field > .input,
.content .grid-2 .field > .select,
.content .grid-2 .field > .textarea,
.content .grid-3 .field > .input,
.content .grid-3 .field > .select,
.content .grid-3 .field > .textarea,
.content .field-full > .input,
.content .field-full > .select,
.content .field-full > .textarea { max-width: none; }

/* ── In-browser image editor (crop / zoom / rotate / flip) ─────────────────
   The frame is the crop window; a canvas renders the transformed image so what
   the user sees is exactly what gets saved. */
.imged { position: relative; width: 100%; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); touch-action: none; cursor: grab; }
.imged:active { cursor: grabbing; }
.imged canvas { display: block; width: 100%; height: 100%; }
.imged-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12.5px; pointer-events: none; }
.imged-hint { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.62); color: #fff;
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; pointer-events: none; }
.imged-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.imged-tools .imged-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 30px; padding: 0 9px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: 12px; font-weight: 600; font-family: inherit;
}
.imged-tools .imged-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.imged-zoom { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 7px; }
.imged-zoom input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }

/* ── Booking (public scheduler) — modern two-panel flow ───────────────────── */
.bk { --bk-accent: #4f46e5; max-width: 940px; margin: 0 auto; padding: 40px 20px 60px; }
.bk-card { display: grid; grid-template-columns: 292px minmax(0,1fr); overflow: hidden;
  border-radius: 20px; box-shadow: 0 20px 60px -22px rgba(16,24,40,.28), 0 2px 8px rgba(16,24,40,.05); }
@media (max-width: 780px) { .bk-card { grid-template-columns: 1fr; } }

/* Left panel — who you're meeting */
.bk-side { position: relative; padding: 30px 26px; border-right: 1px solid var(--border);
  background: linear-gradient(170deg, color-mix(in srgb, var(--bk-accent) 9%, var(--surface)) 0%, var(--surface-2) 62%); }
.bk-side::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--bk-accent), color-mix(in srgb, var(--bk-accent) 40%, #a855f7)); }
@media (max-width: 780px) { .bk-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 24px; } }
.bk-side-top { margin-bottom: 18px; }
.bk-photo { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; display: block;
  border: 3px solid var(--surface); box-shadow: 0 4px 14px rgba(16,24,40,.16); margin-bottom: 12px; }
.bk-photo-ph { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 21px;
  background: linear-gradient(135deg, var(--bk-accent), #8b5cf6); }
.bk-host { margin: 0; font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.bk-check { color: var(--bk-accent); display: inline-flex; }
.bk-host-role { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.bk-title { font-size: 23px; line-height: 1.2; letter-spacing: -.028em; margin: 0 0 14px; }
.bk-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bk-facts li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.bk-facts li svg { flex: none; margin-top: 1px; }
.bk-facts li.on { color: var(--text); font-weight: 600; }
.bk-facts li.on svg { color: var(--success); }
.bk-desc { margin: 16px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--border); }
.bk-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bk-back:hover { color: var(--bk-accent); }

/* Right panel — the flow */
.bk-main { padding: 28px 30px 32px; min-width: 0; }
@media (max-width: 780px) { .bk-main { padding: 22px 20px 26px; } }
.bk-steps { list-style: none; display: flex; gap: 10px; margin: 0 0 22px; padding: 0; }
.bk-steps li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.bk-steps li span { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; }
.bk-steps li.on { color: var(--text); }
.bk-steps li.on span { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }
.bk-steps li + li::before { content: ''; width: 18px; height: 1px; background: var(--border); margin-right: 3px; }
.bk-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bk-h { font-size: 14.5px; margin: 0; letter-spacing: -.01em; }
.bk-count { font-size: 12px; color: var(--muted); }
.bk-tz { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.bk-tz select { border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; height: 30px; font-size: 12px; font-family: inherit; max-width: 190px; padding: 0 6px; }

.bk-days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.bk-days::-webkit-scrollbar { height: 5px; }
.bk-days::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.bk-month { flex: none; align-self: center; font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--faint); padding: 0 2px; }
.bk-day { flex: none; scroll-snap-align: start; width: 54px; padding: 8px 0; border-radius: 12px; text-align: center;
  border: 1px solid var(--border); background: var(--surface); transition: transform .12s, border-color .12s, box-shadow .12s; }
.bk-day em { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.bk-day b { display: block; font-size: 17px; font-weight: 800; line-height: 1.25; }
.bk-day:hover { border-color: var(--bk-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.bk-day.active { background: var(--bk-accent); border-color: var(--bk-accent); box-shadow: 0 6px 16px -6px var(--bk-accent); }
.bk-day.active em, .bk-day.active b { color: #fff; }

.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px,1fr)); gap: 9px; }
.bk-slot { height: 44px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: 700 13.5px/1 inherit; cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s, box-shadow .12s; }
.bk-slot:hover { border-color: var(--bk-accent); color: var(--bk-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.bk-slot.picked { background: var(--bk-accent); border-color: var(--bk-accent); color: #fff; }

/* Step 2 — details */
.bk-form[hidden] { display: none; }
.bk-chosen { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--bk-accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--bk-accent) 26%, var(--border)); }
.bk-chosen-ic { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--bk-accent); color: #fff; }
.bk-chosen b { font-size: 14px; }
.bk-change { margin-left: auto; background: none; border: 0; cursor: pointer; font: 600 12.5px inherit;
  color: var(--bk-accent); text-decoration: underline; text-underline-offset: 3px; }
.bk-fields { display: grid; gap: 13px; }
.bk-fields .field > span { font-size: 12.5px; font-weight: 600; }
.bk-fields .req { color: var(--danger); }
.bk-submit { width: 100%; height: 46px; margin-top: 18px; border: 0; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bk-accent); color: #fff; font: 700 14.5px inherit;
  box-shadow: 0 10px 24px -10px var(--bk-accent); transition: transform .12s, filter .12s; }
.bk-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.bk-fine { font-size: 11.5px; color: var(--faint); text-align: center; margin: 10px 0 0; }
.bk-empty { text-align: center; padding: 40px 20px; }
.bk-empty-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px;
  background: var(--surface-2); color: var(--muted); }
.bk-empty-t { font-weight: 700; margin: 0 0 4px; }
.bk-powered { text-align: center; font-size: 11.5px; color: var(--faint); margin: 16px 0 0; }
.bk-powered a { font-weight: 600; color: var(--muted); }

/* Shared by the meeting-type chooser and the confirmation page */
.bk-owner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bk-owner img, .bk-av { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.bk-av { display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg,#6366f1,#8b5cf6); font-size: 15px; }
.bk-name { font-weight: 700; font-size: 14px; display: block; }
.bk-type { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface);
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.bk-type:hover { border-color: var(--bk-accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.bk-type-title { font-weight: 700; font-size: 14.5px; }
.bk-chosen.surface { background: var(--surface); }
.bk-icon { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; }
.bk-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* Owner-side appointments */
.ap-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.ap-row.off { opacity: .6; }
.av-day { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0;
  border-bottom: 1px solid var(--border); }
.av-day:last-child { border-bottom: 0; }

/* ── Appointments (owner) ─────────────────────────────────────────────────── */
.apt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 18px; }
.apt-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--shadow-xs); }
.apt-stat.hot { border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
  background: color-mix(in srgb, var(--warning-bg) 60%, var(--surface)); }
.apt-stat .v { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.apt-stat .k { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.apt-link { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 20px; flex-wrap: wrap; }
.apt-h { font-size: 15px; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }
.apt-pill { background: var(--warning-bg); color: var(--warning-text); font-size: 11.5px; font-weight: 800;
  border-radius: 999px; padding: 2px 9px; }

.apt { display: flex; gap: 14px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-xs); }
.apt.is-pending { border-color: color-mix(in srgb, var(--warning) 42%, var(--border)); }
.apt.is-off { opacity: .58; }
.apt-date { flex: none; width: 58px; text-align: center; border-radius: 10px; padding: 8px 0;
  background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; }
.apt-date .d-dow { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.apt-date .d-day { display: block; font-size: 21px; font-weight: 800; line-height: 1.15; }
.apt-date .d-mon { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.apt-body { min-width: 0; flex: 1; }
.apt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.apt-time { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.apt-tag { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.apt-tag.ok   { background: var(--success-bg); color: var(--success-text); }
.apt-tag.warn { background: var(--warning-bg); color: var(--warning-text); }
.apt-tag.off  { background: var(--surface-2); color: var(--muted); }
.apt-what { margin: 4px 0 0; font-size: 13.5px; font-weight: 600; }
.apt-who  { margin: 4px 0 0; font-size: 13.5px; }
.apt-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); font-style: italic; }
.apt-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.apt-decline { display: grid; gap: 8px; margin-top: 10px; }
@media (max-width: 560px) {
  .apt { gap: 10px; padding: 12px; }
  .apt-date { width: 50px; }
  .apt-actions form, .apt-actions .btn { flex: 1; }
  .apt-actions .btn { width: 100%; }
}
/* The booking URL is long — clip it rather than letting it push the row wide. */
.apt-link > a { flex: 1 1 100%; min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Integrations (user) + admin capability list ──────────────────────────── */
.int-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.int-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow-xs); }
.int-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.int-logo { width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; }
.int-title { font-size: 15px; margin: 0; }
.int-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; line-height: 1.5; }
.int-head .apt-tag { margin-left: auto; align-self: center; }
.int-check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.int-check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.int-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.int-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; }
.int-caps { display: grid; gap: 10px; margin: 0 0 14px; }
.int-cap { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.int-cap .mini { display: block; margin-top: 2px; }
.int-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px;
  background: var(--border-strong); }
.int-dot.on { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
@media (max-width: 560px) { .int-head .apt-tag { margin-left: 0; } }

/* ── Month calendar ───────────────────────────────────────────────────────── */
.cal-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.cal-label { font-size: 16px; letter-spacing: -.01em; min-width: 132px; text-align: center; }
.cal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-xs); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2);
  border-bottom: 1px solid var(--border); }
.cal-dow span { padding: 9px 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-week:last-child { border-bottom: 0; }
.cal-day { min-height: 104px; padding: 7px 8px; border-right: 1px solid var(--border);
  cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 4px; }
.cal-day:last-child { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.sel { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.out { opacity: .4; }
.cal-day.off { background: repeating-linear-gradient(45deg, transparent, transparent 6px,
  color-mix(in srgb, var(--border) 55%, transparent) 6px, color-mix(in srgb, var(--border) 55%, transparent) 12px); }
.cal-day.past .cal-items { opacity: .6; }
.cal-daynum { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-daynum > span:first-child { font-size: 13px; font-weight: 700; }
.cal-day.today .cal-daynum > span:first-child { background: var(--accent); color: #fff;
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.cal-flag { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  background: var(--warning-bg); color: var(--warning-text); border-radius: 5px; padding: 1px 5px; }
.cal-flag.muted-flag { background: transparent; color: var(--faint); }
.cal-items { display: grid; gap: 3px; min-width: 0; }
.cal-ev { font-size: 10.5px; line-height: 1.35; padding: 2px 5px; border-radius: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev em { font-style: normal; font-weight: 700; }
.cal-ev.confirmed { background: var(--success-bg); color: var(--success-text); }
.cal-ev.pending   { background: var(--warning-bg); color: var(--warning-text); }
.cal-ev.cancelled, .cal-ev.declined { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.cal-more { font-size: 10px; color: var(--muted); padding-left: 5px; }
.cal-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.cal-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.cal-legend .dot.confirmed { background: var(--success); }
.cal-legend .dot.pending   { background: var(--warning); }
.cal-legend .dot.cancelled { background: var(--border-strong); }
.cal-legend .dot.dayoff    { background: repeating-linear-gradient(45deg, var(--border), var(--border) 2px, transparent 2px, transparent 4px); }
@media (max-width: 760px) {
  .cal-day { min-height: 72px; padding: 5px 4px; }
  .cal-ev { font-size: 9px; padding: 1px 3px; }
  .cal-ev em { display: block; }
  .cal-dow span { padding: 7px 2px; font-size: 10px; }
}
/* Page-head action rows wrap instead of pushing the page wide on small screens. */
@media (max-width: 560px) {
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head > .row { flex-wrap: wrap; width: 100%; }
  .page-head > .row > .btn { flex: 1 1 auto; }
}

/* Embedded booking (inside the card's modal) — no page chrome, fills the frame */
.bk-embed { padding: 0; max-width: none; }
.bk-embed .bk-card { border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
.bk-embed .bk-side { background: var(--surface-2); }
@media (max-width: 760px) { .bk-embed .bk-card { min-height: auto; } }
/* Google busy blocks in the month calendar */
.cal-ev.gbusy { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px,
  color-mix(in srgb, var(--border) 70%, transparent) 4px, color-mix(in srgb, var(--border) 70%, transparent) 8px);
  color: var(--muted); }
.cal-legend .dot.gbusy { background: repeating-linear-gradient(45deg, var(--border-strong), var(--border-strong) 2px, transparent 2px, transparent 4px); }

/* Confirmation page: join button, host notes, add-to-calendar menu */
.bk-join { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px;
  height: 46px; border-radius: 12px; background: var(--success); color: #fff; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 10px 24px -10px var(--success); }
.bk-join:hover { filter: brightness(1.06); }
.bk-note { text-align: left; margin-top: 14px; padding: 2px 0 2px 12px; border-left: 3px solid var(--bk-accent, var(--accent)); }
.bk-note-h { margin: 0 0 3px; font-weight: 700; font-size: 13px; }
.bk-note-b { margin: 0; font-size: 13.5px; color: var(--muted); }
.bk-addcal { position: relative; }
.bk-addcal-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; text-align: left; }
.bk-addcal-menu[hidden] { display: none; }
.bk-addcal-menu a { display: block; padding: 11px 14px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.bk-addcal-menu a:hover { background: var(--surface-2); color: var(--accent-text); }
.bk-addcal-menu a + a { border-top: 1px solid var(--border); }

/* Booking detail + tappable rows + meeting-type rows */
.apt[data-open] { cursor: pointer; }
.apt[data-open]:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.apt-title-link { color: inherit; }
.apt-title-link:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.ap-detail { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
/* minmax(0,1fr), not 1fr: a plain 1fr track refuses to shrink below its
   content's min-width, so a wide table inside pushes the whole page sideways
   instead of scrolling within its own wrapper. */
@media (max-width: 860px) { .ap-detail { grid-template-columns: minmax(0,1fr); } }
.ap-detail > * { min-width: 0; }
.ap-when { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.ap-dl { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 7px 12px; margin: 0; font-size: 13.5px; }
.ap-dl dt { color: var(--muted); }
.ap-dl dd { margin: 0; }
.et-row { display: flex; align-items: center; gap: 11px; padding: 13px 16px; cursor: pointer; list-style: none; }
.et-row::-webkit-details-marker { display: none; }
.et-ic { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); }
.et-edit { pointer-events: none; }
details[open] .et-edit { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
@media (max-width: 560px) { .et-row { flex-wrap: wrap; } .et-row .btn { flex: 1; } }

/* Finance dashboard */
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fin-kpi { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface); }
.fin-kpi .k { display: block; font-size: 12px; color: var(--muted); font-weight: 650;
  text-transform: uppercase; letter-spacing: .04em; }
.fin-kpi .v { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 3px;
  font-variant-numeric: tabular-nums; }
.fin-kpi .s { display: block; font-size: 12px; color: var(--muted); }
.fin-alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.fin-alert { display: inline-flex; align-items: baseline; gap: 7px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-size: 13px; }
.fin-alert:hover { border-color: var(--accent); }
.fin-alert b { font-size: 15px; font-weight: 800; }
.fin-alert.is-warn { border-color: var(--warning-text); color: var(--warning-text); }
.fin-alert.is-warn b { color: var(--warning-text); }

/* Searchable taxonomy fields */
.tx-box { position: relative; }
.tx-input { width: 100%; padding-right: 30px; }
.tx-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; padding: 0 5px; border-radius: 6px; }
.tx-clear:hover { color: var(--text); background: var(--surface-2); }
.tx-menu { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 5px); max-height: 260px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 5px; }
.tx-opt { display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); }
.tx-opt:hover, .tx-opt.on { background: var(--accent-soft); color: var(--accent-text); }
.tx-opt b { font-weight: 750; }
.tx-new { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 3px; }
.tx-new span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tx-empty { margin: 0; padding: 12px 10px; font-size: 13px; color: var(--muted); }
.tx-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.tx-note.is-new { color: var(--warning-text); }
.tx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tx-chips:empty { display: none; }
.tx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; font-weight: 600; }
.tx-chip.is-new { background: var(--warning-bg); color: var(--warning-text); }
.tx-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px;
  line-height: 1; padding: 0; opacity: .7; }
.tx-chip button:hover { opacity: 1; }

/* Profile completeness meter */
.pc-meter { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pc-meter span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s; }

/* Landing — illustrated proof points */
.lp-showcase { display: grid; gap: 46px; margin-top: 46px; }
.lp-show { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 40px; align-items: center; }
.lp-show-flip .lp-show-art { order: 2; }
.lp-show-art { border-radius: 20px; padding: 22px; background: var(--surface-2); border: 1px solid var(--border); }
.lp-show-copy h3 { font-size: clamp(21px, 2.6vw, 28px); letter-spacing: -.03em; margin: 6px 0 12px; line-height: 1.2; }
.lp-show-copy p { color: var(--muted); font-size: 15.5px; line-height: 1.7; margin: 0; }
@media (max-width: 820px) {
  .lp-show { grid-template-columns: 1fr; gap: 20px; }
  .lp-show-flip .lp-show-art { order: 0; }
}
.lp-nfc { display: grid; grid-template-columns: minmax(0,0.9fr) minmax(0,1.1fr); gap: 42px; align-items: center; }
.lp-nfc-art { border-radius: 20px; padding: 20px; background: var(--surface-2); border: 1px solid var(--border); }
.lp-nfc-list { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 9px; }
.lp-nfc-list li { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.lp-nfc-list svg { color: var(--success-text); flex: none; }
@media (max-width: 820px) { .lp-nfc { grid-template-columns: 1fr; gap: 22px; } }
.lp-quote .who { display: flex; align-items: center; gap: 10px; }

/* Illustrations */
.illo, .illo-img { display: block; width: 100%; }
.illo svg { width: 100%; height: auto; display: block; }
.illo-img { border-radius: 16px; object-fit: cover; }
.illo-av { border-radius: 50%; flex: none; }

/* NFC ordering */
.nfc-grid { display: grid; grid-template-columns: minmax(0,0.85fr) minmax(0,1.15fr); gap: 14px; }
@media (max-width: 820px) { .nfc-grid { grid-template-columns: 1fr; } }
.nfc-hero { border-radius: 14px; overflow: hidden; background: var(--surface-2); padding: 10px; }
.nfc-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.nfc-points li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.nfc-points svg { flex: none; color: var(--accent); margin-top: 1px; }
.nfc-price { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.nfc-price > span:first-child { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.nfc-total { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 7px; }
.nfc-total-row { border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; font-size: 15px; }

/* Blog */
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.bp-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; background: var(--surface); text-decoration: none; color: inherit;
  transition: transform .14s, box-shadow .14s, border-color .14s; }
.bp-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.bp-thumb { display: block; aspect-ratio: 16/9; background: var(--surface-2); overflow: hidden; }
.bp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--accent); opacity: .5; }
.bp-body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bp-meta { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.bp-title { font-size: 16px; font-weight: 750; letter-spacing: -.02em; line-height: 1.32; }
.bp-ex { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.bp-more { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 650; color: var(--accent-text);
  display: inline-flex; align-items: center; gap: 5px; }
.bp-wide { flex-direction: row; margin-bottom: 16px; }
.bp-wide .bp-thumb { flex: 0 0 46%; aspect-ratio: auto; }
.bp-wide .bp-body { padding: 26px 28px; justify-content: center; }
.bp-wide .bp-title { font-size: 26px; letter-spacing: -.03em; }
@media (max-width: 720px) { .bp-wide { flex-direction: column; } .bp-wide .bp-thumb { flex: none; aspect-ratio: 16/9; }
  .bp-wide .bp-body { padding: 16px; } .bp-wide .bp-title { font-size: 19px; } }

.bp-article { max-width: 720px; margin: 0 auto; }
.bp-article h1 { font-size: clamp(27px, 4.6vw, 40px); letter-spacing: -.03em; margin: 8px 0 0; line-height: 1.15; }
.bp-lede { font-size: 17px; color: var(--muted); line-height: 1.6; margin: 14px 0 0; }
.bp-byline { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }
.bp-cover { width: 100%; border-radius: 16px; margin: 24px 0 4px; border: 1px solid var(--border); }
.bp-prose { font-size: 16.5px; line-height: 1.75; }
.bp-prose h2 { font-size: 23px; letter-spacing: -.02em; margin: 34px 0 10px; }
.bp-prose h3 { font-size: 18.5px; margin: 26px 0 8px; }
.bp-prose p { margin: 0 0 18px; }
.bp-prose ul, .bp-prose ol { margin: 0 0 18px; padding-left: 22px; }
.bp-prose li { margin-bottom: 8px; }
.bp-prose blockquote { margin: 22px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic; }
.bp-prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.bp-prose a { color: var(--accent-text); text-underline-offset: 3px; }
.bp-tags { display: flex; gap: 7px; flex-wrap: wrap; margin: 26px 0 0; }
.bp-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border); }
.bp-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin: 40px auto 10px; max-width: 720px; padding: 26px 28px; border-radius: 18px;
  background: var(--accent-soft); border: 1px solid var(--accent); }
.bp-cta-t { font-size: 19px; font-weight: 780; letter-spacing: -.02em; margin: 0 0 4px; }
.bp-cta-s { font-size: 14px; color: var(--muted); margin: 0; max-width: 46ch; }

/* Article editor */
.post-edit { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .post-edit { grid-template-columns: 1fr; } }

/* Secure Access — visible vs locked */
.sa-split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (max-width: 700px) { .sa-split { grid-template-columns: 1fr; } }
.sa-col { border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-width: 0; }
.sa-h { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13px; margin: 0 0 10px; }
.sa-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sa-dot.open { background: var(--success-text); }
.sa-dot.shut { background: var(--warning-text); }
.sa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.sa-list li { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.sa-list li svg { flex: none; color: var(--success-text); }
.sa-picks { display: grid; gap: 7px; }
.sa-pick { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.sa-pick input { width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.sa-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.sa-hint { font-family: monospace; font-size: 13px; padding: 5px 11px; border-radius: 8px;
  background: var(--surface-2); letter-spacing: .06em; }

/* Admin — per-section sender rows */
.mc-row { padding: 0; }
.mc-sum { display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer; list-style: none; }
.mc-sum::-webkit-details-marker { display: none; }
.mc-ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); }
.mc-from { font-family: monospace; font-size: 12px; text-align: right; word-break: break-all; max-width: 45%; }
.mc-body { padding: 0 14px 14px; }
.mc-offdomain { margin-top: 12px; padding: 12px; border: 1px dashed var(--border); border-radius: 11px; }
@media (max-width: 560px) { .mc-from { display: none; } }

/* Bookings — filter tabs + pager */
.bk-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; margin: 0 0 14px;
  scrollbar-width: none; }
.bk-tabs::-webkit-scrollbar { display: none; }
.bk-tab { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex: none;
  padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px;
  font-weight: 600; color: var(--muted); text-decoration: none; }
.bk-tab:hover { border-color: var(--accent); color: var(--accent-text); }
.bk-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bk-tab b { font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); }
.bk-tab.on b { background: rgba(255,255,255,.24); color: #fff; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 34px; height: 34px; padding: 0 9px; border-radius: 9px;
  border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text); }
.pager-links a:hover { border-color: var(--accent); color: var(--accent-text); }
.pager-links .on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-links .gap { border: 0; min-width: 18px; color: var(--muted); }
.pager-links .off { opacity: .4; pointer-events: none; }

/* Booking analytics */
.an-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 800px) { .an-grid { grid-template-columns: 1fr; } .an-grid > * { grid-column: auto !important; } }
.an-funnel { display: grid; gap: 15px; }
.an-step-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 6px; }
.an-step-top b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.an-bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.an-bar span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover, var(--accent))); }
.an-hours { display: flex; align-items: flex-end; gap: 3px; height: 132px; margin-bottom: 6px; }
.an-hour { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; height: 100%; gap: 5px; }
.an-hour-bar { width: 100%; border-radius: 4px 4px 2px 2px; background: var(--surface-2); }
.an-hour.on .an-hour-bar { background: var(--accent); }
.an-hour-l { font-size: 10px; color: var(--muted); white-space: nowrap; height: 12px; }
.an-dows { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.an-dow { position: relative; padding: 10px 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  text-align: center; overflow: hidden; }
.an-dow b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.an-dow span { font-size: 11px; color: var(--muted); }
.an-dow i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--surface-2); }
.an-dow.on i { background: var(--accent); }
@media (max-width: 560px) { .an-dows { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.ap-dl-wide { grid-template-columns: minmax(0,1fr); gap: 2px 0; }
.ap-dl-wide dt { font-size: 12px; }
.ap-dl-wide dd { margin-bottom: 9px; }

/* Custom-question editor (meeting types) */
.q-list { display: grid; gap: 8px; margin: 4px 0 8px; }
.q-list:empty { display: none; }
/* Flex, not grid: the "choices" field is hidden for every question type except
   "choose one", and a display:none child would shift a grid's remaining items
   into the wrong columns. Flex just reflows around it. */
.q-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.q-row .q-label { flex: 3 1 200px; min-width: 0; }
.q-row [data-qtype] { flex: 0 0 132px; }
.q-row [data-qopts] { flex: 2 1 170px; min-width: 0; }
.q-row [data-qopts][hidden] { display: none; }
.q-req { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; flex: none;
  color: var(--muted); white-space: nowrap; cursor: pointer; }
.q-req input { width: 15px; height: 15px; accent-color: var(--accent); }
.q-del { flex: none; padding-inline: 10px; color: var(--muted); }
.q-del:hover { color: var(--danger); border-color: var(--danger); }
.q-hosts { display: grid; gap: 7px; margin-top: 8px; padding: 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
@media (max-width: 620px) {
  /* Name on its own line, then type + choices, then the row's controls. */
  .q-row { padding: 10px; border: 1px solid var(--border); border-radius: 11px; }
  .q-row .q-label { flex: 1 1 100%; }
  .q-row [data-qtype], .q-row [data-qopts] { flex: 1 1 100%; }
  .q-req { margin-right: auto; }
}

/* Admin — landing-image slots */
.illo-slot-pv { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 8px;
  background: var(--surface-2); max-height: 190px; overflow: hidden; display: grid; place-items: center; }
.illo-slot-pv img { width: 100%; border-radius: 8px; object-fit: cover; max-height: 168px; }

/* Topbar avatar photo (falls back to initials when there is no image) */
.tb-chip { overflow: hidden; padding: 0; }
.tb-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* A table that scrolls inside its own box.
   The min-width:0 chain matters: flex and grid children default to
   min-width:auto, so without it a wide table stretches every ancestor and the
   whole page scrolls sideways instead of just the table. */
.tbl-scroll { overflow-x: auto; max-width: 100%; min-width: 0; }
.ap-detail .stack, .ap-detail .panel, .ap-detail section { min-width: 0; }

/* CRM directory */
.crm-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px; align-items: center; margin-bottom: 16px; padding: 14px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); }
.crm-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
  padding: 10px 14px; border-radius: 12px; background: var(--accent-soft);
  border: 1px solid var(--accent); }
.crm-tbl th, .crm-tbl td { padding: 9px 10px; vertical-align: top; }
.crm-tbl thead th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 650; }
.crm-tbl tbody tr { border-top: 1px solid var(--border); }
.crm-tbl input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); }
.crm-timeline { display: grid; gap: 2px; }
.crm-ev { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.crm-ev:first-child { border-top: 0; }
.crm-ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  flex: none; margin-top: 6px; }

/* Report catalogue */
.rep-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .rep-layout { grid-template-columns: minmax(0,1fr); } }
.rep-nav { border: 1px solid var(--border); border-radius: 14px; padding: 10px; background: var(--surface); }
.rep-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 700; margin: 10px 8px 6px; }
.rep-group:first-child { margin-top: 2px; }
.rep-item { display: block; padding: 8px 10px; border-radius: 9px; font-size: 13.5px;
  text-decoration: none; color: var(--text); }
.rep-item:hover { background: var(--surface-2); }
.rep-item.on { background: var(--accent); color: #fff; font-weight: 650; }

@media (max-width: 620px) {
  /* auto-fit collapses to one column here, so a "span 2" child would force a
     second implicit column and push the page wider than the viewport. */
  .crm-filters { grid-template-columns: minmax(0, 1fr); }
  .crm-filters > * { grid-column: auto !important; }
}
/* Long emails and URLs in the customer record must wrap, not widen the page. */
.ap-dl dd { overflow-wrap: anywhere; }

/* "Not live yet" gate — card library banner */
.pub-gate { border: 1px solid var(--warning-text); background: var(--warning-bg);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.pub-gate-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pub-gate-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid;
  place-items: center; background: var(--surface); color: var(--warning-text); }
.pub-gate-t { font-weight: 750; font-size: 15px; margin: 0; color: var(--warning-text); }
.pub-gate-s { font-size: 13px; margin: 3px 0 0; color: var(--text); opacity: .85; max-width: 60ch; }
.pub-gate-head .btn { margin-left: auto; }
.pub-gate-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-gate-miss { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px; background: var(--surface); color: var(--warning-text); }
@media (max-width: 560px) { .pub-gate-head .btn { margin-left: 0; width: 100%; } }

/* Card not published — public holding page */
.pend { min-height: 100dvh; display: grid; place-items: center; padding: 32px 20px; }
.pend-box { max-width: 420px; text-align: center; padding: 34px 30px; border-radius: 18px; }
.pend-ic { width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 14px; display: grid;
  place-items: center; background: var(--surface-2); color: var(--muted); }
.pend-box h1 { font-size: 20px; margin: 0 0 8px; letter-spacing: -.02em; }
.pend-box p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 20px; }
.pend-box .btn { text-decoration: none; }

/* Live / draft chip on the card library rows */
.card-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; }
.card-live.on { background: var(--success-bg); color: var(--success-text); }
.card-live.off { background: var(--warning-bg); color: var(--warning-text); }

/* ══ Lead pipeline ═══════════════════════════════════════════════════════════
   Stage colours reuse the design-system tokens rather than inventing new hues,
   so the board stays legible in both themes without a second palette. */
.pill-blue   { background: var(--info-bg);    color: var(--info-text); }
.pill-violet { background: var(--accent-soft);color: var(--accent-text); }
.pill-amber  { background: var(--warning-bg); color: var(--warning-text); }
.pill-cyan   { background: var(--info-bg);    color: var(--info-text); }
.pill-green  { background: var(--success-bg); color: var(--success-text); }
.pill-red    { background: var(--danger-bg);  color: var(--danger-text); }
.pill-grey   { background: var(--bg-soft);    color: var(--muted); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-blue { background: var(--info-text); }   .dot-violet { background: var(--accent); }
.dot-amber { background: var(--warning); }    .dot-cyan   { background: var(--info-text); }
.dot-green { background: var(--success); }    .dot-red    { background: var(--danger); }

.chip-xs { display: inline-block; background: var(--bg-soft); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
  font-size: 11px; font-weight: 600; margin: 0 4px 4px 0; }

.brk { overflow-wrap: anywhere; word-break: break-word; }

/* Headline figures */
.lead-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.lead-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
.lead-stat strong { font-size: 22px; line-height: 1.15; }
a.lead-stat:hover { border-color: var(--border-strong); }
.lead-stat.is-due { border-color: var(--warning); }
.lead-stat.is-due strong { color: var(--warning-text); }

/* Due-now strip */
.lead-due { background: var(--warning-bg); border: 1px solid var(--warning); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; }
.lead-due-t { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px;
  color: var(--warning-text); margin: 0 0 8px; }
.lead-due-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
  padding: 5px 0; text-decoration: none; color: var(--text); border-top: 1px solid rgba(0,0,0,.06); }
.lead-due-row:first-of-type { border-top: 0; }
.lead-due-row:hover strong { text-decoration: underline; }

/* Filter bar */
.lead-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px; border-radius: var(--radius); margin-bottom: 14px; }
.lead-filters .input { flex: 1 1 200px; min-width: 0; }
.lead-filters .select { flex: 0 1 auto; }

/* Board */
.lead-board { display: grid; grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 10px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.lead-col { background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 0; }
.lead-col.is-over { border-color: var(--accent); background: var(--accent-soft); }
.lead-col-h { display: flex; align-items: center; gap: 7px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-size: 13px; }
.lead-col-v { margin-left: auto; }
.lead-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.lead-col-more { display: block; text-align: center; padding: 6px; text-decoration: none; }

.lead-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 11px; cursor: grab; }
.lead-card:hover { border-color: var(--border-strong); }
.lead-card.is-dragging { opacity: .45; }
.lead-card.is-due { border-left: 3px solid var(--warning); }
.lead-card-n { font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text);
  display: block; overflow-wrap: anywhere; }
.lead-card-n:hover { text-decoration: underline; }
.lead-card p { margin: 3px 0 0; }
.lead-card-v { font-weight: 700; font-size: 13px; }
.lead-card-t { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.lead-card-t.is-due { color: var(--warning-text); font-weight: 600; }
.lead-card-tags { margin-top: 6px; }
.lead-card-f { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--border); }

/* Detail page */
.lead-detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; }
.lead-h { display: flex; align-items: center; gap: 7px; font-weight: 600; margin: 0 0 12px; font-size: 14px; }
.panel.is-due { border-color: var(--warning); }

.lead-stage-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lead-stage-btn { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; }
.lead-stage-btn:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.lead-stage-btn.is-on { cursor: default; }
.lead-stage-btn.is-on.is-blue   { background: var(--info-bg);     color: var(--info-text);    border-color: transparent; }
.lead-stage-btn.is-on.is-violet { background: var(--accent-soft); color: var(--accent-text);  border-color: transparent; }
.lead-stage-btn.is-on.is-amber  { background: var(--warning-bg);  color: var(--warning-text); border-color: transparent; }
.lead-stage-btn.is-on.is-cyan   { background: var(--info-bg);     color: var(--info-text);    border-color: transparent; }
.lead-stage-btn.is-on.is-green  { background: var(--success-bg);  color: var(--success-text); border-color: transparent; }
.lead-stage-btn.is-on.is-red    { background: var(--danger-bg);   color: var(--danger-text);  border-color: transparent; }

.lead-meet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lead-meet-half { min-width: 0; }
.lead-meet-list { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; }
.lead-meet-row { display: flex; gap: 9px; align-items: center; text-decoration: none;
  color: var(--text); font-size: 13px; }
.lead-meet-row:hover { text-decoration: underline; }

.lead-contact { display: flex; flex-direction: column; gap: 2px; }
.lead-contact-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13.5px; min-width: 0; }
.lead-contact-row:hover { background: var(--bg-soft); }
.lead-msg { background: var(--bg-soft); border-radius: 8px; padding: 10px 12px;
  font-size: 13.5px; margin: 0; overflow-wrap: anywhere; }

.lead-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px;
  margin: 0; font-size: 13px; }
.lead-meta dt { color: var(--muted); }
.lead-meta dd { margin: 0; overflow-wrap: anywhere; }

/* Timeline */
.lead-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.lead-tl-i { display: flex; gap: 11px; padding: 0 0 16px; position: relative; }
.lead-tl-i::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0;
  width: 1px; background: var(--border); }
.lead-tl-i:last-child { padding-bottom: 0; }
.lead-tl-i:last-child::before { display: none; }
.lead-tl-ic { width: 25px; height: 25px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--bg-soft);
  border: 1px solid var(--border); color: var(--muted); }
.lead-tl-email .lead-tl-ic,
.lead-tl-invite .lead-tl-ic { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.lead-tl-meeting .lead-tl-ic { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.lead-tl-stage .lead-tl-ic { background: var(--info-bg); color: var(--info-text); border-color: transparent; }
.lead-tl-h { display: flex; gap: 7px; flex-wrap: wrap; align-items: baseline; margin: 3px 0 0; font-size: 13.5px; }
.lead-tl-b { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.lead-tl-more summary { cursor: pointer; margin-top: 5px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(15, 18, 28, .55);
  display: grid; place-items: start center; padding: 24px 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-box { width: 100%; max-width: 560px; padding: 18px; border-radius: var(--radius-lg); }

@media (max-width: 980px) {
  .lead-detail { grid-template-columns: minmax(0, 1fr); }
  .lead-stats  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-board  { grid-auto-flow: column; grid-auto-columns: 84vw;
                 grid-template-columns: none; scroll-snap-type: x mandatory; }
  .lead-col    { scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .lead-meet { grid-template-columns: minmax(0, 1fr); }
  .lead-filters .select, .lead-filters .input { flex: 1 1 100%; }
}

/* Booking: "we already know who you are" — shown to an invited lead instead of
   asking again for the name, email and phone they already gave us. */
.bk-known { display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft); margin-bottom: 14px; }
.bk-known[hidden] { display: none; }
.bk-known-ic { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--success-bg); color: var(--success-text); }
.bk-known-n { margin: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.bk-known-s { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.bk-known .bk-change { margin-left: auto; flex-shrink: 0; }

/* ══ CRM: companies, contacts, deals ═════════════════════════════════════════ */
.crm-rows { display: flex; flex-direction: column; }
.crm-row { display: flex; align-items: center; gap: 11px; padding: 10px 2px;
  border-top: 1px solid var(--border); text-decoration: none; color: var(--text);
  font-size: 13.5px; min-width: 0; }
.crm-row:first-child { border-top: 0; }
.crm-row:hover b { text-decoration: underline; }
.crm-row > span:nth-child(2) { flex: 1 1 auto; overflow-wrap: anywhere; }
.crm-row > span:last-child { flex-shrink: 0; text-align: right; }
.crm-row-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--bg-soft); color: var(--muted);
  font-size: 11.5px; font-weight: 700; }

.crm-tasks { display: flex; flex-direction: column; }
.crm-task { display: flex; align-items: center; gap: 10px; padding: 8px 2px;
  border-top: 1px solid var(--border); font-size: 13.5px; }
.crm-task:first-child { border-top: 0; }
.crm-task-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.crm-task-box { width: 19px; height: 19px; flex-shrink: 0; border-radius: 5px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: #fff; padding: 0; }
.crm-task-box:hover { border-color: var(--accent); }
.crm-task.is-done .crm-task-box { background: var(--success); border-color: var(--success); }
.crm-task.is-done .crm-task-t { text-decoration: line-through; color: var(--muted); }
.crm-task.is-late .crm-task-t { color: var(--warning-text); font-weight: 600; }

.crm-convert { border-color: var(--accent); }

@media (max-width: 560px) {
  .crm-row { flex-wrap: wrap; }
  .crm-row > span:last-child { text-align: left; }
}

/* ══ Automations ═════════════════════════════════════════════════════════════ */
.au-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--border-strong); }
.au-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }

.au-step { display: inline-grid; place-items: center; width: 21px; height: 21px;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; flex-shrink: 0; }

.au-triggers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.au-trigger { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; min-width: 0; }
.au-trigger:hover { border-color: var(--border-strong); }
.au-trigger.is-on { border-color: var(--accent); background: var(--accent-soft); }
.au-trigger input { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }
.au-trigger > span { min-width: 0; }
.au-trigger b { font-size: 13.5px; }

.au-conf { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.au-conf[hidden] { display: none; }

.au-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.au-row .select { flex: 1 1 200px; min-width: 0; }
.au-row .input { flex: 1 1 140px; min-width: 0; }

.au-act { border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px; }
.au-act-key { flex: 1 1 auto; min-width: 0; }
.au-act-conf { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }

@media (max-width: 640px) {
  .au-triggers { grid-template-columns: minmax(0, 1fr); }
}

/* CRM gate — shown to accounts without the organisation feature */
.crm-lock-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); }

/* ══ Privacy centre ══════════════════════════════════════════════════════════ */
.pc-consent { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; min-width: 0; }
.pc-consent:hover { border-color: var(--border-strong); }
.pc-consent.is-on { border-color: var(--accent); background: var(--accent-soft); }
.pc-consent b { font-size: 14px; }
.pc-consent .chip-xs { margin-left: 7px; vertical-align: 2px; }

.pc-promise { list-style: none; margin: 0; padding: 0; display: flex;
  flex-direction: column; gap: 9px; font-size: 13px; color: var(--muted); }
.pc-promise li { display: flex; gap: 8px; align-items: flex-start; }
.pc-promise svg { flex-shrink: 0; margin-top: 2px; color: var(--success); }

/* ── Feedback ──────────────────────────────────────────────────────────────
   Charts are drawn from CSS widths and one inline SVG rather than a charting
   library — four shapes did not justify the dependency or the payload. */
.fb-bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center; gap: 10px; font-size: 13px; }
.fb-bar-l { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-bar-t { display: block; height: 9px; border-radius: 99px; background: var(--line, rgba(127,127,127,.16)); overflow: hidden; }
.fb-bar-t i { display: block; height: 100%; border-radius: 99px; background: var(--accent);
  transition: width .35s ease; min-width: 2px; }
.fb-bar-n { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.5ch; text-align: right; }
.fb-bar.is-good .fb-bar-t i { background: var(--success, #16a34a); }
.fb-bar.is-mid  .fb-bar-t i { background: var(--warn, #d97706); }
.fb-bar.is-poor .fb-bar-t i { background: var(--danger, #dc2626); }

.fb-spark { width: 100%; height: 90px; display: block; overflow: visible; }

.fb-quote { margin: 0; padding: 11px 13px; border-left: 3px solid var(--accent);
  background: rgba(127,127,127,.05); border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.55; }
.fb-quote cite { display: block; margin-top: 7px; font-size: 12px; font-style: normal; color: var(--muted); }

.fb-form-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none;
  color: inherit; transition: border-color .15s ease; }
.fb-form-row:hover { border-color: var(--accent); }

.stat-u { font-size: .55em; opacity: .5; font-weight: 500; margin-left: 1px; }
.stat .up   { color: var(--success, #16a34a); }
.stat .down { color: var(--danger, #dc2626); }

/* ── Feedback: builder ─────────────────────────────────────────────────── */
.fb-q-edit { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.fb-q-edit > summary { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  cursor: pointer; list-style: none; transition: background .12s ease; }
.fb-q-edit > summary::-webkit-details-marker { display: none; }
.fb-q-edit > summary:hover { background: rgba(127,127,127,.05); }
.fb-q-edit[open] > summary { border-bottom: 1px solid var(--border); }
.fb-q-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 6px; background: rgba(127,127,127,.12); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.fb-q-caret { margin-left: auto; opacity: .45; flex-shrink: 0; }
.fb-q-edit[open] .fb-q-caret { opacity: .8; }
.fb-q-body { padding: 13px; }

.fb-add { border: 1px dashed var(--border); border-radius: 10px; padding: 11px 13px; }
.fb-add > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600;
  font-size: 14px; list-style: none; }
.fb-add > summary::-webkit-details-marker { display: none; }

.fb-qr { display: flex; justify-content: center; padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff; }
.fb-qr img { display: block; max-width: 100%; height: auto; }

.fb-brand-prev { display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  border-left: 4px solid var(--pv, var(--accent)); }
.fb-brand-prev img { width: 36px; height: 36px; object-fit: contain; border-radius: 7px;
  background: #fff; padding: 3px; flex-shrink: 0; }
.fb-brand-ph { display: inline-flex; align-items: center; justify-content: center; width: 36px;
  height: 36px; border-radius: 7px; background: var(--pv, var(--accent)); color: #fff;
  font-weight: 700; font-size: 13px; flex-shrink: 0; }

/* ── Feedback: the public form ─────────────────────────────────────────────
   Built from the app's own surface/field/btn classes so it inherits site
   typography and dark mode. Only the answer widgets are bespoke — nothing in
   the design system draws a 0–10 scale. */
.fbp { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px 56px; }
.fbp-card { width: 100%; max-width: 500px; padding: 26px 24px 24px; border-radius: 16px; }
.fbp-head { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border); }
.fbp-logo { max-height: 34px; max-width: 130px; object-fit: contain; }
.fbp-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.fbp-org { font-size: 13.5px; font-weight: 600; opacity: .8; }
.fbp-title { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.fbp-intro { font-size: 14.5px; line-height: 1.6; opacity: .78; margin: 0 0 16px; }
.fbp-who { display: flex; align-items: center; gap: 7px; font-size: 13px; opacity: .75;
  margin: -6px 0 18px; }
.fbp-form { display: flex; flex-direction: column; gap: 22px; }
.fbp-q { border: 0; padding: 0; margin: 0; min-width: 0; }
.fbp-q legend { display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; padding: 0;
  font-weight: 600; font-size: 15px; line-height: 1.45; margin-bottom: 11px; }
.fbp-step { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px;
  border-radius: 6px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
  flex-shrink: 0; margin-top: 1px; }
.fbp-help { font-size: 13px; opacity: .7; margin: -6px 0 11px; }

.fbp-list { display: flex; flex-direction: column; gap: 7px; }
.fbp-list-2 { flex-direction: row; }
.fbp-list-2 .fbp-pick { flex: 1; justify-content: center; }
.fbp-pick { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .12s ease, background .12s ease; }
.fbp-pick:hover { border-color: var(--accent); }
.fbp-pick input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.fbp-pick:has(input:checked) { border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fbp-pick input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fbp-pick-n { font-weight: 700; font-variant-numeric: tabular-nums; opacity: .4; min-width: 1.2ch; }
.fbp-pick-t { font-size: 14.5px; }

/* Reversed so `~` can light every star before the hovered one. */
.fbp-stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 5px; }
.fbp-stars input { position: absolute; opacity: 0; width: 0; height: 0; }
.fbp-stars label { font-size: 36px; line-height: 1; cursor: pointer; color: var(--border);
  transition: color .12s ease; user-select: none; }
.fbp-stars label:hover, .fbp-stars label:hover ~ label,
.fbp-stars input:checked ~ label { color: #f59e0b; }
.fbp-stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.fbp-nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.fbp-nps-b input { position: absolute; opacity: 0; width: 0; height: 0; }
.fbp-nps-b span { display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.fbp-nps-b:hover span { border-color: var(--accent); }
.fbp-nps-b input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.fbp-nps-b input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fbp-ends { display: flex; justify-content: space-between; font-size: 11.5px; opacity: .6; margin-top: 7px; }
@media (max-width: 400px) { .fbp-nps { grid-template-columns: repeat(6, 1fr); } }

.fbp-send { padding: 14px; font-size: 15px; }
.fbp-foot { display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; opacity: .6; margin: 0; }
.fbp-tick { color: var(--success, #16a34a); margin: 0 0 12px; }

/* ── Organisation dashboard ────────────────────────────────────────────── */
.oc-top { display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 18px; }
.oc-logo { width: 46px; height: 46px; border-radius: 11px; object-fit: contain; background: #fff;
  padding: 4px; border: 1px solid var(--border); flex-shrink: 0; }
.oc-logo-ph { display: inline-flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: 16px; border: 0; padding: 0; }
.oc-name { font-size: 22px; margin: 0; line-height: 1.2; }
.oc-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

.oc-todo { border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px;
  margin-bottom: 16px; }
.oc-todo-h { display: flex; align-items: center; gap: 7px; margin: 0 0 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--muted); }
.oc-todo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-size: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.oc-todo-row:first-of-type { border-top: 0; }
.oc-todo-row::before { content: ""; width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0;
  margin-right: -6px; }
.oc-todo-row.is-bad::before  { background: var(--danger, #dc2626); }
.oc-todo-row.is-warn::before { background: var(--warn, #d97706); }
.oc-todo-row.is-info::before { background: var(--accent); }
.oc-todo-row > span { flex: 1; min-width: 0; }

.oc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px;
  margin-bottom: 16px; }
.oc-kpi { padding: 15px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface, transparent); }
.oc-kpi-l { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12.5px;
  color: var(--muted); font-weight: 600; }
.oc-kpi-v { margin: 0; font-size: 27px; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.oc-kpi-f { margin: 7px 0 0; font-size: 12px; color: var(--muted); }

.oc-delta { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 99px;
  background: rgba(127,127,127,.12); color: var(--muted); }
.oc-delta.is-up   { background: color-mix(in srgb, var(--success, #16a34a) 15%, transparent);
  color: var(--success, #16a34a); }
.oc-delta.is-down { background: color-mix(in srgb, var(--danger, #dc2626) 15%, transparent);
  color: var(--danger, #dc2626); }
.oc-delta.is-new  { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }

.oc-chart { width: 100%; height: 180px; display: block; color: var(--fg, currentColor); }
.oc-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.oc-key { display: flex; align-items: center; gap: 6px; }
.oc-key::before { content: ""; width: 14px; height: 3px; border-radius: 2px; }
.oc-key-a::before { background: var(--accent); }
.oc-key-b::before { background: var(--success, #16a34a);
  background-image: linear-gradient(90deg, var(--success, #16a34a) 60%, transparent 60%);
  background-size: 6px 3px; }

.oc-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
@media (min-width: 940px) { .oc-grid { grid-template-columns: 1.35fr 1fr; } }

.oc-mini-bar { display: block; height: 4px; border-radius: 99px; background: rgba(127,127,127,.14);
  margin-top: 5px; max-width: 160px; overflow: hidden; }
.oc-mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px;
  min-width: 2px; transition: width .4s ease; }

.oc-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.oc-donut { width: 140px; height: 140px; flex-shrink: 0; }
.oc-donut circle { transition: stroke-dasharray .5s ease; }
.oc-donut-v { font-size: 26px; font-weight: 700; fill: currentColor; }
.oc-donut-s { font-size: 11px; fill: currentColor; opacity: .55; }
.oc-donut-key { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
  gap: 9px; font-size: 13.5px; flex: 1; min-width: 120px; }
.oc-donut-key li { display: flex; align-items: center; gap: 8px; }
.oc-donut-key i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.oc-donut-key b { margin-left: auto; font-variant-numeric: tabular-nums; }

.oc-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.oc-feed li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.oc-feed-ic { display: inline-flex; align-items: center; justify-content: center; width: 25px;
  height: 25px; border-radius: 7px; flex-shrink: 0; background: rgba(127,127,127,.12); }
.oc-feed-ic.is-g { background: color-mix(in srgb, var(--success, #16a34a) 16%, transparent);
  color: var(--success, #16a34a); }
.oc-feed-ic.is-m { background: color-mix(in srgb, var(--warn, #d97706) 16%, transparent);
  color: var(--warn, #d97706); }
.oc-feed-ic.is-b { background: color-mix(in srgb, var(--danger, #dc2626) 16%, transparent);
  color: var(--danger, #dc2626); }
.oc-feed-ic.is-a { color: var(--accent); }

/* ── Feedback form: personality ────────────────────────────────────────── */
.fbp-prog { height: 4px; border-radius: 99px; background: rgba(127,127,127,.14);
  overflow: hidden; margin: 0 0 16px; }
.fbp-prog i { display: block; height: 100%; width: 0; border-radius: 99px;
  background: var(--accent); transition: width .35s cubic-bezier(.34,1.4,.64,1); }

.fbp-faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fbp-face { display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px; cursor: pointer; border: 1.5px solid var(--border);
  border-radius: 12px; text-align: center;
  transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.fbp-face input { position: absolute; opacity: 0; width: 0; height: 0; }
.fbp-face-e { font-size: 27px; line-height: 1; filter: grayscale(1); opacity: .5;
  transition: filter .18s ease, opacity .18s ease, transform .25s cubic-bezier(.34,1.5,.64,1); }
.fbp-face-t { font-size: 11px; line-height: 1.25; color: var(--muted); }
.fbp-face:hover { border-color: var(--accent); }
.fbp-face:hover .fbp-face-e { filter: grayscale(.3); opacity: .85; transform: translateY(-2px); }
.fbp-face:has(input:checked) { border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent); }
.fbp-face:has(input:checked) .fbp-face-e { filter: none; opacity: 1; transform: scale(1.22); }
.fbp-face:has(input:checked) .fbp-face-t { color: inherit; font-weight: 600; }
.fbp-face input:focus-visible ~ .fbp-face-e { outline: 2px solid var(--accent);
  outline-offset: 3px; border-radius: 6px; }
@media (max-width: 380px) { .fbp-face-e { font-size: 22px; } .fbp-face-t { font-size: 10px; } }

/* The instant reply. Empty until something is chosen, so it never reserves
   space for a sentence that may never appear. */
.fbp-reply { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); min-height: 0; }
.fbp-reply:empty { display: none; }
.fbp-reply.is-in { animation: fbpReply .32s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes fbpReply { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.fbp-stars label { transition: color .12s ease, transform .18s cubic-bezier(.34,1.5,.64,1); }
.fbp-stars label:hover { transform: scale(1.18) rotate(-6deg); }
.fbp-stars input:checked + label { animation: fbpPop .34s cubic-bezier(.34,1.6,.64,1); }
@keyframes fbpPop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

.fbp-nps-b input:checked + span { animation: fbpPop .3s cubic-bezier(.34,1.6,.64,1); }
.fbp-send.is-sending .fbp-send-t { opacity: .55; }
.fbp-send.is-sending::after { content: "…"; margin-left: 4px; }

.fbp-tick { animation: fbpTick .5s cubic-bezier(.34,1.5,.64,1) both; }
@keyframes fbpTick { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: none; opacity: 1; } }

/* Motion is decoration; anyone who has asked for less gets none of it. */
@media (prefers-reduced-motion: reduce) {
  .fbp-prog i, .fbp-face, .fbp-face-e, .fbp-stars label, .oc-mini-bar i, .oc-donut circle { transition: none; }
  .fbp-reply.is-in, .fbp-stars input:checked + label, .fbp-nps-b input:checked + span,
  .fbp-tick { animation: none; }
  .fbp-face:has(input:checked) .fbp-face-e, .fbp-stars label:hover { transform: none; }
}

/* ── Ordering printed cards for staff ──────────────────────────────────── */
.nfc-pick { display: flex; align-items: center; gap: 11px; padding: 11px 13px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .12s ease, background .12s ease; }
.nfc-pick:hover { border-color: var(--accent); }
.nfc-pick:has(input:checked) { border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); }
.nfc-pick.is-busy { opacity: .55; cursor: not-allowed; }
.nfc-pick.is-busy:hover { border-color: var(--border); }
.nfc-pick .chip-xs { margin-left: auto; flex-shrink: 0; }

.nfc-sum { position: sticky; top: 16px; }
.nfc-total { padding-top: 11px; margin-top: 4px; border-top: 1px solid var(--border);
  font-size: 15px; }
.nfc-total strong { font-size: 19px; font-variant-numeric: tabular-nums; }

.nfc-order { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }

/* ── Departments board ─────────────────────────────────────────────────── */
.dept-add { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600;
  font-size: 14px; list-style: none; }
.dept-add::-webkit-details-marker { display: none; }

/* ── Bulk staff import ─────────────────────────────────────────────────── */
.imp-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 780px) { .imp-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
.imp-h { font-weight: 600; font-size: 13.5px; margin: 0 0 6px; }

/* ── Organisation calendar ─────────────────────────────────────────────── */
.cal-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--border); border-radius: 99px; font-size: 13.5px;
  text-decoration: none; color: inherit; transition: border-color .12s ease, background .12s ease; }
.cal-tab:hover { border-color: var(--accent); }
.cal-tab span { font-variant-numeric: tabular-nums; font-weight: 600; opacity: .55; }
.cal-tab.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cal-tab.is-on span { opacity: 1; color: var(--accent); }

/* ── Discounted pricing ────────────────────────────────────────────────────
   One look wherever a promotion appears — pricing page, checkout, billing. */
.co-was { font-size: .68em; font-weight: 600; color: var(--muted); opacity: .6;
  margin-right: 8px; text-decoration-thickness: 2px; }
.co-save { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 700;
  color: var(--success, #16a34a);
  background: color-mix(in srgb, var(--success, #16a34a) 12%, transparent);
  padding: 3px 9px; border-radius: 99px; }

.pb { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pb-was { color: var(--muted); opacity: .6; font-weight: 600; text-decoration-thickness: 2px; }
.pb-now { font-weight: 800; }
.pb-per { font-size: .6em; font-weight: 600; color: var(--muted); }
.pb-save { font-size: 11.5px; font-weight: 700; color: var(--success, #16a34a);
  background: color-mix(in srgb, var(--success, #16a34a) 12%, transparent);
  padding: 2px 8px; border-radius: 99px; }

/* ── Account profile (admin) ───────────────────────────────────────────── */
.up-score { display: inline-block; min-width: 2.6ch; padding: 2px 8px; border-radius: 99px;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.up-score.is-high { background: color-mix(in srgb, var(--success, #16a34a) 15%, transparent); color: var(--success, #16a34a); }
.up-score.is-medium { background: color-mix(in srgb, var(--warn, #d97706) 15%, transparent); color: var(--warn, #d97706); }
.up-score.is-low { background: rgba(127,127,127,.14); color: var(--muted); }

.up-profile { padding: 18px 20px; margin: 14px 0; border-radius: 14px; }
.up-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.up-head .pill { margin-right: 6px; }
.up-score-big { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.up-score-big small { font-size: 14px; font-weight: 600; opacity: .45; }
.up-score-big.is-high { color: var(--success, #16a34a); }
.up-score-big.is-medium { color: var(--warn, #d97706); }
.up-score-big.is-low { color: var(--muted); }
.up-why { margin: 10px 0 0; max-width: 88ch; line-height: 1.6; }
.up-flag { margin: 10px 0 0; font-size: 13px; padding: 8px 12px; border-radius: 9px;
  border-left: 3px solid var(--border); background: rgba(127,127,127,.05); }
.up-flag.is-red { border-left-color: var(--danger, #dc2626); }
.up-flag.is-amber { border-left-color: var(--warn, #d97706); }
.up-flag.is-green { border-left-color: var(--success, #16a34a); }
.up-grid { display: grid; grid-template-columns: 1fr; gap: 22px; margin-top: 18px; }
@media (min-width: 860px) { .up-grid { grid-template-columns: 1.1fr 1fr; gap: 30px; } }
.up-h { font-weight: 600; font-size: 13px; margin: 0 0 10px; }
.up-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); opacity: .75; }

/* ── Person profile (admin) ────────────────────────────────────────────── */
.pp-card { padding: 22px 24px; margin: 14px 0; border-radius: 14px; }
.pp-top { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.pp-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 3px solid var(--surface, #fff); box-shadow: 0 0 0 1px var(--border); }
.pp-photo-ph { display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 30px; letter-spacing: -.02em; }
.pp-name { font-size: 23px; margin: 0 0 3px; line-height: 1.2; }
.pp-headline { font-size: 15px; margin: 0 0 7px; opacity: .85; }
.pp-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 8px;
  font-size: 13px; color: var(--muted); }
.pp-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pp-links { margin: 0; font-size: 13px; }
.pp-bio { margin: 18px 0 0; font-size: 14.5px; line-height: 1.65; max-width: 78ch;
  padding-top: 16px; border-top: 1px solid var(--border); }
.pp-block { margin-top: 18px; }
.pp-h { font-weight: 600; font-size: 13px; margin: 0 0 9px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pp-chip { font-size: 12.5px; padding: 4px 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
.pp-grid { display: grid; grid-template-columns: 1fr; gap: 22px; margin-top: 20px;
  padding-top: 18px; border-top: 1px solid var(--border); }
@media (min-width: 780px) { .pp-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.pp-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); opacity: .7; }

/* ── Export centre ─────────────────────────────────────────────────────── */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.ex-card { padding: 15px 16px; border-radius: 12px; display: flex; flex-direction: column;
  gap: 12px; justify-content: space-between; }
.ex-name { font-weight: 600; font-size: 14.5px; margin: 0 0 3px; }
.ex-desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; }
.ex-count { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px;
  background: rgba(127,127,127,.12); padding: 3px 9px; border-radius: 99px; flex-shrink: 0; }
.ex-empty { opacity: .45; cursor: default; pointer-events: none; }

/* ── Show my QR ─────────────────────────────────────────────────────────
   The stage paints its own white ground and dark text instead of the theme
   tokens. A QR code is read by a camera: on the dark theme, themed surfaces
   would put dark modules on a dark ground and the code would not scan. This is
   the one place in the app where ignoring the theme is the correct answer. */
.qr-switch { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.qr-switch-item { font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--muted); text-decoration: none; }
.qr-switch-item:hover { border-color: var(--border-strong); color: var(--text); }
.qr-switch-item.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.qr-stage { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 30px 20px 26px; display: flex; flex-direction: column; align-items: center;
  gap: 18px; box-shadow: var(--shadow-sm); }

/* The quiet zone. A QR needs clear margin on all four sides or the corner
   finder patterns cannot be located. */
.qr-plate { background: #fff; padding: 14px; border-radius: 12px; line-height: 0; }
.qr-code { width: min(300px, 68vw); }
.qr-code svg { display: block; width: 100%; height: auto; }

.qr-meta { text-align: center; }
.qr-name { font-size: 19px; font-weight: 700; margin: 0; color: #111827; }
.qr-role { font-size: 13.5px; margin: 3px 0 0; color: #4b5563; }
.qr-url  { font-size: 12.5px; margin: 9px 0 0; color: #6b7280; font-variant-numeric: tabular-nums;
  word-break: break-all; }

.qr-exit { position: absolute; top: 18px; right: 18px; font: 600 14px/1 inherit;
  padding: 10px 18px; border-radius: 99px; border: 1px solid #d1d5db;
  background: #fff; color: #111827; cursor: pointer; }
.qr-exit:hover { background: #f3f4f6; }

/* Full screen — used with the Fullscreen API, and also correct on its own if
   the request is refused (iOS Safari on iPhone does not grant it). */
.qr-stage.qr-full { position: fixed; inset: 0; z-index: 300; border: 0; border-radius: 0;
  justify-content: center; padding: 24px; box-shadow: none; }
.qr-stage.qr-full .qr-code { width: min(78vh, 86vw); }
.qr-stage.qr-full .qr-name { font-size: 24px; }

.qr-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.qr-stage.qr-full ~ .qr-actions { display: none; }
