/* ==========================================================================
   VirtualID — Design System (shared stylesheet)
   This is the DESIGN/TEMPLATE layer. Keep it separate from page content.
   Minimalist, fast, responsive, near-zero graphics. System fonts only.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-inset: #eef1f4;
  --fg: #1a1d21;
  --fg-soft: #565d66;
  --fg-faint: #8a929c;
  --border: #e3e7ec;
  --brand: #3b5bdb;      /* indigo */
  --brand-fg: #ffffff;
  --brand-soft: #edf0fd;
  --ok: #2f9e44;
  --warn: #e8590c;
  --danger: #e03131;
  --radius: 10px;
  --radius-lg: 16px;
  --maxw: 1080px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Warning surface: a soft amber background with a STRONG dark-amber foreground.
     --warn-strong is an explicit fg so text on --warn-soft stays readable and is
     NOT inherited from --fg (which flips light in dark mode -> unreadable). */
  --warn-soft: #fff7e6;
  --warn-strong: #7a4f01;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --bg-soft: #151922; --bg-inset: #1c212b;
    --fg: #e8ecf1; --fg-soft: #aab3bf; --fg-faint: #727c88;
    --border: #262c37; --brand: #748ffc; --brand-soft: #1a2036;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35);
    /* Keep the warn surface a light amber with dark text in BOTH themes: the
       banner is intentionally a high-visibility "attention" chip, so it does not
       invert with the dark theme. Dark text on soft amber stays readable. */
    --warn-soft: #fbe9c6;
    --warn-strong: #6b4402;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Never allow horizontal overflow to trigger mobile shrink-to-fit zoom, which
   would push the fixed mobile top bar (hamburger menu) out of view. */
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0; font-family: var(--font); color: var(--fg);
  background: var(--bg); line-height: 1.55; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 680; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--fg-soft); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--fg-faint); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-inset); padding: .12em .4em; border-radius: 6px; }

/* Layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.grid { display: grid; gap: 20px; }
/* Grid items default to min-width:auto, which prevents inner scroll containers
   (e.g. .table-scroll) from shrinking below their content — they overflow the
   cell instead of scrolling. min-width:0 lets the .table-scroll wrapper become
   the real horizontal-scroll container inside a grid cell. */
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { text-align: center; }
.muted { color: var(--fg-faint); }
/* Error state for status/message lines (login, join, forms): overrides .muted so
   failures like "rate limit exceeded" or "invalid username" are clearly red. */
.status-error { color: var(--danger); font-weight: 600; }
.stack > * + * { margin-top: 14px; }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .hide-mobile { display: none !important; }
  /* Give wide tables a legible min-width so columns don't crush/wrap; the
     .table-scroll wrapper then shows a horizontal scrollbar only when the
     content actually overflows the viewport. */
  .table-scroll > .table { min-width: 560px; }
  /* Narrow 2-column tables (e.g. invitation meta) shouldn't be forced to
     scroll — no oversized min-width. */
  .table-scroll > .table-narrow { min-width: 0; }
  /* Safety net: a bare .table (no wrapper) inside a card can still scroll,
     so a future table that forgets tableScroll() never clips columns. */
  .card > .table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
}

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 720; color: var(--fg); font-size: 1.1rem; letter-spacing: -.02em; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand .brand-logo { flex: none; }
.brand .logo { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--fg-soft); font-weight: 550; font-size: .95rem; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }
/* The 'Get started' CTA is a .btn.btn-primary inside .nav-links; the generic
   .nav-links a color (specificity 0-1-1) would otherwise override .btn-primary
   (0-1-0) and render dark text on the indigo fill. Restore readable button text
   at higher specificity (mirrors the site/ .btn.btn-primary fix). */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: var(--brand-fg); }
