/* Pontiac Land · Digital business cards
   Brand navy #002957 · champagne accent · Jost (a free look-alike of Futura PT) */

:root {
  --navy: #002957;
  --navy-ink: #101b67;
  --navy-deep: #00183a;
  --gold: #b8995a;
  --gold-2: #d9c39a;
  --gold-soft: #f3ead8;

  --bg: #f5f3ef;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, #e9e3d6 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #e6e9f0 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f8f6f2;
  --surface-3: #f0ede6;
  --ink: #0d1a33;
  --ink-2: #33405a;
  --muted: #6b7180;
  --line: rgba(13, 26, 51, 0.09);
  --line-2: rgba(13, 26, 51, 0.14);
  --primary: #002957;
  --primary-hover: #0a3a73;
  --on-primary: #ffffff;
  --accent: #a8864a;
  --danger: #b42318;
  --success: #1f7a4d;
  --focus: 0 0 0 3px rgba(184, 153, 90, 0.45);
  --shadow-sm: 0 1px 2px rgba(13, 26, 51, 0.06), 0 2px 8px rgba(13, 26, 51, 0.04);
  --shadow: 0 2px 6px rgba(13, 26, 51, 0.05), 0 12px 32px rgba(13, 26, 51, 0.08);
  --shadow-lg: 0 10px 30px rgba(13, 26, 51, 0.10), 0 30px 80px rgba(13, 26, 51, 0.14);
  --glass: rgba(255, 255, 255, 0.72);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --r-xl: 30px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Jost', 'Futura PT', 'Futura', 'Avenir Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --top-h: 68px;
  --tab-h: 72px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #090e18;
  --bg-grad: radial-gradient(1200px 600px at 85% -10%, rgba(0, 41, 87, 0.55) 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(184, 153, 90, 0.10) 0%, transparent 55%);
  --surface: #111827;
  --surface-2: #151e30;
  --surface-3: #1b2639;
  --ink: #eef1f6;
  --ink-2: #c9cfda;
  --muted: #9099aa;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --primary: #d6bd8c;
  --primary-hover: #e4cd9f;
  --on-primary: #0b1424;
  --accent: #d6bd8c;
  --danger: #f2877d;
  --success: #5fc596;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4), 0 30px 80px rgba(0, 0, 0, 0.5);
  --glass: rgba(14, 20, 33, 0.72);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
#app { overflow-x: clip; max-width: 100vw; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
}
.theme-anim, .theme-anim * { transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease) !important; }
body.sheet-open, body.scanning { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 32px 16px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 300; background: var(--surface); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.eyebrow { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.eyebrow-gold { color: var(--gold); }
.page-loading { min-height: 60vh; display: grid; place-items: center; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */

.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; background: var(--surface-3); color: var(--ink);
  font-weight: 500; font-size: 15px; letter-spacing: 0.01em; cursor: pointer; white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.25s var(--ease), border-color 0.2s, color 0.2s;
  position: relative; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px rgba(0, 41, 87, 0.22); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 10px 26px rgba(0, 41, 87, 0.28); }
:root[data-theme='dark'] .btn-primary { box-shadow: 0 6px 22px rgba(214, 189, 140, 0.18); }
.btn-gold { background: linear-gradient(135deg, #cdb07a, #a8864a); color: #fff; box-shadow: 0 6px 18px rgba(168, 134, 74, 0.3); }
.btn-gold:hover { box-shadow: 0 10px 24px rgba(168, 134, 74, 0.38); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-text { color: var(--danger); }
.btn-glass { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.22); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 14px; }
.btn-xs { --h: 30px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-xs .ic { width: 15px; height: 15px; }
.btn-lg { --h: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-pill { border-radius: 999px; }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }
.is-busy { pointer-events: none; }
.btn.is-busy > * { opacity: 0; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}

.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%;
  background: transparent; border: 1px solid transparent; cursor: pointer; color: var(--ink-2);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease); position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn-glass { background: rgba(0, 0, 0, 0.35); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.icon-btn-glass:hover { background: rgba(0, 0, 0, 0.5); color: #fff; }
.icon-btn-spacer { width: 42px; }

.round-btn {
  width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--navy); color: #fff; border: 0; cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.round-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 41, 87, 0.3); }
:root[data-theme='dark'] .round-btn { background: var(--surface-3); color: var(--gold-2); }

/* Segmented controls */
.seg {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
}
.seg button, .seg .seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 999px; border: 0; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.25s var(--ease); white-space: nowrap;
}
.seg .ic { width: 16px; height: 16px; }
.seg [aria-selected='true'], .seg [aria-checked='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg-sm button, .seg-sm .seg-btn { height: 30px; padding: 0 12px; font-size: 13px; }
.seg-full { display: flex; }
.seg-full button { flex: 1; justify-content: center; }
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }

/* Chips and badges */
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2); font-size: 12.5px; font-weight: 500;
}
.chip .ic { width: 14px; height: 14px; }
.chip-sm { height: 22px; font-size: 11.5px; padding: 0 8px; }
.chip-gold { background: var(--gold-soft); color: #8a6a2f; }
:root[data-theme='dark'] .chip-gold { background: rgba(214, 189, 140, 0.14); color: var(--gold-2); }
.chip-ok { background: rgba(31, 122, 77, 0.1); color: var(--success); }
.dot-gold { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin: 0 6px; vertical-align: middle; }
.sample-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  background: rgba(200, 176, 122, 0.22); color: #c8b07a; border: 1px solid rgba(200, 176, 122, 0.4);
}

/* Avatars */
.avatar {
  --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; overflow: hidden;
  display: inline-grid; place-items: center; background: var(--surface-3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  background: linear-gradient(145deg, #0a3a73, #002957); color: var(--gold-2);
  font-weight: 500; letter-spacing: 0.04em; font-size: calc(var(--s) * 0.36);
}
.avatar-initials:not(.is-pontiac) { background: linear-gradient(145deg, #3b4357, #252c3c); color: #e8e3d8; }
.avatar-initials.is-pontiac, .cl-avatar.avatar-initials, .fc-avatar.avatar-initials { background: linear-gradient(145deg, #0a3a73, #002957); color: var(--gold-2); }
.avatar-sm { --s: 34px; }
.avatar-xl { --s: 88px; }
.me-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; margin-left: 4px; }
.me-btn .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-2); transition: box-shadow 0.2s; }
.me-btn:hover .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--gold); }

/* Logo */
.logo { display: block; }
.logo-mark { display: block; width: 22px; height: 26px; }
.logo-inline { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); }
:root[data-theme='dark'] .logo-inline { color: var(--gold-2); }
.logo-word { font-size: 13px; letter-spacing: 0.32em; font-weight: 500; white-space: nowrap; }

/* ---------- App shell ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 max(20px, env(safe-area-inset-left));
  background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; height: 44px; border-radius: 10px; }
.tabs { display: flex; gap: 4px; margin: 0 auto; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  color: var(--muted); font-weight: 500; font-size: 15px; border: 0; background: none; cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); background: var(--surface-3); }
.tabs a[aria-current='page'] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.tabs .tabs-scan { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.tabs + .top-actions { margin-left: 0; }

.bell-btn .badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: linear-gradient(135deg, #cdb07a, #a8864a); color: #fff; font-size: 11px; font-weight: 600;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); line-height: 1;
}
.bell-btn .badge[hidden] { display: none; }
.bell-btn.ring .ic { animation: ring 0.9s var(--ease); transform-origin: 50% 10%; }
@keyframes ring { 0% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } 100% { transform: rotate(0); } }

.main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 120px; outline: none; }
.page-in { animation: pageIn 0.5s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head-center { justify-content: center; }
.page-title { font-size: clamp(28px, 4vw, 36px); font-weight: 400; letter-spacing: -0.01em; line-height: 1.15; margin-top: 4px; }
.head-actions { display: flex; align-items: center; gap: 10px; }

.tabbar { display: none; }
.demo-ribbon {
  position: fixed; left: 18px; bottom: 18px; z-index: 40;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); font-size: 12px; color: var(--muted); box-shadow: var(--shadow-sm);
}
.demo-ribbon .ic { width: 14px; height: 14px; color: var(--accent); }

.setup-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--gold-soft), var(--surface)); border: 1px solid rgba(184, 153, 90, 0.35);
}
:root[data-theme='dark'] .setup-banner { background: linear-gradient(135deg, rgba(214, 189, 140, 0.12), var(--surface)); }
.setup-banner > .ic { color: var(--accent); width: 24px; height: 24px; }
.setup-banner div { flex: 1; display: grid; }
.setup-banner span { color: var(--muted); font-size: 14px; }
.setup-banner[hidden] { display: none; }

/* ---------- Card host ---------- */

.card-host { position: relative; }
.card-host.swap { animation: swapIn 0.55s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }

/* ---------- Flip card ---------- */

.flip-stage { display: grid; justify-items: center; padding: 18px 0 8px; perspective: 1400px; }
.flip {
  --w: min(360px, calc(100vw - 48px));
  width: var(--w); aspect-ratio: 360 / 560; position: relative; cursor: grab; outline: none;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  /* Card colours (Pontiac Navy) */
  --c-top: #002957; --c-top-2: #00183a; --c-panel: #ffffff; --c-ink: #0b1b36; --c-sub: #5d6678;
  --c-accent: #c8b07a; --c-logo: #f2f2f2; --c-back: #002957; --c-back-ink: #eef1f6; --c-back-sub: #aab4c8;
}
.flip:active { cursor: grabbing; }
.flip[data-card-theme='onyx'] {
  --c-top: #1d1e21; --c-top-2: #0b0b0c; --c-panel: #18191b; --c-ink: #f3eee3; --c-sub: #a9a49a;
  --c-accent: #c9a96e; --c-logo: #c9a96e; --c-back: #121315; --c-back-ink: #f3eee3; --c-back-sub: #9d978c;
}
.flip[data-card-theme='ivory'] {
  --c-top: #ece4d2; --c-top-2: #dccfb3; --c-panel: #fbf8f2; --c-ink: #002957; --c-sub: #5f6470;
  --c-accent: #9c8150; --c-logo: #002957; --c-back: #f4eee2; --c-back-ink: #002957; --c-back-sub: #6b6a66;
}
.flip-inner {
  /* A slow, smooth turn. No will-change: it makes the browser keep a low-resolution copy of the card */
  position: absolute; inset: 0; transform-style: preserve-3d;
  transition: transform 1.3s cubic-bezier(0.45, 0.05, 0.2, 1);
}
.face { -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; }
.face {
  position: absolute; inset: 0; border-radius: 26px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 18px 40px -12px rgba(5, 18, 45, 0.35), 0 40px 80px -30px rgba(5, 18, 45, 0.35);
  transition: box-shadow 0.4s var(--ease);
}
.flip.is-lifted .face { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 30px 60px -12px rgba(5, 18, 45, 0.45), 0 70px 120px -30px rgba(5, 18, 45, 0.45); }
.flip.is-back .front, .flip:not(.is-back) .back { pointer-events: none; }
.face.back { transform: rotateY(180deg); }

.front { background: var(--c-panel); display: flex; flex-direction: column; }
.fc-top {
  position: relative; height: 56%; flex: none;
  background: radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, 0.10), transparent 55%), linear-gradient(160deg, var(--c-top), var(--c-top-2));
  color: var(--c-logo); display: grid; place-items: center; padding-bottom: 44px;
}
.fc-top::before {
  content: ''; position: absolute; inset: 0; opacity: 0.08;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, 0.6) 22px 23px);
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.fc-logo { width: 46%; position: relative; }
.fc-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 34%; }
.fc-wave .wave-fill { fill: var(--c-panel); }
.fc-wave .wave-line { stroke: var(--c-accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: 0.9; }
.fc-avatar { --s: 84px; position: absolute; left: 50%; top: 56%; transform: translate(-50%, -62%); box-shadow: 0 0 0 4px var(--c-panel), 0 0 0 5px var(--c-accent), 0 10px 24px rgba(0, 0, 0, 0.2); }
.fc-avatar.avatar-initials { font-size: 28px; }
.fc-body { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; padding: 34px 22px 6px; gap: 2px; }
.fc-name { color: var(--c-ink); font-size: 22px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.25; }
.fc-title { color: var(--c-sub); font-size: 15px; margin-top: 6px; }
.fc-dept { color: var(--c-sub); font-size: 14px; opacity: 0.85; }
.fc-foot {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 18px;
  color: var(--c-sub); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  border-top: 1px solid color-mix(in srgb, var(--c-sub) 18%, transparent); margin: 0 18px; padding-left: 4px; padding-right: 4px;
}
.fc-foot .ic { width: 16px; height: 16px; color: var(--c-accent); }

.back {
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.08), transparent 50%), var(--c-back);
  color: var(--c-back-ink); padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 14px;
}
.fb-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--c-back-ink) 14%, transparent); }
.fb-mark { width: 30px; height: 36px; color: var(--c-accent); }
.fb-name { font-size: 16px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.fb-sub { font-size: 13px; color: var(--c-back-sub); }
.fb-rows { display: grid; gap: 2px; }
.fb-rows a { display: flex; align-items: center; gap: 12px; padding: 7px 8px; margin: 0 -8px; border-radius: 10px; font-size: 14.5px; transition: background 0.2s; min-width: 0; }
.fb-rows a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-rows a:hover { background: color-mix(in srgb, var(--c-back-ink) 8%, transparent); }
.fb-rows .ic { width: 17px; height: 17px; color: var(--c-accent); }
.fb-rows { gap: 4px; flex: 1; align-content: center; }
.fb-address span { white-space: normal !important; line-height: 1.4; }
.fb-qr { margin-top: auto; width: 100%; padding: 16px 0 0; background: none; border-width: 1px 0 0; border-style: solid; font: inherit; color: inherit; text-align: left; cursor: zoom-in; display: flex; align-items: center; gap: 18px; border-top: 1px solid color-mix(in srgb, var(--c-back-ink) 12%, transparent); }
.fb-qr .qr-box { width: 128px; padding: 10px; border-radius: 16px; }
.fb-qr p { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-back-sub); line-height: 1.6; }