@media (max-width: 760px) { .nav-links a.nav-collapse { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; line-height: 1;
  padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.btn-primary, a.btn-primary { background: var(--brand); color: var(--brand-fg); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
/* Ghost button placed directly on a dark modal backdrop (outside the white card):
   default label would be near-invisible, so force it white at rest. On hover the
   button fills with the light --bg-soft, so we flip the label back to dark --fg
   to stay readable. Used by the profile-preview + contact-editor Close buttons. */
.btn-ghost.btn-on-overlay { color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost.btn-on-overlay:hover { color: var(--fg); border-color: var(--border); }
.btn-block { width: 100%; justify-content: center; }
/* Keep an inline icon (e.g. the passkey lock) optically centered with the
   button label. align-items:center on .btn centers the flex children; the
   button gets line-height:1 (above) and the icon svg is display:block so
   neither carries a text-baseline offset that pushes the lock high / text low. */
.btn > .icon { line-height: 0; flex: 0 0 auto; }
.btn > .icon svg { display: block; }
/* Optical-center the lock glyph: in the passkey icon the drawn shape spans
   y=7..21 of the 24-unit viewBox (optical center ~14, not the box center 12),
   so align-items:center leaves it sitting ~1.5px high. Nudge it down. Also
   guard against the higher-specificity `.card .icon` rule (30px + margin-bottom)
   leaking onto button icons when the button lives inside a .card. */
.card .btn > .icon { width: 18px; height: 18px; margin: 0; color: inherit; }
.btn > .icon { position: relative; top: 0.5px; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; font-weight: 650; }
/* Ghost-style destructive action: transparent by default, fills red on hover.
   Sized identically to .btn-ghost so it lines up in row-action groups. */
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
/* Disabled buttons: muted, non-interactive, no hover lift. */
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; background: transparent; filter: none; }
.btn-primary:disabled:hover { background: var(--brand); }
/* Consistent layout for a group of row/inline actions (replaces ` · ` dots). */
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cards */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  /* Allow inner .table-scroll to shrink & scroll rather than overflow the card. */
  min-width: 0;
}
.card h3 { margin-bottom: 6px; }
.card .icon { width: 30px; height: 30px; color: var(--brand); margin-bottom: 12px; }

/* Hero */
.hero { padding: 80px 0 56px; text-align: center; }
.hero .tagline { color: var(--brand); font-weight: 640; letter-spacing: .02em; text-transform: uppercase; font-size: .8rem; }
.hero p.lead { font-size: 1.2rem; max-width: 620px; margin: 12px auto 26px; }
.eyebrow { display:inline-block; background: var(--brand-soft); color: var(--brand); font-weight:600; font-size:.78rem; padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }

/* Badges / pills */
.badge { display:inline-flex; align-items:center; gap:6px; font-size:.75rem; font-weight:600; padding: 3px 10px; border-radius: 999px; background: var(--bg-inset); color: var(--fg-soft); }
.badge-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }

/* Forms (mock) */
.field { margin-bottom: 16px; }
.label { display:block; font-weight:600; font-size:.85rem; margin-bottom:6px; color: var(--fg); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--fg); font: inherit;
}
.input:focus, .textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
/* Absolute date/time rendered by the timezone helper: the native `title`
   tooltip reveals the UTC time on hover; the help cursor hints at it. */
.dt { cursor: help; }
.toggle { width: 40px; height: 24px; border-radius: 999px; background: var(--bg-inset); position: relative; border: none; cursor: pointer; }
.toggle.on { background: var(--brand); }
.toggle::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:.15s; }
.toggle.on::after { left: 19px; }

/* Table */
.table { width:100%; border-collapse: collapse; font-size: .92rem; }
/* Horizontally-scrollable wrapper for data tables. Wide multi-column tables
   would otherwise be clipped by the global `html,body{overflow-x:hidden}`
   (which stays, to prevent mobile shrink-to-fit zoom). The wrapper scrolls
   within its own box, so no column is unreachable on a narrow phone. */
.table-scroll-frame { position:relative; width:100%; }
.table-scroll { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
/* Scroll affordance: edge fades that appear only when more content exists in
   that direction. Classes .can-scroll-left / .can-scroll-right are toggled by
   enhanceTableScroll() (dom.ts) on scroll/resize. Fades are non-interactive so
   they never intercept clicks (e.g. the Exposed toggle) and are sized to sit
   above the horizontal scrollbar. */
.table-scroll-frame::before, .table-scroll-frame::after {
  content:""; position:absolute; top:0; bottom:0; width:32px; pointer-events:none;
  opacity:0; transition:opacity .15s ease; z-index:2;
}
.table-scroll-frame::before { left:0; background:linear-gradient(to right, var(--bg), transparent); }
.table-scroll-frame::after  { right:0; background:linear-gradient(to left, var(--bg), transparent); }
.table-scroll-frame.can-scroll-left::before  { opacity:1; }
.table-scroll-frame.can-scroll-right::after  { opacity:1; }
/* Keep the Exposed toggle column tappable and never crushed on mobile. */
.table .col-exposed { width:1%; white-space:nowrap; min-width:64px; text-align:center; }
.table th, .table td { text-align:left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--fg-faint); font-weight:600; font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; }
.table tr:hover td { background: var(--bg-soft); }

/* App shell (portal) */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); background: var(--bg-soft); padding: 18px 14px; display: flex; flex-direction: column; }
.sidebar .brand { padding: 6px 8px 18px; }
.side-link { display:flex; align-items:center; gap:10px; padding: 9px 10px; border-radius: 8px; color: var(--fg-soft); font-weight:550; font-size:.93rem; }
.side-link:hover { background: var(--bg-inset); color: var(--fg); text-decoration:none; }
.side-link.active { background: var(--brand-soft); color: var(--brand); }
.side-link .icon { width: 18px; height: 18px; }
/* Subtle version stamp pinned at the bottom of the menu. Low-contrast on purpose
   so it's available without drawing attention. On mobile it sits at the bottom of
   the open drawer. */
.side-version { margin-top: auto; padding: 12px 10px 4px; color: var(--fg-soft); opacity: .6; font-size: .72rem; letter-spacing: .01em; user-select: text; }
.side-version:hover { opacity: .85; }
.main { padding: 26px 30px; min-width: 0; display: flex; flex-direction: column; }
.portal-footer { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--border); color: var(--fg-soft); font-size: .82rem; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-preview { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 720; font-size: 1.6rem; flex: none; }
.avatar-hint { color: var(--fg-soft); font-size: .82rem; margin: 4px 0 0; }
.vlink { color: var(--brand); text-decoration: none; border-bottom: 1px solid transparent; }
.vlink:hover { border-bottom-color: currentColor; }
.vlink-off { color: var(--fg); cursor: text; border-bottom: none; }
.portal-footer a { color: var(--fg-soft); }
.portal-footer a:hover { color: var(--brand); }
.card-stale { opacity: .62; filter: grayscale(.4); }
.card-stale::after { content: ""; }
/* Fully-inactive (owner revoked): heavier gray to read as "no longer shared". */
.card-revoked { opacity: .5; filter: grayscale(1); }
.page-head { margin-bottom: 22px; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar:not(.drawer) { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px; padding-top: calc(72px + env(safe-area-inset-top)); }
  .topbar { display: flex !important; }
  .sidebar.drawer { display: flex !important; }
}

/* Mobile top app bar (hidden on desktop) */
.topbar {
  display: none; align-items: center; gap: 10px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 56px;
  padding: env(safe-area-inset-top) calc(14px + env(safe-area-inset-right)) 0 calc(14px + env(safe-area-inset-left));
  box-sizing: content-box; min-height: 56px;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.topbar .brand { font-size: 1.05rem; }
.hamburger, .drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; background: transparent;
  color: var(--fg); border-radius: 8px; cursor: pointer; padding: 0;
}
.hamburger:hover, .drawer-close:hover { background: var(--bg-inset); }