.glare {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, 0.28), transparent 45%);
  mix-blend-mode: soft-light;
}
.flip.is-lifted .glare { opacity: 1; }
.flip-hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }
.flip-hint .ic { width: 16px; height: 16px; color: var(--accent); }

/* QR boxes */
.qr-box { position: relative; display: block; background: #fff; border-radius: 18px; padding: 14px; aspect-ratio: 1; }
.qr-box > img { width: 100%; height: 100%; }
.qr-logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 22%; aspect-ratio: 1;
  background: #fff; border-radius: 50%; display: grid; place-items: center; color: #002957;
}
.qr-logo .logo-mark { width: 58%; height: auto; }

/* ---------- Classic view ---------- */

.classic { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
.cl-profile { background: var(--surface); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.cl-band {
  position: relative; background: linear-gradient(160deg, #002957, #00183a); color: #f2f2f2;
  display: grid; place-items: center; padding: 26px 0 24px;
}
.cl-band .sample-tag { position: absolute; top: 14px; right: 14px; }
.cl-logo { width: 96px; }
.cl-id { background: var(--surface-2); text-align: center; padding: 30px 24px 26px; display: grid; justify-items: center; gap: 2px; }
.cl-avatar { --s: 92px; margin-bottom: 14px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--gold-2); }
.cl-name { font-size: 25px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy-ink); line-height: 1.25; }
:root[data-theme='dark'] .cl-name { color: var(--ink); }
.cl-title, .cl-dept { font-size: 14.5px; color: var(--navy-ink); }
:root[data-theme='dark'] .cl-title, :root[data-theme='dark'] .cl-dept { color: var(--ink-2); }
.cl-title { margin-top: 10px; }
.cl-quick { display: flex; gap: 10px; margin-top: 20px; }
.quick {
  display: grid; justify-items: center; gap: 4px; width: 72px; padding: 10px 0 8px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.quick .ic { color: var(--navy); width: 20px; height: 20px; }
:root[data-theme='dark'] .quick .ic { color: var(--gold-2); }
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(184, 153, 90, 0.5); }
.cl-details { padding: 26px 30px 6px; display: grid; gap: 22px; }
.cl-group { display: grid; gap: 4px; }
.cl-label { font-size: 13px; color: var(--muted); }
.cl-phone { display: grid; grid-template-columns: 64px 1fr; align-items: baseline; }
.cl-details a, .cl-val { color: var(--navy-ink); font-size: 15.5px; }
:root[data-theme='dark'] .cl-details a, :root[data-theme='dark'] .cl-val { color: var(--ink); }
.cl-details a:hover { color: var(--accent); }
/* The LinkedIn button is a link, so the navy link colour above hid its icon on the navy circle in light mode */
.cl-details a.round-btn, .cl-details a.round-btn:hover { color: #fff; }
:root[data-theme='dark'] .cl-details a.round-btn, :root[data-theme='dark'] .cl-details a.round-btn:hover { color: var(--gold-2); }
.cl-addr { line-height: 1.65; }
.cl-map { display: inline-flex; align-items: center; gap: 6px; font-size: 13px !important; margin-top: 4px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.cl-map .ic { width: 15px; height: 15px; }
.cl-social { display: flex; gap: 12px; padding: 4px 0 20px; }
  height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 12px; min-width: 0;
}
.shake { animation: shake 0.4s; border-color: var(--danger) !important; }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }

.cl-portfolio {
  background: radial-gradient(100% 60% at 100% 0%, rgba(255, 255, 255, 0.06), transparent 60%), linear-gradient(170deg, #002957, #00163a);
  color: #fff; border-radius: var(--r-xl); padding: 34px 34px 30px; box-shadow: var(--shadow);
}
.cl-portfolio h2 { font-size: 22px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 22px; }
.pf-list { display: grid; gap: 14px; }
.pf-item { display: flex; align-items: center; gap: 22px; padding: 8px; margin: 0 -8px; border-radius: 18px; transition: background 0.3s; }
.pf-item:hover { background: rgba(255, 255, 255, 0.06); }
.pf-img { width: 140px; aspect-ratio: 140 / 108; border-radius: 12px; overflow: hidden; flex: none; }
.pf-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.pf-item:hover .pf-img img { transform: scale(1.06); }
.pf-name { font-size: 18px; flex: 1; }
.pf-arrow { opacity: 0; transform: translateX(-6px); transition: all 0.3s var(--ease); color: var(--gold-2); }
.pf-item:hover .pf-arrow { opacity: 1; transform: none; }

/* ---------- Share zone (QR + scanner) ---------- */

.share-zone { display: grid; grid-template-columns: minmax(0, 520px); justify-content: center; gap: 18px; margin-top: 34px; }
.tile {
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 22px; display: flex; gap: 22px; align-items: center; text-align: left; position: relative; overflow: hidden;
}
.tile h2, .tile-h { display: block; font-size: 21px; font-weight: 400; margin: 2px 0 6px; color: var(--ink); }
.tile .muted { font-size: 14px; display: block; }
.tile-body { display: block; flex: 1; min-width: 0; }
.tile-qr-code { width: 150px; flex: none; cursor: zoom-in; border-radius: 20px; box-shadow: 0 0 0 1px var(--line), var(--shadow); transition: transform 0.3s var(--ease); }
.tile-qr-code:hover { transform: scale(1.03); }
.tile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tile-scan {
  cursor: pointer; border: 0; color: #fff; font: inherit;
  background: radial-gradient(120% 120% at 100% 0%, rgba(214, 189, 140, 0.25), transparent 50%), linear-gradient(150deg, #0a3a73, #002957 50%, #00183a);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.tile-scan:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile-scan .eyebrow { color: var(--gold-2); }
.tile-scan .tile-h { color: #fff; }
.tile-scan .muted { color: rgba(255, 255, 255, 0.72); }
.tile-go { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); transition: transform 0.3s var(--ease), background 0.3s; }
.tile-scan:hover .tile-go { transform: translateX(3px); background: rgba(255, 255, 255, 0.2); }
.scan-art { position: relative; width: 96px; height: 96px; flex: none; display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.scan-art > .ic { width: 46px; height: 46px; }
.scan-art i { position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold-2); }
.scan-art i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.scan-art i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.scan-art i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.scan-art i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scan-beam { position: absolute; left: 10px; right: 10px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); animation: beam 2.4s var(--ease) infinite; top: 12px; box-shadow: 0 0 12px var(--gold-2); }
@keyframes beam { 0%, 100% { top: 12px; opacity: 0.2; } 50% { top: 82px; opacity: 1; } }

.actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.action {
  display: grid; justify-items: center; gap: 8px; padding: 18px 8px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: 14px; color: var(--ink-2);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s; position: relative;
}
.action .ic { width: 22px; height: 22px; color: var(--accent); }
.action:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(184, 153, 90, 0.4); }
.action.is-busy > * { opacity: 0.3; }

/* ---------- Public page ---------- */

.topbar-public { justify-content: space-between; }
.main-public { padding-top: 22px; }
.own-note { margin-bottom: 18px; }
.save-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 30px auto 0; max-width: 760px; }
.exchange {
  display: flex; align-items: center; gap: 18px; max-width: 760px; margin: 30px auto 0; padding: 22px 24px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.exchange-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--gold-soft); color: #8a6a2f; flex: none; }
:root[data-theme='dark'] .exchange-ic { background: rgba(214, 189, 140, 0.12); color: var(--gold-2); }
.exchange-body { flex: 1; }
.exchange h2 { font-size: 18px; font-weight: 500; }
.exchange p { color: var(--muted); font-size: 14px; }
.public-foot { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; color: var(--muted); font-size: 12.5px; letter-spacing: 0.04em; }
.public-foot .ic { width: 14px; height: 14px; }

/* ---------- Contacts ---------- */

.ct-tools { display: grid; gap: 14px; margin-bottom: 18px; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.search .ic { color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; outline: none; height: 100%; min-width: 0; }
.search:focus-within { box-shadow: var(--focus); }
.ct-items { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.ct-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid var(--line); }
.ct-item:last-child { border-bottom: 0; }
.ct-item:hover { background: var(--surface-2); }
.ct-main { flex: 1; min-width: 0; }
.ct-name { font-weight: 500; display: flex; align-items: center; }
.ct-sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-side { display: flex; align-items: center; gap: 8px; }
.ct-chev { color: var(--muted); width: 18px; height: 18px; }
.g-ok { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(31, 122, 77, 0.1); color: var(--success); }
.g-ok .ic { width: 14px; height: 14px; }
.skeleton-list { display: grid; gap: 10px; }
.skeleton-list i { display: block; height: 70px; border-radius: 16px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 20px; display: grid; justify-items: center; gap: 10px; }
.empty h1, .empty h2 { font-size: 22px; font-weight: 400; }
.empty p { color: var(--muted); max-width: 380px; }
.empty .btn { margin-top: 10px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.empty-art { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--accent); margin-bottom: 8px; }
.empty-art .ic { width: 32px; height: 32px; }
.empty-sm { padding: 24px 8px; }
.empty-page { min-height: 70vh; align-content: center; }

/* Contact detail */
.cd-head { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 6px 0 18px; }
.cd-head .avatar { margin-bottom: 8px; }
.cd-name { font-size: 22px; font-weight: 500; }
.cd-sub { color: var(--ink-2); }
.cd-co { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.cd-rows { border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.cd-rows a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background 0.2s; }
.cd-rows li:last-child a { border-bottom: 0; }
.cd-rows a:hover { background: var(--surface-3); }
.cd-rows .ic { color: var(--accent); }
.cd-rows span { display: grid; min-width: 0; overflow-wrap: anywhere; }
.cd-rows small { color: var(--muted); font-size: 12px; }
.cd-note { margin-top: 14px; padding: 12px 16px; border-radius: var(--r); background: var(--surface-2); }
.cd-note small { color: var(--muted); font-size: 12px; }
.cd-note p { white-space: pre-wrap; }
.cd-gnote { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cd-gnote .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; }

.notice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 14px; }
.notice > .ic { flex: none; }
.notice div { flex: 1; display: grid; }
.notice div span { color: var(--muted); font-size: 13px; }
.notice-gold { background: var(--gold-soft); border: 1px solid rgba(184, 153, 90, 0.35); }
.notice-gold > .ic { color: #8a6a2f; }
:root[data-theme='dark'] .notice-gold { background: rgba(214, 189, 140, 0.1); }
:root[data-theme='dark'] .notice-gold > .ic { color: var(--gold-2); }
.notice-soft { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.notice-soft > .ic { color: var(--accent); }
.notice-soft span { flex: 1; }

/* ---------- Sheets ---------- */

.sheet-root { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 12, 24, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s var(--ease); }
.sheet {
  /* The frame never scrolls (keeps all four corners round); only .sheet-body does */
  position: relative; width: 100%; max-height: min(88vh, 860px); overflow: hidden;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  display: flex; flex-direction: column; outline: none;
  opacity: 0; transform: translateY(16px) scale(0.98); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.sheet-sm { max-width: 440px; }
.sheet-md { max-width: 560px; }
.sheet-lg { max-width: 760px; }
.sheet-root.in .sheet-backdrop { opacity: 1; }
.sheet-root.in .sheet { opacity: 1; transform: none; }
.sheet-root.out .sheet { opacity: 0; transform: translateY(16px) scale(0.98); }
.sheet-grip { display: none; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 24px; background: var(--surface); z-index: 2; }
.sheet-head h2 { font-size: 19px; font-weight: 500; }
.sheet-x { position: absolute; top: 12px; right: 12px; z-index: 3; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 10px 24px 22px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.sheet-body::-webkit-scrollbar { width: 12px; }
.sheet-body::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 4px solid transparent; background-clip: padding-box; }
.sheet-body::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
.sheet-foot { flex: none; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot[hidden] { display: none; }

.confirm-msg { color: var(--ink-2); }
.confirm-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; color: var(--muted); font-size: 14px; }
.confirm-note .ic { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.diff { border-radius: var(--r); background: var(--surface-2); overflow: hidden; }
.diff li { display: grid; gap: 2px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.diff li:last-child { border-bottom: 0; }
.diff-k { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.diff-v { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.diff-v s { color: var(--muted); }
.diff-v .ic { width: 14px; height: 14px; color: var(--accent); }
.diff-v b { font-weight: 500; }

/* Bell sheet: drops down from the top right on computers */
.nt-list { display: grid; gap: 4px; margin: 0 -10px; }
.nt { display: flex; gap: 12px; padding: 12px 10px; border-radius: 14px; align-items: flex-start; position: relative; }
.nt.is-new { background: var(--surface-2); }
.nt.is-new::before { content: ''; position: absolute; left: -2px; top: 22px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.nt-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); }
.nt-ic .ic { width: 18px; height: 18px; }
.nt-main { flex: 1; min-width: 0; }
.nt-text { font-size: 14.5px; }
.nt-text b { font-weight: 500; }
.nt-sub { font-size: 13px; color: var(--muted); }
.nt-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nt-act { flex: none; align-self: center; }

/* Scan result */
.sr-loading { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.sr-person { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 4px 0 16px; }
.sr-person .avatar { margin-bottom: 10px; }
.sr-person h3 { font-size: 21px; font-weight: 500; }
.sr-sub { color: var(--ink-2); font-size: 15px; }
.sr-co { color: var(--muted); font-size: 14px; display: flex; align-items: center; margin-bottom: 6px; }
.sr-rows { display: grid; gap: 2px; background: var(--surface-2); border-radius: var(--r); padding: 8px 4px; }
.sr-rows li { display: flex; align-items: center; gap: 12px; padding: 7px 12px; font-size: 14.5px; overflow-wrap: anywhere; }
.sr-rows .ic { color: var(--accent); width: 18px; height: 18px; }
.sr-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.sr-note .ic { width: 16px; height: 16px; }
.sr-cant { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 10px 0 6px; }
.sr-cant h3 { font-size: 19px; font-weight: 500; }
.sr-cant p { color: var(--muted); }
.sr-cant-ic { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); margin-bottom: 6px; }
.sr-cant-ic .ic { width: 26px; height: 26px; }
.sr-link { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; max-width: 100%; }
.sr-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-link .ic { width: 14px; height: 14px; }

/* QR full screen */
.qr-big { display: grid; justify-items: center; gap: 16px; padding: 18px 0 4px; }
.qr-person { display: flex; align-items: center; gap: 10px; }
.qr-person div { display: grid; line-height: 1.3; }
.qr-person span { color: var(--muted); font-size: 13px; }
.qr-xl { width: min(300px, 72vw); padding: 20px; border-radius: 26px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.qr-cap { color: var(--muted); font-size: 14px; }

/* Forms */
.field { display: grid; gap: 6px; position: relative; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.field input, .field textarea, .field select {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
.field-help { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.field-help .ic { width: 14px; height: 14px; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field.from-dir input { border-color: rgba(184, 153, 90, 0.6); background: color-mix(in srgb, var(--gold-soft) 45%, var(--surface)); }
:root[data-theme='dark'] .field.from-dir input { background: rgba(214, 189, 140, 0.07); }
.field-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--accent); }
.field-tag .ic { width: 12px; height: 12px; }
.field.flash input { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(184, 153, 90, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(184, 153, 90, 0); } }
.field-locked .locked { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); border: 1px dashed var(--line-2); overflow: hidden; }
.field-locked .locked span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-locked .ic { width: 16px; height: 16px; color: var(--muted); }

.ed { display: grid; gap: 22px; }
.ed-intro { color: var(--ink-2); }
.ed-photo { display: flex; align-items: center; gap: 18px; }
.ed-photo-opts { display: grid; gap: 8px; }
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ed-grid .field[data-field='name'], .ed-grid .field[data-field='linkedin'], .ed-grid .field-locked { grid-column: 1 / -1; }
.ed-shared { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.ed-shared .ic { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.ed-themes { display: grid; gap: 10px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt { display: grid; gap: 8px; justify-items: center; padding: 10px 8px 12px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 13px; color: var(--ink-2); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease); }
.theme-opt:hover { transform: translateY(-2px); }
.theme-opt[aria-checked='true'] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 153, 90, 0.25); color: var(--ink); }
.theme-swatch { width: 54px; height: 80px; border-radius: 9px; overflow: hidden; display: grid; grid-template-rows: 55% 45%; box-shadow: var(--shadow-sm);
  --c-top: #002957; --c-panel: #fff; --c-logo: #f2f2f2; }
.theme-swatch[data-card-theme='onyx'] { --c-top: #1d1e21; --c-panel: #18191b; --c-logo: #c9a96e; }
.theme-swatch[data-card-theme='ivory'] { --c-top: #ece4d2; --c-panel: #fbf8f2; --c-logo: #002957; }
.sw-top { background: var(--c-top); color: var(--c-logo); display: grid; place-items: center; }
.sw-top .logo-mark { width: 14px; height: 17px; }
.sw-bottom { background: var(--c-panel); }
.ed-dir { margin-top: -4px; }
.ed-grid .ed-locked-note { grid-column: 1 / -1; margin: 0; }

/* Settings: two columns on computers so it fits without scrolling */
.st { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
.st-col { display: grid; gap: 26px; align-content: start; min-width: 0; }
.st-sec, .switch-row, .link-box, .acct { min-width: 0; }
.switch-row span { min-width: 0; }
@media (max-width: 760px) { .st-col:last-child { order: -1; } } /* phones: Google Contacts first */
@media (min-width: 761px) {
  .settings-sheet .sheet { max-width: 820px; }
  .st { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
}
.st-sec { display: grid; gap: 12px; }
.st-sec h3 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.switch-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); cursor: pointer; }
.switch-row span { display: grid; gap: 2px; }
.switch-row b { font-weight: 500; font-size: 15px; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch-row small b { font-size: inherit; font-weight: 600; color: var(--ink-2); }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background 0.25s; margin: 2px 0 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 0.3s var(--ease); }
.switch:checked { background: linear-gradient(135deg, #cdb07a, #a8864a); }
.switch:checked::after { transform: translateX(18px); }
.link-box { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.link-box > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.link-box > .ic { color: var(--accent); width: 18px; height: 18px; }
.acct { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-2); }
.reset-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.select-pill.select-sm { position: relative; height: 40px; padding: 0 36px 0 14px; border-radius: 12px; box-shadow: none; border-color: var(--line-2); }
.select-pill.select-sm select { appearance: none; -webkit-appearance: none; font-weight: 500; padding-right: 4px; }
.select-pill.select-sm .ic { position: absolute; right: 12px; width: 16px; height: 16px; pointer-events: none; color: var(--muted); }
.reset-next { color: var(--muted); }
.reset-next .ic { color: var(--accent); }
.qr-expiry { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.qr-expiry .ic { width: 14px; height: 14px; color: var(--accent); }

/* Welcome */
.welcome .sheet-body { text-align: center; padding-top: 34px; display: grid; justify-items: center; gap: 6px; }
.welcome-art { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; color: var(--gold-2); background: linear-gradient(150deg, #0a3a73, #002957); box-shadow: 0 14px 30px rgba(0, 41, 87, 0.3); margin-bottom: 12px; }
.welcome-art .logo-mark { width: 32px; height: 38px; }
.welcome-title { font-size: 26px; font-weight: 400; }
.welcome-text { color: var(--muted); }
.welcome .sheet-foot { flex-direction: column; border-top: 0; padding-top: 4px; }

.done { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 18px 0; }
.done-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #cdb07a, #a8864a); color: #fff; animation: pop 0.5s var(--ease); }
.done-ic .ic { width: 30px; height: 30px; stroke-width: 2.2; }
.done h3 { font-size: 20px; font-weight: 500; }
.done p { color: var(--muted); }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }

.ex-form { display: grid; gap: 14px; }

/* ---------- Toasts ---------- */

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 400; display: grid; gap: 8px; width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-radius: 16px;
  background: #0f1a2e; color: #f2f4f8; box-shadow: var(--shadow-lg); font-size: 14.5px; pointer-events: auto;
  opacity: 0; transform: translateY(12px) scale(0.98); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
:root[data-theme='dark'] .toast { background: #1e2a40; border: 1px solid var(--line-2); }
.toast.in { opacity: 1; transform: none; }
.toast > .ic { color: var(--gold-2); }
.toast-success > .ic { color: #7fd6a8; }
.toast-error > .ic { color: #ff9b91; }
.toast span { flex: 1; }
.toast-act { border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer; font-weight: 500; }

/* ---------- Scanner ---------- */

.scanner { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; opacity: 0; transition: opacity 0.25s; overflow: hidden; }
.scanner.in { opacity: 1; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.scan-video.mirror { transform: scaleX(-1); }
.scanner.live .scan-video { opacity: 1; }
.scan-shade {
  position: absolute; inset: 0; pointer-events: none;
  display: none; /* the frame itself darkens everything around it (square cut-out) */
}
.scan-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: max(16px, env(safe-area-inset-top)) 16px 16px; }
.scan-title { font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.scan-frame { position: absolute; left: 50%; top: 46%; width: min(70vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 24px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.55); }
.scan-frame i { position: absolute; width: 42px; height: 42px; border: 3px solid var(--gold-2); transition: all 0.3s var(--ease); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 22px 0 0 0; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 22px 0 0; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 22px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 22px 0; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 2px; top: 10%; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); box-shadow: 0 0 14px var(--gold-2); animation: scanline 2.2s var(--ease) infinite; }
@keyframes scanline { 0%, 100% { top: 10%; opacity: 0.3; } 50% { top: 88%; opacity: 1; } }
.scanner.found .scan-frame i { border-color: #7fd6a8; width: 50%; height: 50%; }
.scanner.found .scan-line { display: none; }
.scan-hint { position: absolute; left: 0; right: 0; top: calc(46% + min(35vw, 150px) + 28px); text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 15px; padding: 0 24px; }
.scan-msg { position: absolute; left: 50%; top: calc(46% + min(35vw, 150px) + 20px); transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(20, 24, 34, 0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 14.5px; line-height: 1.45; }
.scan-msg .ic { color: var(--gold-2); margin-top: 1px; }
.scan-msg[hidden] { display: none; }
.scan-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 18px 16px max(26px, env(safe-area-inset-bottom)); }

/* ---------- Sign in: split screen (same design as CardSync's sign-in) ---------- */

.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--bg); }
.signin-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 56px 56px; color: #f4efe4;
  background:
    radial-gradient(700px 480px at 85% 0%, rgba(214, 189, 140, 0.22), transparent 62%),
    radial-gradient(600px 420px at 0% 100%, rgba(214, 189, 140, 0.10), transparent 60%),
    linear-gradient(160deg, #003066 0%, #002957 45%, #00132e 100%);
}
.signin-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.signin-lines path { fill: none; stroke-width: 1.2; stroke: rgba(214, 189, 140, 0.32); }
.signin-lines path:nth-child(2) { stroke: rgba(214, 189, 140, 0.18); }
.signin-lines path:nth-child(3) { stroke: rgba(255, 255, 255, 0.08); }
.signin-watermark { position: absolute; right: -60px; top: 50%; transform: translateY(-58%); width: 420px; color: rgba(214, 189, 140, 0.07); pointer-events: none; }
.signin-watermark .logo-mark { width: 100%; height: auto; }
.signin-brand-top { position: relative; display: flex; align-items: center; gap: 14px; }
.signin-mark {
  width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; color: var(--gold-2);
  background: linear-gradient(150deg, rgba(214, 189, 140, 0.18), rgba(214, 189, 140, 0.05)); border: 1px solid rgba(214, 189, 140, 0.38);
}
.signin-mark .logo-mark { width: 20px; height: 24px; }
.signin-word { font-size: 13px; letter-spacing: 0.34em; font-weight: 500; }
.signin-brand-copy { position: relative; max-width: 460px; }
.signin-eyebrow { margin: 0 0 14px; font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500; color: var(--gold-2); }
.signin-headline { margin: 0 0 30px; font-size: clamp(34px, 3.6vw, 52px); font-weight: 300; line-height: 1.12; color: #fff; }
.signin-points { display: grid; gap: 14px; }
.signin-points li { display: flex; align-items: center; gap: 14px; font-size: 15.5px; color: rgba(244, 239, 228, 0.82); }
.signin-points .ic { width: 20px; height: 20px; color: var(--gold-2); }

.signin-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 32px 72px; }
.signin-top { position: absolute; top: 16px; right: 16px; }
.signin-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; animation: pageIn 0.7s var(--ease); }
.signin-mark-sm { width: 52px; height: 52px; margin-bottom: 22px; background: linear-gradient(150deg, #0a3a73, #002957); border-color: transparent; box-shadow: 0 10px 24px rgba(0, 41, 87, 0.28); }
.signin-title { font-size: 38px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.15; color: var(--ink); }
.signin-text { margin: 6px 0 30px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.signin .gsi-slot { min-height: 44px; width: 100%; max-width: none; display: grid; justify-items: start; align-items: center; }
/* "Continue with Google" (Google's dark button on light, light button on dark) */
.g-signin {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 360px; height: 50px;
  padding: 0 22px; border-radius: 999px; border: 1px solid #131314; background: #131314; color: #e3e3e3;
  font: 500 15.5px/1 var(--font); letter-spacing: 0.01em; cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s;
  box-shadow: 0 8px 22px rgba(13, 26, 51, 0.18);
}
.g-signin:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(13, 26, 51, 0.24); }
.g-signin:active { transform: none; }
.g-signin .ic { width: 20px; height: 20px; flex: none; }
.g-signin.is-busy > * { opacity: 0; }
.g-signin.is-busy::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
:root[data-theme='dark'] .g-signin { background: #fff; border-color: #fff; color: #1f1f1f; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.signin-perm { display: flex; gap: 10px; align-items: flex-start; max-width: 360px; margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.signin-perm .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.signin-perm b { font-weight: 600; color: var(--ink-2); }
.signin-note { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.signin-note .ic { width: 15px; height: 15px; }
.signin-error { color: var(--danger); font-size: 14px; margin-top: 4px; }
.signin-error[hidden] { display: none; }
.signin-foot { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); opacity: 0.8; }
.demo-block { width: 100%; margin-top: 30px; }
.demo-label { display: flex; align-items: center; gap: 12px; font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.demo-label::before, .demo-label::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.demo-list { display: grid; gap: 8px; }
.demo-acct {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.demo-acct:hover { border-color: rgba(184, 153, 90, 0.5); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.demo-acct.is-busy { opacity: 0.6; }
.demo-who { flex: 1; display: grid; line-height: 1.3; }
.demo-who b { font-weight: 500; }
.demo-who small { color: var(--muted); font-size: 12.5px; }
.demo-acct > .ic { width: 16px; height: 16px; color: var(--accent); }

@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .signin-brand { padding: 26px 24px 60px; min-height: 42vh; min-height: 42dvh; }
  .signin-watermark { width: 240px; right: -40px; transform: translateY(-50%); }
  .signin-brand-copy { margin-top: 34px; }
  .signin-eyebrow { margin-bottom: 10px; font-size: 11px; }
  .signin-headline { font-size: 30px; margin-bottom: 0; }
  .signin-points { display: none; }
  .signin-panel { justify-content: flex-start; padding: 34px 24px 80px; margin-top: -28px; border-radius: 28px 28px 0 0; background: var(--bg); box-shadow: 0 -12px 30px rgba(0, 19, 46, 0.18); z-index: 1; }
  .signin-top { top: 12px; right: 12px; }
  .signin-mark-sm { display: none; }
  .signin-title { font-size: 30px; }
  .signin-text { font-size: 15px; margin-bottom: 26px; }
  .signin-foot { font-size: 10.5px; letter-spacing: 0.1em; }
}

/* ---------- Phones and tablets ---------- */

@media (max-width: 960px) {
  .classic { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .share-zone { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --top-h: 60px; }
  .topbar { padding: 0 12px 0 16px; gap: 8px; }
  .tabs { display: none; }
  .logo-word { font-size: 12px; letter-spacing: 0.28em; }
  .main { padding: 20px 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
  .main-public { padding-bottom: 60px; }
  .page-head { margin-bottom: 16px; align-items: center; }
  .page-head .page-title { font-size: 28px; }
  .hide-sm { display: none !important; }

  .tabbar {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 60;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 64px; padding: 0 10px; border-radius: 24px;
    background: var(--glass); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
    border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 6px 0; transition: color 0.2s; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a[aria-current='page'] { color: var(--ink); }
  .tabbar a[aria-current='page'] .ic { color: var(--accent); }
  .tabbar-scan {
    width: 60px; height: 60px; margin-top: -26px; border-radius: 22px; border: 0; cursor: pointer; display: grid; place-items: center;
    background: linear-gradient(145deg, #0a3a73, #002957); color: var(--gold-2);
    box-shadow: 0 10px 24px rgba(0, 41, 87, 0.4), 0 0 0 4px var(--bg); transition: transform 0.25s var(--ease);
  }
  .tabbar-scan:active { transform: scale(0.94); }
  .tabbar-scan .ic { width: 26px; height: 26px; }
  .demo-ribbon { bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); }

  .sheet-root { place-items: end stretch; padding: 0; }
  .sheet { max-width: none !important; border-radius: 26px 26px 0 0; max-height: 92vh; max-height: 92dvh; transform: translateY(100%); opacity: 1; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .sheet-root.out .sheet { transform: translateY(100%); opacity: 1; }
  .sheet-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; flex: none; touch-action: none; }
  .sheet-head { padding: 8px 12px 4px 20px; }
  .sheet-body { padding: 8px 20px 20px; }
  .sheet-foot { padding: 12px 16px 16px; }
  .sheet-foot .btn { flex: 1; }
  .sheet-x { top: 14px; }

  .share-zone { gap: 12px; margin-top: 26px; }
  .tile { padding: 16px; gap: 16px; }
  .tile-qr-code { width: 118px; }
  .tile h2, .tile-h { font-size: 19px; }
  .scan-art { width: 72px; height: 72px; }
  .scan-art > .ic { width: 34px; height: 34px; }
  @keyframes beam { 0%, 100% { top: 10px; opacity: 0.2; } 50% { top: 60px; opacity: 1; } }
  .actions-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } /* 2 x 2 on phones, Edit included */
  .action { padding: 14px 6px; font-size: 13px; }

  .cl-details { padding: 22px 22px 4px; }
  .cl-portfolio { padding: 26px 20px 20px; }
  .pf-img { width: 104px; }
  .pf-name { font-size: 16px; }
  .pf-arrow { display: none; }

  .ed-grid { grid-template-columns: 1fr; }
  .field-2 { grid-template-columns: 1fr; }
  .exchange { flex-direction: column; text-align: center; }
  .exchange .btn { width: 100%; }
  .save-bar .btn { flex: 1 1 100%; }
  .toasts { bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom)); }
  .main-public ~ .toasts, body:not(:has(.tabbar)) .toasts { bottom: 24px; }
}

@media (min-width: 721px) {
  .bell-sheet { place-items: start end; padding: calc(var(--top-h) + 8px) 20px 20px; }
  .bell-sheet .sheet { max-width: 400px; transform-origin: top right; }
  .bell-sheet .sheet-backdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bell-sheet.in .sheet { animation: none; }
}

/* ---------- App switcher (side menu) ---------- */

.menu-btn { margin-left: -8px; }
.sheet-root.drawer { place-items: stretch start; padding: 0; }
.sheet-root.drawer .sheet {
  width: min(340px, 86vw); max-width: none !important; height: 100%; max-height: none; border-radius: 0 28px 28px 0;
  border: 0; border-right: 1px solid var(--line); opacity: 1; transform: translateX(-100%); padding-bottom: env(safe-area-inset-bottom);
}
.sheet-root.drawer.in .sheet { transform: none; }
.sheet-root.drawer.out .sheet { transform: translateX(-100%); opacity: 1; }
.sheet-root.drawer .sheet-grip { display: none; }
.sheet-root.drawer .sheet-body { padding: 24px 18px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.dr-head { display: flex; align-items: center; gap: 14px; padding: 4px 6px 18px; border-bottom: 1px solid var(--line); }
.dr-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(150deg, #0a3a73, #002957); color: var(--gold-2); }
.dr-mark .logo-mark { width: 20px; height: 24px; }
.dr-org { font-size: 13px; letter-spacing: 0.28em; font-weight: 500; }
.dr-sub { font-size: 13px; color: var(--muted); }
.dr-apps { display: grid; gap: 8px; }
.dr-app { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.dr-app:hover { background: var(--surface-2); transform: translateX(2px); }
.dr-app.is-current { background: var(--surface-2); border-color: rgba(184, 153, 90, 0.4); }
.dr-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.dr-app.is-current .dr-ic { background: linear-gradient(150deg, #0a3a73, #002957); color: var(--gold-2); }
.dr-txt { flex: 1; display: grid; line-height: 1.3; }
.dr-txt b { font-weight: 500; }
.dr-txt small { color: var(--muted); font-size: 13px; }
.dr-on { color: var(--accent); }
.dr-go { color: var(--muted); width: 18px; height: 18px; }
.dr-user { margin-top: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 0 6px; }
.dr-user .ic { width: 16px; height: 16px; }

/* ---------- Combined contact list ---------- */

.page-count { font-size: 14px; margin-top: 4px; }
.ct-tools-2 { grid-template-columns: 1fr auto; align-items: center; }
.select-pill { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--muted); }
.select-pill select { border: 0; background: transparent; height: 100%; color: var(--ink); font-size: 14.5px; cursor: pointer; outline: none; }
.select-pill:focus-within { box-shadow: var(--focus); }
.select-pill .ic { width: 18px; height: 18px; }
.ct-filters { margin-bottom: 18px; }
.gsync { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; margin: -4px 0 16px; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.gsync[hidden] { display: none; }
.gsync > span:not(.spinner) { flex: 1; }
.gsync b { font-weight: 500; color: var(--ink); }
.gsync .ic { width: 20px; height: 20px; flex: none; }
.gsync.is-todo { background: var(--gold-soft); border-color: rgba(184, 153, 90, 0.4); }
:root[data-theme='dark'] .gsync.is-todo { background: rgba(214, 189, 140, 0.1); }
.gsync.is-done { background: transparent; border-color: transparent; padding: 0 4px; margin-top: -8px; color: var(--muted); font-size: 13px; }
.gsync.is-done .ic { width: 16px; height: 16px; color: var(--success); }
.gsync.is-running .spinner { width: 18px; height: 18px; }
@media (max-width: 720px) { .gsync.is-todo { flex-wrap: wrap; } .gsync.is-todo .btn { width: 100%; } }
/* Phones, My card: the Card / Classic / Edit card controls sit under the card and its "Drag or tap to flip" hint, centred,
   34% smaller than on desktop and tighter (they used to float over the page and hid the hint) */
@media (max-width: 720px) {
  .page:has(> .home-head) { display: flex; flex-direction: column; }
  .page:has(> .home-head) > .card-host { order: 1; }
  .page:has(> .home-head) > .home-head { order: 2; margin: 4px 0 0; padding: 0; justify-content: center; }
  .page:has(> .home-head) > .share-zone { order: 3; }
  .home-head .head-actions { gap: 6px; zoom: 0.66; }
  .home-head .seg { padding: 2px; }
  .home-head .seg button { height: 30px; padding: 0 11px; gap: 5px; }
  .home-head .btn { height: 34px; padding: 0 13px; gap: 5px; }
}
/* Phones have the Scan button in the bottom bar, so the Contacts page doesn't repeat it (desktop keeps both) */
@media (max-width: 720px) { .page-head [data-scan], .empty-actions [data-scan2] { display: none; } }
.ct-group { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 14px; }
.ct-group .ct-items { border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
/* Company header: a slim tinted band, so it reads as a section title rather than another contact */
.ct-ghead {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 16px 10px 14px;
  border: 0; background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  position: relative; transition: background 0.2s;
}
.ct-ghead::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #cdb07a, #a8864a); }
.ct-ghead:hover { background: var(--surface-3); }
.ct-gmark {
  width: 32px; height: 32px; flex: none; border-radius: 9px; position: relative; overflow: hidden;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); color: var(--accent);
}
.ct-gmono { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--accent); }
.ct-glogo { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; opacity: 0; transition: opacity 0.3s; }
.ct-gmark.is-loaded { background: #fff; }
.ct-gmark.is-loaded .ct-glogo { opacity: 1; }
.ct-gmark.is-loaded .ct-gmono { opacity: 0; }
.ct-gmark.is-pontiac { background: linear-gradient(150deg, #0a3a73, #002957); border-color: transparent; color: var(--gold-2); }
.ct-gmark.is-pontiac .logo-mark { width: 13px; height: 16px; }
.ct-gmark.is-none .ic { width: 16px; height: 16px; color: var(--muted); }
.ct-gname { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-gcount { flex: none; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ct-gchev { color: var(--muted); transition: transform 0.25s var(--ease); width: 18px; height: 18px; }
.ct-ghead[aria-expanded='false'] .ct-gchev { transform: rotate(-90deg); }
.ct-group .ct-items { border-top: 1px solid var(--line); }
.ct-meta { display: grid; justify-items: end; font-size: 13.5px; color: var(--muted); line-height: 1.45; max-width: 260px; min-width: 0; }
.ct-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ct-more { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; font-size: 13.5px; text-align: center; }
.ct-more .ic { width: 16px; height: 16px; flex: none; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cd-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cd-card { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 1.586; }
.cd-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.cd-card:hover img { transform: scale(1.03); }
@media (max-width: 720px) {
  .ct-tools-2 { grid-template-columns: 1fr; }
  .ct-item { padding: 12px 14px; }
  .ct-ghead { padding: 9px 12px 9px 12px; min-height: 48px; }
}

/* ---------- Installable app (PWA) ---------- */

/* Installed on a phone: the top bar reaches under the status bar (navy strip on iPhone), no pull-to-refresh bounce */
html.standalone body { overscroll-behavior-y: none; }
html.standalone .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
html.standalone.ios .topbar { background: linear-gradient(#002957 0 env(safe-area-inset-top), var(--glass) env(safe-area-inset-top)); }
html.standalone .signin-brand { padding-top: calc(26px + env(safe-area-inset-top)); }
html.standalone .signin-top { top: calc(12px + env(safe-area-inset-top)); }
html.standalone { -webkit-tap-highlight-color: transparent; }
html.standalone button, html.standalone .tabbar, html.standalone .tabs { -webkit-user-select: none; user-select: none; }

.install-banner {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; margin-bottom: 18px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.install-banner[hidden] { display: none; }
.ib-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.ib-text { flex: 1; display: grid; line-height: 1.35; min-width: 0; }
.ib-text b { font-weight: 500; }
.ib-text span { font-size: 13px; color: var(--muted); }
.ib-x { width: 34px; height: 34px; flex: none; }

.ig { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 14px 0 4px; }
.ig-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 6px; }
.ig-title { font-size: 21px; font-weight: 500; }
.ig-text { color: var(--muted); font-size: 15px; }
.ig-steps { list-style: none; padding: 14px 16px; margin: 10px 0 0; display: grid; gap: 14px; text-align: left; border-radius: 16px; background: var(--surface-2); width: 100%; }
.ig-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.ig-n { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--navy); color: #fff; }
:root[data-theme='dark'] .ig-n { background: var(--gold-2); color: #0b1424; }
.ig-chip { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-2); vertical-align: middle; color: #0a84ff; }
.ig-chip .ic { width: 16px; height: 16px; }

.offline-pill {
  position: fixed; right: 12px; top: calc(var(--top-h) + 8px + env(safe-area-inset-top)); transform: translateY(-12px); z-index: 80;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  background: #0f1a2e; color: #f2f4f8; box-shadow: var(--shadow-sm); opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s var(--ease);
}
html:not(.standalone) .offline-pill { top: calc(var(--top-h) + 8px); }
.offline-pill .ic { width: 13px; height: 13px; color: var(--gold-2); }
body.is-offline .offline-pill { opacity: 1; transform: none; }

/* ---------- Guided tour (? button) ---------- */

.tour { position: fixed; inset: 0; z-index: 500; opacity: 0; transition: opacity 0.25s; }
.tour.in { opacity: 1; }
.tour-block { position: absolute; inset: 0; } /* stops clicks on the page while touring */
.tour-spot {
  position: fixed; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(6, 12, 24, 0.62), 0 0 0 2px var(--gold-2), 0 0 24px 4px rgba(214, 189, 140, 0.35);
  transition: left 0.4s var(--ease), top 0.4s var(--ease), width 0.4s var(--ease), height 0.4s var(--ease), opacity 0.25s;
}
.tour-spot.is-off { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 200vmax rgba(6, 12, 24, 0.62); }
.tour-tip {
  position: fixed; width: min(360px, calc(100vw - 24px)); padding: 20px 20px 16px; border-radius: 20px; outline: none;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  transition: left 0.4s var(--ease), top 0.4s var(--ease), opacity 0.2s;
}
.tour.moving .tour-tip { opacity: 0.4; }
.tour-tip.is-center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); padding: 28px 26px 20px; text-align: center; }
.tour-tip.is-center .tour-actions { justify-content: center; }
.tour-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; }
.tour-step { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.tour-title { font-size: 19px; font-weight: 500; margin: 4px 28px 6px 0; }
.tour-tip.is-center .tour-title { font-size: 23px; margin-right: 0; }
.tour-text { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 12px; flex-wrap: wrap; }
.tour-tip.is-center .tour-dots { justify-content: center; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: all 0.3s var(--ease); }
.tour-dots i.on { width: 18px; border-radius: 3px; background: var(--gold); }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; }
.tour-actions [hidden] { display: none; }
@media (max-width: 720px) {
  .tour-tip:not(.is-center) { left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .tour-tip.at-top:not(.is-center) { top: calc(12px + env(safe-area-inset-top)) !important; bottom: auto; }
}

/* ---------- Google Contacts import ---------- */

.gi { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 18px 4px 4px; }
.gi-art { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); margin-bottom: 6px; }
.gi-art .ic { width: 30px; height: 30px; }
.gi-art-ok { background: linear-gradient(135deg, #cdb07a, #a8864a); color: #fff; box-shadow: var(--shadow); }
.gi-art-ok .ic { stroke-width: 2.2; }
.gi-art-warn { color: var(--danger); }
.gi-title { font-size: 22px; font-weight: 500; }
.gi-text { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 360px; }
.gi-points { display: grid; gap: 10px; margin: 8px 0 2px; text-align: left; width: 100%; max-width: 340px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.gi-points li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.gi-points .ic { width: 18px; height: 18px; color: var(--accent); }
.gi-last { font-size: 13px; color: var(--muted); }
.gi-perm { font-size: 12.5px; color: var(--muted); }
.gi-busy { min-height: 200px; align-content: center; color: var(--ink-2); }
.gi-busy .spinner { width: 28px; height: 28px; }
.gi-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 340px; margin: 6px 0; }
.gi-stats div { display: grid; padding: 12px 6px; border-radius: 14px; background: var(--surface-2); }
.gi-stats b { font-size: 22px; font-weight: 500; }
.gi-stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- Business-card scanner (CardSync, in a full-screen frame) ---------- */

.hostscan { position: fixed; inset: 0; z-index: 250; opacity: 0; transition: opacity 0.25s; }
.hostscan.in { opacity: 1; }
.hostscan iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: light; opacity: 0; transition: opacity 0.25s; }
.hostscan.ready iframe { opacity: 1; }
.hostscan-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(6, 12, 24, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; }
.hostscan.ready .hostscan-load { background: rgba(6, 12, 24, 0.35); }
.hostscan.ready .hostscan-load > * { display: none; }
.hostscan.ready.syncing .hostscan-load { background: rgba(6, 12, 24, 0.55); }
.hostscan.ready.syncing .hostscan-load > * { display: block; }

/* ---------- Scan chooser ---------- */

.pick-intro { color: var(--muted); margin-bottom: 14px; }
.picks { display: grid; gap: 12px; }
.pick {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px; border-radius: 18px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); font: inherit; color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease);
}
.pick:hover { border-color: rgba(184, 153, 90, 0.55); box-shadow: var(--shadow); transform: translateY(-1px); }
.pick-ic { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--navy); }
:root[data-theme='dark'] .pick-ic { color: var(--gold-2); }
.pick-ic .ic { width: 24px; height: 24px; }
.pick-txt { flex: 1; display: grid; gap: 2px; }
.pick-txt b { font-weight: 500; font-size: 17px; }
.pick-txt small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.pick-go { color: var(--muted); width: 18px; height: 18px; }
.pick-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 6px 4px 0; margin: -4px 0 12px; font-size: 14px; }
.pick-back:hover { color: var(--ink); }
.pick-back .ic { width: 16px; height: 16px; }
.pick-tip { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pick-tip .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- Sidebar (computers): permanent, collapsible to icons ---------- */

.sidenav { display: none; }
@media (min-width: 1024px) {
  body.has-side { --side-w: 248px; padding-left: var(--side-w); transition: padding-left 0.35s var(--ease); }
  body.has-side.side-collapsed { --side-w: 76px; }
  body.has-side .menu-btn { display: none; }
  body.has-side .topbar .brand { display: none; }
  body.has-side .demo-ribbon { left: calc(var(--side-w) + 18px); }
  .sidenav {
    display: flex; flex-direction: column; position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: var(--side-w);
    padding: 18px 12px 14px; color: #e9ecf3; overflow: hidden;
    background: radial-gradient(140% 60% at 0% 0%, rgba(214, 189, 140, 0.10), transparent 60%), linear-gradient(180deg, #03102a 0%, #020814 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06); box-shadow: 8px 0 30px -18px rgba(0, 10, 33, 0.6);
    transition: width 0.35s var(--ease);
  }
  .sn-head { display: flex; align-items: center; gap: 12px; padding: 2px 6px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); min-height: 66px; }
  .sn-mark { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--gold-2); background: rgba(214, 189, 140, 0.10); border: 1px solid rgba(214, 189, 140, 0.25); }
  .sn-mark .logo-mark { width: 18px; height: 22px; }
  .sn-brand { display: grid; line-height: 1.25; white-space: nowrap; }
  .sn-brand b { font-weight: 500; font-size: 12.5px; letter-spacing: 0.28em; }
  .sn-brand small { font-size: 12.5px; color: rgba(233, 236, 243, 0.55); }
  .sn-label { margin: 20px 10px 8px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(233, 236, 243, 0.45); white-space: nowrap; }
  .sn-apps { display: grid; gap: 6px; }
  .sn-app {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: inherit;
    transition: background 0.2s, color 0.2s;
  }
  .sn-app:hover { background: rgba(255, 255, 255, 0.06); }
  .sn-app.is-current { background: rgba(214, 189, 140, 0.12); }
  .sn-app.is-current::before { content: ''; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-2); }
  .sn-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: rgba(233, 236, 243, 0.85); }
  .sn-app.is-current .sn-ic { background: linear-gradient(150deg, #cdb07a, #a8864a); color: #0b1424; }
  .sn-txt { display: grid; line-height: 1.3; white-space: nowrap; min-width: 0; }
  .sn-txt b { font-weight: 500; font-size: 15px; }
  .sn-txt small { font-size: 12.5px; color: rgba(233, 236, 243, 0.55); overflow: hidden; text-overflow: ellipsis; }
  .sn-foot { margin-top: auto; display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .sn-user { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12.5px; color: rgba(233, 236, 243, 0.6); white-space: nowrap; overflow: hidden; }
  .sn-user .ic { width: 16px; height: 16px; flex: none; }
  .sn-user span { overflow: hidden; text-overflow: ellipsis; }
  .sn-toggle {
    display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; border: 0; cursor: pointer;
    background: transparent; color: rgba(233, 236, 243, 0.7); font-size: 13.5px; white-space: nowrap; position: relative;
  }
  .sn-toggle:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
  .sn-toggle .ic { width: 18px; height: 18px; flex: none; transition: transform 0.35s var(--ease); }

  /* Collapsed: icons only, names appear on hover */
  .side-collapsed .sn-brand, .side-collapsed .sn-txt, .side-collapsed .sn-user span, .side-collapsed .sn-toggle span { opacity: 0; pointer-events: none; }
  .side-collapsed .sn-label { opacity: 0; }
  .side-collapsed .sn-head { padding-left: 6px; }
  .side-collapsed .sn-toggle .ic { transform: rotate(180deg); }
  .sn-brand, .sn-txt, .sn-label, .sn-user span, .sn-toggle span { transition: opacity 0.2s; }
  .side-collapsed .sidenav { overflow: visible; }
  .side-collapsed [data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%);
    padding: 6px 10px; border-radius: 8px; background: #0f1a2e; color: #fff; font-size: 13px; white-space: nowrap;
    box-shadow: var(--shadow); pointer-events: none; z-index: 5;
  }
  .side-collapsed .sn-user { position: relative; }
  .side-collapsed [data-tip='']:hover::after { display: none; }
}

/* Small phones (and zoomed-in browsers): keep the top bar inside the screen */
@media (max-width: 400px) {
  .topbar { padding: 0 6px 0 10px; gap: 4px; }
  .topbar .icon-btn { width: 38px; height: 38px; }
  .menu-btn { margin-left: 0; }
  .brand { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .logo-inline { gap: 7px; min-width: 0; }
  .logo-word { font-size: 11px; letter-spacing: 0.2em; overflow: hidden; text-overflow: clip; }
  .top-actions { flex: none; }
  .main { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 350px) {
  .logo-word { display: none; }
}

@media (hover: none) {
  .btn:hover, .action:hover, .tile-scan:hover, .quick:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .flip-inner { transition: transform 0.2s !important; }
}

/* Scanner controls sit above the dark surround */
.scan-top, .scan-hint, .scan-msg, .scan-bottom { z-index: 2; }

.import-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }

.st-appicon { width: 20px; height: 20px; border-radius: 5px; }

/* ---------- Announcement banner (set in the admin panel) ---------- */

.announce-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.announce-wrap:empty { display: none; }
.announce {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 8px 10px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 14.5px; color: var(--ink-2);
  animation: pageIn 0.5s var(--ease);
}
.announce > .ic { width: 20px; height: 20px; flex: none; color: var(--accent); }
.announce > span:not(.announce-x) { flex: 1; min-width: 0; }
.announce-x { width: 34px; height: 34px; flex: none; }
.announce-success { background: color-mix(in srgb, var(--success) 8%, var(--surface)); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.announce-success > .ic { color: var(--success); }
.announce-warning { background: var(--gold-soft); border-color: rgba(184, 153, 90, 0.45); color: #5b4520; }
.announce-warning > .ic { color: #a8864a; }
:root[data-theme='dark'] .announce-warning { background: rgba(214, 189, 140, 0.12); color: var(--gold-2); }
.announce.is-preview { margin-top: 0; animation: none; }
body.in-admin .announce-wrap { max-width: 1280px; }

/* ---------- Admin panel ---------- */

body.in-admin .main { max-width: 1280px; }
.tabs .tabs-admin { color: var(--ink-2); }
.tabs .tabs-admin .ic { color: var(--accent); }
.adm-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, #0a3a73, #002957); color: var(--gold-2); box-shadow: 0 6px 16px rgba(0, 41, 87, 0.25); }
.adm-badge .ic { width: 20px; height: 20px; }
.admin-entry { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.2s, transform 0.2s var(--ease); }
.admin-entry:hover { border-color: rgba(184, 153, 90, 0.5); transform: translateY(-1px); }
.admin-entry > span:nth-child(2) { flex: 1; display: grid; line-height: 1.3; }
.admin-entry b { font-weight: 500; }
.admin-entry small { color: var(--muted); font-size: 12.5px; }
.admin-entry > .ic { width: 18px; height: 18px; color: var(--muted); }

.adm { display: grid; gap: 28px; grid-template-columns: 236px minmax(0, 1fr); align-items: start; }
.adm-side { position: sticky; top: calc(var(--top-h) + 20px); display: grid; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.adm-side-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.adm-side-head div { display: grid; min-width: 0; line-height: 1.3; }
.adm-side-head b { font-weight: 500; font-size: 16px; }
.adm-side-head small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-nav { display: grid; gap: 2px; }
.adm-nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; font-size: 15px; transition: background 0.2s, color 0.2s; position: relative; }
.adm-nav a .ic { color: var(--muted); transition: color 0.2s; }
.adm-nav a:hover { background: var(--surface-2); color: var(--ink); }
.adm-nav a[aria-current='page'] { background: var(--surface-3); color: var(--ink); }
.adm-nav a[aria-current='page'] .ic { color: var(--accent); }
.adm-nav a[aria-current='page']::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.adm-back { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.adm-back:hover { color: var(--ink); }
.adm-back .ic { width: 16px; height: 16px; }

.adm-main { min-width: 0; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.adm-sub { margin-top: 4px; font-size: 15px; }
.adm-body { display: grid; gap: 20px; min-width: 0; }
.adm-main > .notice { margin-bottom: 18px; }
.adm-loading { min-height: 40vh; display: grid; place-items: center; }

.panel { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); min-width: 0; display: grid; gap: 16px; align-content: start; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 18px; font-weight: 500; }
.panel-head p { font-size: 13.5px; margin-top: 2px; }
.panel-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.adm-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.adm-cols { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.adm-stack { display: grid; gap: 20px; }
.up { display: inline-flex; align-items: center; gap: 3px; color: var(--success); font-weight: 500; }
.up .ic { width: 14px; height: 14px; }
.down { color: var(--danger); }

/* KPI cards */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { display: grid; gap: 6px; align-content: start; text-align: left; padding: 18px 18px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font: inherit; color: inherit; min-width: 0; transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.2s; }
button.kpi { cursor: pointer; }
button.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(184, 153, 90, 0.4); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: #8a6a2f; }
:root[data-theme='dark'] .kpi-ic { background: rgba(214, 189, 140, 0.12); color: var(--gold-2); }
.kpi-ic .ic { width: 17px; height: 17px; }
.kpi-label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 32px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.kpi-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #cdb07a, #a8864a); }

/* Bar chart */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.lg-scan { background: var(--navy); }
:root[data-theme='dark'] .lg-scan { background: #6f8fc4; }
.lg-qr { background: #c8a96a; }
.lg-other { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.chart { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 220px; padding-bottom: 22px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; margin-bottom: -6px; }
.chart-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; align-items: end; height: 100%; position: relative;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50%; border-bottom: 1px solid var(--line-2); }
.bar { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-stack { width: 100%; max-width: 18px; height: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.bar-stack i { display: block; width: 100%; transition: opacity 0.2s; }
.bar-stack i:last-child { border-radius: 4px 4px 0 0; }
.bar em { position: absolute; bottom: calc(100% + 2px); font-style: normal; font-size: 10.5px; color: var(--muted); opacity: 0; transition: opacity 0.2s; }
.bar:hover em { opacity: 1; }
.bar:hover .bar-stack i { opacity: 0.85; }
.bar small { position: absolute; top: calc(100% + 6px); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.chart-empty { text-align: center; font-size: 13.5px; margin-top: -8px; }

/* Needs attention */
.attn { display: grid; gap: 8px; }
.attn-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; cursor: pointer; font-size: 14px; color: var(--ink-2); transition: border-color 0.2s, transform 0.2s var(--ease); }
.attn-item:hover { border-color: var(--line-2); transform: translateX(2px); }
.attn-item > span:nth-child(2) { flex: 1; min-width: 0; }
.attn-item b { color: var(--ink); font-weight: 600; }
.attn-item > .ic { width: 16px; height: 16px; color: var(--muted); }
.attn-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.attn-ic .ic { width: 17px; height: 17px; }
.attn-bad .attn-ic { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.attn-warn .attn-ic { background: var(--gold-soft); color: #8a6a2f; }
:root[data-theme='dark'] .attn-warn .attn-ic { background: rgba(214, 189, 140, 0.14); color: var(--gold-2); }
.allclear { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: color-mix(in srgb, var(--success) 7%, transparent); }
.allclear > .ic { width: 30px; height: 30px; color: var(--success); }
.allclear div { display: grid; }
.allclear b { font-weight: 500; }

/* System */
.sys { display: grid; }
.sys-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 42px; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.sys-row:first-child { border-top: 0; padding-top: 0; }
.sys-row > div { display: grid; line-height: 1.4; min-width: 0; }
.sys-row b { font-weight: 500; }
.sys-row > div span { color: var(--muted); font-size: 13.5px; }
.sys-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.sys-ic .ic { width: 18px; height: 18px; }
.sys-dot { width: 10px; height: 10px; border-radius: 50%; }
.sys-ok { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent); }
.sys-warn { background: #d4a14a; box-shadow: 0 0 0 4px rgba(212, 161, 74, 0.2); }
.sys-off { background: var(--line-2); }

/* People */
.pp-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.pp-tools .select-pill { height: 48px; border-radius: 14px; }
.pp-filters { justify-self: start; }
.pp-filters .cnt { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-filters .cnt:empty { display: none; }
.pp-filters [aria-selected='true'] .cnt { color: var(--accent); }
.pp-samples { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; justify-self: start; }
.switch-sm { width: 38px; height: 22px; margin: 0; }
.switch-sm::after { width: 16px; height: 16px; }
.switch-sm:checked::after { transform: translateX(16px); }
.pp-count { font-size: 13.5px; margin-bottom: -8px; }

.pt { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.pt-row {
  display: grid; grid-template-columns: minmax(220px, 2.6fr) 112px 150px 116px 100px 86px 22px; align-items: center; gap: 12px;
  width: 100%; padding: 12px 18px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; font-size: 14px;
}
button.pt-row { cursor: pointer; transition: background 0.15s; }
button.pt-row:hover { background: var(--surface-2); }
button.pt-row:hover .pt-go { color: var(--accent); transform: translateX(2px); }
.pt-head { border-top: 0; padding-top: 12px; padding-bottom: 12px; background: var(--surface-2); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.pt .num { text-align: right; font-variant-numeric: tabular-nums; }
.pt-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pt-person > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.pt-person b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-person small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { font-style: normal; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--accent); margin-left: 4px; }
.pt-seen { color: var(--ink-2); }
.pt-go { color: var(--muted); transition: transform 0.2s var(--ease), color 0.2s; display: grid; }
.pt-go .ic { width: 16px; height: 16px; }
.adm-ok, .adm-bad { display: inline-flex; align-items: center; gap: 5px; }
.adm-ok { color: var(--success); }
.adm-bad { color: var(--danger); }
.adm-ok .ic, .adm-bad .ic { width: 15px; height: 15px; }

.role { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.role .ic { width: 13px; height: 13px; }
.role-owner { background: linear-gradient(135deg, #0a3a73, #002957); color: var(--gold-2); }
:root[data-theme='dark'] .role-owner { background: linear-gradient(135deg, #d9c39a, #b8995a); color: #0b1424; }
.role-admin { background: var(--gold-soft); color: #7a5c24; }
:root[data-theme='dark'] .role-admin { background: rgba(214, 189, 140, 0.16); color: var(--gold-2); }
.role-viewer { background: color-mix(in srgb, #4b6fb0 14%, transparent); color: #34548e; }
:root[data-theme='dark'] .role-viewer { color: #9bb6e6; }
.stat { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.stat i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.stat-ok i { background: var(--success); }
.stat-bad { color: var(--danger); }
.stat-bad i { background: var(--danger); }
.stat-idle { color: var(--muted); }

/* Person details */
.adm-person .sheet-body { padding-top: 4px; }
.pd { display: grid; gap: 22px; }
.pd-head { display: flex; gap: 18px; align-items: center; min-width: 0; }
.pd-id { display: grid; gap: 4px; min-width: 0; }
.pd-id h2 { font-size: 24px; font-weight: 400; line-height: 1.2; }
.pd-id p { font-size: 14px; }
.pd-email { display: inline-flex; align-items: center; gap: 6px; justify-self: start; max-width: 100%; padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pd-email span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-email .ic { width: 14px; height: 14px; color: var(--muted); }
.pd-chips { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.pd-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.pd-stats div { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; text-align: center; border-left: 1px solid var(--line); min-width: 0; }
.pd-stats div:first-child { border-left: 0; }
.pd-stats b { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pd-stats span { font-size: 11.5px; color: var(--muted); }
.pd-sec { display: grid; gap: 10px; }
.pd-sec h3, .mo-group h3, .sub-h, .log-day h3 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.role-pick { display: grid; gap: 8px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color 0.2s, box-shadow 0.2s; }
.role-opt > span:last-child { display: grid; gap: 2px; }
.role-opt b { font-weight: 500; }
.role-opt small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.role-opt[aria-checked='true'] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 153, 90, 0.18); }
.role-opt:disabled { cursor: default; opacity: 0.62; }
.role-opt:disabled[aria-checked='true'] { opacity: 1; }
.role-opt:not(:disabled):hover { border-color: rgba(184, 153, 90, 0.6); }
.role-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; margin-top: 2px; display: grid; place-items: center; transition: border-color 0.2s; }
[aria-checked='true'] > .role-radio { border-color: var(--gold); }
[aria-checked='true'] > .role-radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, #cdb07a, #a8864a); }
.pd-rows { display: grid; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.pd-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); min-width: 0; }
.pd-rows .pd-row:first-child { border-top: 0; }
.panel > .pd-row { border: 1px solid var(--line); border-radius: 14px; }
.pd-row > .ic { width: 18px; height: 18px; color: var(--accent); flex: none; }
.pd-row > span { flex: 1; display: grid; gap: 1px; min-width: 0; line-height: 1.4; }
.pd-row b { font-weight: 500; font-size: 14.5px; }
.pd-row small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.pd-row .btn { flex: none; }
.pd-row-bad { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.pd-row-bad > .ic { color: var(--danger); }
.pd-note-actions { display: flex; justify-content: flex-end; }
.pd-note-actions[hidden] { display: none; }
.pd-note-actions { gap: 8px; }
.pd-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pd-details .field:first-child { grid-column: 1 / -1; }
.pd-details input { height: 42px; }
.pd-details input:disabled { background: var(--surface-2); color: var(--ink-2); }
.pd-tag { display: inline-flex; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; background: var(--gold-soft); color: #7a5c24; vertical-align: 1px; }
:root[data-theme='dark'] .pd-tag { background: rgba(214, 189, 140, 0.16); color: var(--gold-2); }
.pd-tag-dir { background: var(--surface-3); color: var(--muted); }
@media (max-width: 720px) { .pd-details { grid-template-columns: 1fr; } }
.pd-log .spinner { margin: 6px 0; }

/* Activity log */
.log { display: grid; gap: 2px; }
.log-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-top: 1px solid var(--line); }
.log .log-item:first-child { border-top: 0; }
.log-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--accent); border: 1px solid var(--line); }
.log-ic .ic { width: 16px; height: 16px; }
.log-item > div { display: grid; gap: 2px; min-width: 0; }
.log-item p { font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.log-item p b { color: var(--ink); font-weight: 500; }
.log-item .muted { font-size: 12.5px; }
.log-sm .log-item p { font-size: 13.5px; }
.log-day { padding: 18px 22px 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.log-day h3 { margin-bottom: 6px; }

/* AI scanner */
.sc-hero { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; background: linear-gradient(135deg, #0a3a73 0%, #002957 60%, #00183a 100%); color: #fff; border: 0; box-shadow: 0 14px 40px rgba(0, 41, 87, 0.25); }
.sc-hero .eyebrow { color: rgba(255, 255, 255, 0.6); }
.sc-hero h2 { font-size: 22px; font-weight: 400; margin-top: 2px; }
.sc-hero .muted { color: rgba(255, 255, 255, 0.65); font-size: 13.5px; margin-top: 4px; overflow-wrap: anywhere; }
.sc-hero-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); color: var(--gold-2); border: 1px solid rgba(255, 255, 255, 0.15); }
.sc-hero-ic .ic { width: 28px; height: 28px; }
.sc-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 4px; }
.sc-stats div { display: grid; padding: 8px 16px; border-left: 1px solid rgba(255, 255, 255, 0.15); text-align: right; }
.sc-stats div:first-child { border-left: 0; }
.sc-stats b { font-size: 22px; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.sc-stats span { font-size: 11.5px; color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
.mo-list { display: grid; gap: 8px; }
.mo-group { display: grid; gap: 2px; margin: 12px 0 2px; }
.mo-group p { font-size: 13px; }
.mo { display: flex; gap: 14px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.mo:hover { border-color: rgba(184, 153, 90, 0.55); }
.mo.is-picked { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 153, 90, 0.18); background: color-mix(in srgb, var(--gold-soft) 35%, var(--surface)); }
:root[data-theme='dark'] .mo.is-picked { background: rgba(214, 189, 140, 0.06); }
.mo-auto { border-style: dashed; }
.mo-main { flex: 1; display: grid; gap: 5px; min-width: 0; }
.mo-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mo-title b { font-weight: 500; font-size: 15.5px; }
.mo code, .tbl code, .recent code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.mo-desc { font-size: 13.5px; line-height: 1.45; }
.mo-tags { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.mo-tags span { display: inline-flex; align-items: center; gap: 4px; }
.mo-tags .ic { width: 13px; height: 13px; color: var(--accent); }
.mo > .btn { flex: none; align-self: center; }
.tbadge { display: inline-flex; align-items: center; gap: 6px; justify-self: start; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; background: var(--surface-3); color: var(--ink-2); }
.tbadge .spinner { width: 13px; height: 13px; }
.tbadge .ic { width: 14px; height: 14px; flex: none; }
.tb-ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.tb-bad { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.savebar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 12px 12px 18px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 14.5px; animation: pageIn 0.35s var(--ease); }
.savebar[hidden] { display: none; }
.savebar b { font-weight: 600; }
.savebar-btns { display: flex; gap: 8px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.recent { display: grid; gap: 2px; }
.recent li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.recent .ic { width: 16px; height: 16px; }

/* Settings */
.ann-preview { padding: 14px; border-radius: 16px; background: var(--bg); background-image: var(--bg-grad); border: 1px dashed var(--line-2); }
/* Guest access (owner only) */
.guest-add { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.guest-add .btn { height: 46px; }
.guests { display: grid; }
.guest { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.guests .guest:first-child { border-top: 0; padding-top: 0; }
.guest-who { flex: 1; display: grid; min-width: 0; line-height: 1.35; }
.guest-who b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.guest-who small { color: var(--muted); font-size: 12.5px; }
.guest-tag { color: #34548e; }
:root[data-theme='dark'] .guest-tag { color: #9bb6e6; }
@media (max-width: 720px) { .guest-add { grid-template-columns: minmax(0, 1fr); } .guest-add .btn { width: 100%; } }
.roles-help { display: grid; gap: 12px; }
.roles-help li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.roles-help .role { justify-self: start; }

@media (max-width: 1180px) {
  .pt-row { grid-template-columns: minmax(200px, 2.4fr) 104px 140px 104px 92px 22px; }
  .pt-contacts, .pt-head span:nth-child(6) { display: none; }
}
@media (max-width: 1023px) {
  .adm { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .adm-side { position: sticky; top: var(--top-h); z-index: 20; padding: 8px 0; margin: -8px -20px 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); }
  .adm-side-head, .adm-back { display: none; }
  .adm-nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 20px; scrollbar-width: none; }
  .adm-nav::-webkit-scrollbar { display: none; }
  .adm-nav a { flex: none; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; }
  .adm-nav a[aria-current='page'] { background: var(--surface); box-shadow: var(--shadow-sm); }
  .adm-nav a[aria-current='page']::before { display: none; }
  .adm-grid, .adm-cols { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-hero { grid-template-columns: auto minmax(0, 1fr); }
  .sc-stats { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); background: rgba(255, 255, 255, 0.06); border-radius: 14px; }
  .sc-stats div { text-align: left; }
}
@media (max-width: 860px) {
  .pt { background: none; border: 0; box-shadow: none; overflow: visible; display: grid; gap: 8px; }
  .pt-head { display: none; }
  .pt-row { grid-template-columns: minmax(0, 1fr) auto 18px; grid-template-areas: 'person role go' 'person status go'; row-gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .pt-person { grid-area: person; }
  .pt-role { grid-area: role; justify-self: end; }
  .pt-status { grid-area: status; justify-self: end; }
  .pt-status .stat { font-size: 12px; }
  .pt-go { grid-area: go; }
  .pt-seen, .pt-card, .pt-contacts, .pt-google { display: none; }
}
@media (max-width: 720px) {
  .announce-wrap { padding: 0 16px; }
  .adm-side { margin: -6px -16px 0; }
  .adm-nav { padding: 0 16px; }
  .adm-head { margin-bottom: 14px; }
  .adm-head .page-title { font-size: 28px; }
  .panel { padding: 18px 16px; border-radius: 20px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; border-radius: 18px; }
  .kpi-value { font-size: 26px; }
  .kpi-label { font-size: 12.5px; }
  .kpi-ic { width: 28px; height: 28px; }
  .chart { height: 180px; }
  .chart-bars { gap: 2px; }
  .bar small { font-size: 9.5px; }
  .pp-tools { grid-template-columns: minmax(0, 1fr); }
  .pp-tools .select-pill { justify-self: start; height: 40px; }
  .sys-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sys-row > .icon-btn, .sys-row > span:last-child:empty { display: none; }
  .pd-head { flex-direction: column; text-align: center; gap: 12px; }
  .pd-id { justify-items: center; }
  .pd-email { justify-self: center; }
  .pd-chips { justify-content: center; }
  .pd-stats { grid-template-columns: repeat(2, 1fr); }
  .pd-stats div:nth-child(3) { border-left: 0; }
  .pd-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pd-row { flex-wrap: wrap; }
  .pd-row > span { flex-basis: calc(100% - 40px); }
  .pd-row .btn { margin-left: 30px; }
  .sc-hero { padding: 18px; gap: 14px; }
  .sc-hero-ic { width: 46px; height: 46px; border-radius: 14px; }
  .sc-hero h2 { font-size: 19px; }
  .sc-stats div { padding: 8px 10px; }
  .sc-stats b { font-size: 18px; }
  .mo { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .mo-main { flex-basis: calc(100% - 40px); }
  .mo > .btn { margin-left: 30px; }
  .savebar { bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); }
  .savebar-btns { width: 100%; }
  .savebar-btns .btn { flex: 1; }
  .log-day { padding: 14px 16px 6px; border-radius: 20px; }
  .roles-help li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .recent li { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .recent li span:last-child { display: none; }
}