/* Mobile slide-in drawer + scrim (hidden on desktop) */
.drawer-scrim {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.42); opacity: 0; transition: opacity .2s ease;
}
.drawer-scrim.open { display: block; opacity: 1; }
.sidebar.drawer {
  display: none; position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  width: 260px; max-width: 84vw; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left);
  transform: translateX(-100%); transition: transform .22s ease;
  overflow-y: auto; box-shadow: var(--shadow);
}
.sidebar.drawer.open { transform: translateX(0); }
.drawer-close { align-self: flex-end; margin-bottom: 4px; }
@media (min-width: 861px) {
  .topbar, .drawer-scrim, .sidebar.drawer { display: none !important; }
}

/* QR mock (CSS only, no image) */
.qr { width: 120px; height: 120px; border-radius: 10px; background:
  conic-gradient(from 0deg, var(--fg) 0 25%, transparent 0 50%, var(--fg) 0 75%, transparent 0);
  background-size: 20px 20px; border: 6px solid var(--fg); background-color: var(--bg); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--fg-faint); font-size:.9rem; margin-top: 40px; }
.site-footer a { color: var(--fg-soft); }
.footer-cols { display:flex; gap:60px; flex-wrap: wrap; }
.footer-cols h4 { font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; color: var(--fg-faint); }
.footer-cols a { display:block; margin: 6px 0; }

/* Utilities */
.mockup-banner { background: var(--warn); color:#fff; text-align:center; font-size:.8rem; padding:6px; font-weight:600; letter-spacing:.02em; }
.pill-row { display:flex; gap:8px; flex-wrap:wrap; }
.divider { height:1px; background: var(--border); margin: 24px 0; border:0; }
/* Labelled separator between two intents (e.g. sign in / create account on the
   login card): a horizontal rule with a small centered caption. */
.or-sep { display:flex; align-items:center; gap:12px; margin: 22px 0 14px; color: var(--fg-faint); }
.or-sep::before, .or-sep::after { content:""; flex:1; height:1px; background: var(--border); }
.or-sep span { font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; }
/* Checklist of shared fields (invite/subscribe pages): a green ✓ per item. */
.checks { display:grid; gap:8px; margin:6px 0 2px; }
.check { position:relative; padding-left:26px; font-size:.95rem; }
.check::before { content:"\2713"; position:absolute; left:0; top:0; width:18px; height:18px;
  display:flex; align-items:center; justify-content:center; border-radius:50%;
  background: rgba(45,164,78,.14); color:#2f9e44; font-size:.72rem; font-weight:800; }
.kpi { font-size: 2rem; font-weight: 720; letter-spacing:-.02em; }
.kpi-card { display:block; text-decoration:none; color:inherit; cursor:pointer; transition:transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.kpi-card:hover { transform:translateY(-2px); border-color:var(--brand); box-shadow:0 6px 20px rgba(0,0,0,.18); }
.kpi-card:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.kpi-card .kpi-cta { margin-top:4px; opacity:0; transition:opacity .12s ease; }
.kpi-card:hover .kpi-cta, .kpi-card:focus-visible .kpi-cta { opacity:1; }

/* Initial Setup onboarding checklist (shown first 14 days after signup). */
.setup-section { margin-bottom: 30px; }
.setup-step { display:flex; align-items:flex-start; gap:14px; text-decoration:none; color:inherit; cursor:pointer; transition:transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.setup-step:hover { transform:translateY(-2px); border-color:var(--brand); box-shadow:0 6px 20px rgba(0,0,0,.18); }
.setup-step:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.setup-step-num { flex:0 0 auto; width:30px; height:30px; border-radius:50%; background:var(--brand); color:#fff; font-weight:700; display:flex; align-items:center; justify-content:center; font-size:.95rem; }
.setup-step-body { flex:1 1 auto; min-width:0; }
.setup-step-title { font-weight:640; margin-bottom:2px; }
.setup-step-cta { align-self:center; opacity:0; transition:opacity .12s ease; }
.setup-step:hover .setup-step-cta, .setup-step:focus-visible .setup-step-cta { opacity:1; }
.setup-step-static { cursor:default; }
.setup-step-static:hover { transform:none; border-color:var(--border); box-shadow:var(--shadow); }
.setup-inline-link { color:var(--brand); text-decoration:underline; cursor:pointer; }
.setup-inline-link:hover { text-decoration:none; }

/* Icon-only links on/off toggle pinned to the profile card's top-right corner. */
.links-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-soft); color: var(--fg-soft); cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.links-toggle:hover { background: var(--bg-inset); color: var(--fg); }
.links-toggle[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

/* Brand block in the sidebar/drawer: wordmark on top, signed-in @username below. */
.brand-block { display: flex; flex-direction: column; gap: 2px; }
.brand-user { color: var(--fg-soft); font-size: .8rem; padding-left: 2px; letter-spacing: .01em; }
.handle-link { text-decoration: none; }
.handle-link:hover { text-decoration: underline; }

/* Add-fields catalog (Fields page modal) */
.catalog-list { display:flex; flex-direction:column; gap:2px; max-height:46vh; overflow:auto; margin-top:8px; }
.catalog-group { margin:14px 0 4px; font-size:.8rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.catalog-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; border:1px solid var(--border); border-radius:10px; }
.catalog-row.is-added { opacity:.6; }
.catalog-row-label { font-weight:600; }
.custom-field-section { margin-top:4px; }
.custom-field-section .field-label { display:block; }
.custom-field-section .field-label small { display:block; color:var(--muted); margin-bottom:4px; }
.custom-field-section .field-label .input { width:100%; }
.custom-field-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.custom-field-row .input { flex:1 1 180px; min-width:0; }
.custom-field-row .select { flex:0 0 120px; }
/* Passkey account-picker login (portal) */
.btn-passkey { font-size: 1rem; padding: 12px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.acct-list { display: flex; flex-direction: column; gap: 8px; }
.acct-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; transition: .15s; font: inherit; color: var(--fg);
}
.acct-row:hover { background: var(--bg-soft); border-color: var(--brand); transform: translateY(-1px); }
.acct-row:disabled { opacity: .6; cursor: default; transform: none; }
.acct-name { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.acct-user { font-weight: 640; font-size: .95rem; }
.acct-alias { font-size: .8rem; }
.acct-forget {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: .9rem; line-height: 1; transition: .15s;
}
.acct-forget:hover { background: var(--danger); color: #fff; }

/* Drag-and-drop field reordering (owner exposure editor + subscriber contact card) */
.drag-handle {
  cursor: grab; user-select: none; color: var(--muted);
  font-size: 1rem; line-height: 1; padding: 0 4px; touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
tr[draggable="true"], .drag-row { cursor: default; }
.dragging { opacity: .5; }
.drag-over { box-shadow: inset 0 2px 0 0 var(--brand); }
.drag-over-tr > td { box-shadow: inset 0 2px 0 0 var(--brand); }

/* Shared blurred modal overlay (QR modal, profile editor, etc.). The blur hides
   sensitive content behind the modal for privacy (e.g. other share links when
   showing a QR to someone). Degrades to a solid dim where backdrop-filter is
   unsupported. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* On short/mobile viewports a tall modal card can exceed the screen; align to
   the top and let the overlay scroll so the whole form stays reachable. */
@media (max-height: 720px) {
  .modal-overlay { align-items: flex-start; }
}

/* Dashboard pending-approvals alert (top-of-page, above Initial Setup + KPIs) */
.approvals-alert {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin: 0 0 20px;
  background: var(--brand-soft, #eef4ff);
  border: 1px solid var(--brand);
  border-left-width: 4px;
  border-radius: 12px;
}
.approvals-alert-text { flex: 1; min-width: 0; font-weight: 700; }
.approvals-alert .btn { flex-shrink: 0; }
.approvals-alert-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
  animation: approvals-pulse 1.8s ease-in-out infinite;
}
@keyframes approvals-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* Deep-link target highlight: briefly flashes a settings section that was
   navigated to via #/settings?section=<id> (e.g. the dashboard "Add email"
   prompt). Added/removed by renderSettings. */
.section-flash {
  animation: section-flash 1.6s ease-out;
}
@keyframes section-flash {
  0%   { box-shadow: 0 0 0 3px var(--brand); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
