/* ==========================================================================
   Sapa: the visual system. Follows DESIGN.md: a midnight violet chrome, a white
   canvas for the work, one near-black primary button, lime only as a rare
   highlight. Structural overrides live in theme.css, loaded last.
   ========================================================================== */
:root {
  /* type: Rubik for all UI, Space Grotesk for display (the open substitute DESIGN.md names), Monaco for code */
  --font-display: "Space Grotesk", "Rubik", system-ui, sans-serif;
  --font-body: "Rubik", -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: Monaco, Menlo, "Ubuntu Mono", monospace;

  /* DESIGN.md colours */
  --primary: #150f23;
  --ink-deep: #1f1633;
  --on-primary: #ffffff;
  --accent-lime: #c2ef4e;
  --accent-pink: #fa7faa;
  --accent-violet: #6a5fc1;
  --accent-violet-deep: #422082;
  --accent-violet-mid: #79628c;
  --surface-night: #150f23;
  --canvas-dark: #1f1633;
  --hairline-violet: #362d59;
  --hairline-cool: #cfcfdb;
  --hairline-cloud: #e5e7eb;
  --press: #efefef;
  --ink-press: #1a1a1a;
  --on-dark-muted: #bdb8c0;
  --on-dark-faint: rgba(255, 255, 255, 0.18);
  --focus-light: #3b82f6;
  --focus-dark: #9dc1f5;

  /* ink + surfaces */
  --ink: #1f1633;
  --ink-2: #3f3849;
  --ink-3: #5f5870;
  --ground: #ffffff;
  --surface: #ffffff;
  --well: #f6f5f9;
  --well-hover: #eeecf4;
  --sunken: #f6f5f9;
  --muted-fill: #eeecf4;
  --glass: #ffffff;
  --glass-strong: #ffffff;
  --glass-edge: #e5e7eb;
  --line: #e5e7eb;
  --line-2: #cfcfdb;
  --field: #ffffff;
  --field-line: #cfcfdb;

  /* the old accent names now point at the violet family */
  --warm: #422082;
  --warm-hover: #2f1760;
  --warm-tint: #f1eefa;
  --pine: #422082;
  --rail: #150f23;
  --marigold: #422082;
  --orange: #422082;
  --pink: #422082;
  --violet: #422082;
  --cyan: #6a5fc1;
  --grad: #150f23;
  --grad-hover: #1f1633;
  --grad-bright: #422082;
  --grad-soft: #f1eefa;
  --grad-ok: #4a6500;
  --grad-cool: #422082;

  /* semantic: status only, drawn from the violet, pink and lime families. No amber, teal or blue. */
  --ok: #4a6500;
  --ok-bg: #f1fad9;
  --danger: #b0124f;
  --danger-bg: #fee8f0;
  --warn: #5e4a72;
  --warn-bg: #f1edf5;
  --info: #422082;
  --info-bg: #f1eefa;

  /* legacy aliases (referenced from inline styles) */
  --brand: #422082;
  --brand-dark: #2f1760;
  --brand-light: #f1eefa;
  --accent: #422082;
  --bg: var(--ground);
  --border: var(--line-2);
  --text: var(--ink);
  --text-muted: var(--ink-3);
  --sidebar-bg: #150f23;
  --sidebar-text: #ffffff;

  /* depth: flat, level 2 only for what floats on the light canvas */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.1) 0 4px 6px -4px;
  --shadow-glow: none;
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.5);

  /* shape */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 12px;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  --t-fast: 140ms;
  --t-med: 220ms;
  --t-slow: 420ms;

  /* charts — the dataviz skill's validated default palette, unchanged */
  --viz-surface: #ffffff;
  --viz-text-primary: var(--ink);
  --viz-text-secondary: var(--ink-3);
  --viz-muted: #5f5870;
  --viz-grid: #e5e7eb;
  --viz-baseline: #cfcfdb;
  --viz-1: #422082;
  --viz-2: #fa7faa;
  --viz-3: #6a5fc1;
  --viz-4: #79628c;
  --viz-5: #1f1633;
  --viz-6: #bdb8c0;
  --viz-7: #362d59;
  --viz-8: #b0124f;
  --viz-good: #4a6500;
  --viz-warning: #79628c;
  --viz-critical: #b0124f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 1.5; color: var(--ink);
  background: var(--ground); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  position: relative; min-height: 100vh;
}
a { color: var(--brand); text-underline-offset: 2px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
code { font-family: var(--font-mono); }
h1, h2, h3, h4 { text-wrap: balance; }
::selection { background: rgba(176, 18, 79, 0.22); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; transition: top var(--t-fast) var(--ease-out); }
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- Gate */
.gate {
  position: fixed; inset: 0; z-index: 100; overflow: auto; color: #fff;
  display: grid; grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); align-items: center; gap: 24px;
  padding: 32px clamp(16px, 5vw, 72px);
  background:
    radial-gradient(60% 60% at 80% 20%, rgba(176, 18, 79, 0.35), transparent 70%),
    radial-gradient(50% 50% at 10% 90%, rgba(176, 18, 79, 0.25), transparent 70%),
    radial-gradient(40% 40% at 30% 10%, rgba(94, 74, 114, 0.22), transparent 70%),
    #2f1760;
}
.gate::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='32'%3E%3Cpath d='M0 16 28 0 56 16 28 32Z' fill='none' stroke='%23ffffff' stroke-opacity='.05'/%3E%3C/svg%3E");
}
.gate-card {
  position: relative; z-index: 1; padding: 34px; border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: rise-in 0.7s var(--ease-out) both;
}
.gate-logo { display: block; height: 38px; width: auto; margin-bottom: 26px; }
.gate-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; background: var(--grad-bright); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate h2 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; letter-spacing: 0; margin: 8px 0 12px; }
.gate p { font-size: 14.5px; color: rgba(255, 255, 255, 0.72); margin: 0 0 22px; line-height: 1.6; }
.gate label { display: block; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.8); margin-bottom: 8px; }
.gate input {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md); font-size: 16px; margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff;
  transition: border-color var(--t-fast) var(--ease-std), box-shadow var(--t-fast) var(--ease-std), background-color var(--t-fast);
}
.gate input::placeholder { color: rgba(255, 255, 255, 0.45); }
.gate input:focus { outline: none; border-color: rgba(176, 18, 79, 0.9); box-shadow: 0 0 0 4px rgba(176, 18, 79, 0.3); background: rgba(255, 255, 255, 0.12); }
.gate button {
  width: 100%; padding: 14px; border: none; border-radius: var(--r-md); background: var(--grad); color: #fff;
  font-weight: 700; font-size: 15.5px; box-shadow: var(--shadow-glow); position: relative; overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.gate button:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -12px rgba(176, 18, 79, 0.7); }
.gate button:active { transform: scale(0.98); }
.gate .error { color: #fee8f0; font-size: 13px; margin: 12px 0 0; min-height: 18px; }
.gate-foot { font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-top: 18px; }
.gate-art { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
.gate-art svg { width: min(100%, 620px); height: auto; filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.35)); }

/* Isometric art shared motion (inline SVGs) */
.iso-float { animation: iso-float 6s ease-in-out infinite; transform-box: fill-box; }
.iso-shadow { animation: iso-shadow 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.iso-bars > g { animation: iso-rise 0.9s var(--ease-spring) both; transform-box: fill-box; transform-origin: bottom; }
.iso-bars > g:nth-child(2) { animation-delay: 0.08s; }
.iso-bars > g:nth-child(3) { animation-delay: 0.16s; }
.iso-orbs circle { animation: orb-pulse 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes iso-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes iso-shadow { 0%, 100% { transform: scale(1); opacity: 0.22; } 50% { transform: scale(0.88); opacity: 0.14; } }
@keyframes iso-rise { from { transform: scaleY(0.2); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes orb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* individual translate (not transform) so entrances compose with the 3D tilt transform */
@keyframes rise-in { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

/* ---------------------------------------------------------------- Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow: hidden; overflow: clip; /* clip: the glow circles stick out, and a hidden overflow could still be scrolled sideways when focus moves inside */
  display: flex; flex-direction: column; padding: 20px 14px 16px; color: var(--sidebar-text);
  background: linear-gradient(180deg, #2f1760 0%, #2f1760 60%, #2f1760 100%);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.04), 12px 0 40px -24px rgba(31, 22, 51, 0.6);
  z-index: 10;
}
.sidebar::before {
  content: ""; position: absolute; width: 260px; height: 260px; left: -90px; top: -110px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(176, 18, 79, 0.45), transparent 65%); filter: blur(10px);
}
.sidebar::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -120px; bottom: 60px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(176, 18, 79, 0.28), transparent 65%); filter: blur(10px);
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar .brand { padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); margin-bottom: 14px; }
.sidebar .brand img { display: block; height: 30px; width: auto; }
.sidebar .brand .brand-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--grad-bright); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }
.sidebar .nav-item {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px;
  padding: 9px 12px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 500; margin-bottom: 3px; color: var(--sidebar-text);
  transition: background-color var(--t-fast) var(--ease-std), color var(--t-fast) var(--ease-std), transform var(--t-fast) var(--ease-out);
}
.sidebar .nav-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar .nav-item:active { transform: scale(0.98); }
.sidebar .nav-item.active { background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -12px rgba(176, 18, 79, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.sidebar .nav-item .count { font-size: 12px; font-weight: 700; color: #f1eefa; background: rgba(255, 255, 255, 0.08); padding: 2px 8px; border-radius: 4px; line-height: 1.4; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.sidebar .nav-item.active .count { color: #fff; background: rgba(255, 255, 255, 0.2); }
.sidebar .nav-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: #5f5870; margin: 18px 12px 8px; }
.sidebar .add-project-btn {
  width: 100%; margin-top: 10px; padding: 10px; min-height: 42px; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, 0.16);
  background: none; color: #f1eefa; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.sidebar .add-project-btn:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
#4a6500-project-btn { border: none; background: var(--grad); color: #fff; font-weight: 700; box-shadow: var(--shadow-glow); }
#4a6500-project-btn:hover { background: var(--grad-hover); transform: translateY(-1px); }
#4a6500-project-btn:active { transform: scale(0.98); }
#show-archived-btn { border: none; color: #5f5870; font-size: 12px; min-height: 32px; padding: 6px; }
#show-archived-btn:hover { background: none; color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 28px; background: rgba(229, 231, 235, 0.72); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
}
.topbar h1 { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: 0; margin: 0; }
.topbar .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.topbar .sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4a6500; box-shadow: 0 0 0 3px rgba(74, 101, 0, 0.18); animation: live-dot 2.4s ease-in-out infinite; }
@keyframes live-dot { 0%, 100% { box-shadow: 0 0 0 3px rgba(74, 101, 0, 0.18); } 50% { box-shadow: 0 0 0 6px rgba(74, 101, 0, 0.05); } }
.content { padding: 26px 28px 70px; width: 100%; max-width: 1360px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass-strong); color: var(--ink);
  font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out), background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn svg { flex-shrink: 0; }
.btn:hover { background: #fff; border-color: rgba(176, 18, 79, 0.35); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); box-shadow: var(--shadow-sm); }
.btn-brand { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-glow); }
.btn-brand:hover { background: var(--grad-hover); color: #fff; border-color: transparent; box-shadow: 0 16px 32px -12px rgba(176, 18, 79, 0.65); }
/* sheen sweep on primary buttons */
.btn-brand::after, .btn-scan::after, .ci-btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
}
.btn-brand:hover::after, .btn-scan:hover::after, .ci-btn:hover::after { transform: translateX(120%); transition: transform 0.7s var(--ease-out); }
.btn-outline { background: #fff; border: 1px solid rgba(176, 18, 79, 0.45); color: var(--danger); display: inline-flex; align-items: center; min-height: 38px; padding: 8px 14px; border-radius: 12px; font-weight: 600; }
.btn-outline:hover { background: var(--danger-bg); }
.btn:disabled, .btn-brand:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.icon-only { padding: 9px; min-width: 40px; }
.link-btn { background: none; border: none; padding: 0; color: var(--info); text-decoration: underline; text-decoration-color: rgba(176, 18, 79, 0.35); text-underline-offset: 3px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration-color: currentColor; }

.icon-btn {
  border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 6px 11px; min-height: 32px; font-size: 13px; font-weight: 600;
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.icon-btn:hover { background: #f1eefa; border-color: rgba(176, 18, 79, 0.35); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn.approve { color: var(--ok); border-color: rgba(58, 79, 0, 0.3); }
.icon-btn.approve:hover { background: var(--ok-bg); }
.icon-btn.reject { color: var(--danger); border-color: rgba(176, 18, 79, 0.3); }
.icon-btn.reject:hover { background: var(--danger-bg); }
.icon-btn.reset { color: var(--ink-2); }
.icon-btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.icon-btn.danger:hover { background: #b0124f; }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.last-sent-note { display: block; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.row-delete-btn { background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px; min-width: 32px; min-height: 32px; color: #5f5870; line-height: 0; transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast); }
.row-delete-btn:hover { color: var(--info); background: var(--info-bg); border-color: rgba(176, 18, 79, 0.25); }
.row-delete-btn[data-action="delete"]:hover { color: var(--danger); background: var(--danger-bg); border-color: rgba(176, 18, 79, 0.25); }

/* ---------------------------------------------------------------- Menus */
.toolbar-spacer { flex: 1 1 auto; }
.menu-wrap { position: relative; }
.menu-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 4px; background: var(--pink); border: 2px solid #fff; }
.menu-popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 240px; padding: 8px; border-radius: var(--r-md);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transform-origin: top left; animation: menu-in 0.18s var(--ease-out) both;
}
.menu-popover--right { left: auto; right: 0; transform-origin: top right; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.95) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-field { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 6px 6px 2px; }
.menu-field select { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--field-line); border-radius: 8px; font-size: 14px; background: #fff; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); }
.menu-check { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.menu-check:hover { background: rgba(176, 18, 79, 0.07); }
.menu-check input { width: 16px; height: 16px; accent-color: var(--violet); }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; text-align: left; background: none; border: none; padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink); transition: background-color var(--t-fast), color var(--t-fast);
}
.menu-item:hover { background: rgba(176, 18, 79, 0.08); color: var(--info); }
.menu-item svg { flex-shrink: 0; color: var(--ink-3); }
.menu-item:hover svg { color: var(--violet); }

/* ---------------------------------------------------------------- Stats */
.col-secondary { color: var(--ink-3); font-weight: 400; }
td.col-secondary { font-size: 13px; }
.stat-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
@media (max-width: 1320px) { .stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat-card { padding: 14px; gap: 10px; } .stat-card .stat-icon { width: 36px; height: 36px; } .stat-card .stat-value { font-size: 22px; } }
.stat-card {
  position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.stat-card::before { content: ""; position: absolute; left: 20px; right: 20px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad-bright); opacity: 0.9; }
.stat-card.alt::before { background: linear-gradient(90deg, #422082, #3a4f00); }
.stat-card.ok::before { background: linear-gradient(90deg, #4a6500, #4a6500); }
.stat-card:hover { --lift: -2px; box-shadow: var(--shadow-lg); }
/* 3D chip icon: gradient tile tipped back in perspective */
.stat-card .stat-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff;
  background: var(--grad); box-shadow: 0 10px 18px -8px rgba(176, 18, 79, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  transform: perspective(160px) rotateX(14deg) rotateY(-16deg);
}
.stat-card.alt .stat-icon { background: var(--grad-cool); box-shadow: 0 10px 18px -8px rgba(66, 32, 130, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.stat-card.ok .stat-icon { background: var(--grad-ok); box-shadow: 0 10px 18px -8px rgba(58, 79, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 27px; font-weight: 700; line-height: 1.1; letter-spacing: 0; white-space: nowrap; display: flex; align-items: baseline; font-variant-numeric: tabular-nums; }
.stat-card .stat-value .stat-frac-sep { font-size: 16px; font-weight: 600; color: var(--ink-3); margin: 0 3px; }
.stat-card .stat-value .stat-frac-den { font-size: 16px; font-weight: 600; color: var(--ink-3); }
.stat-card .stat-label { font-size: 13px; color: var(--ink-3); margin-top: 4px; font-weight: 500; }
.stat-card .stat-label .stat-label-sub { display: block; font-size: 12px; opacity: 0.85; }

/* ---------------------------------------------------------------- Panels & tables */
.panel {
  position: relative; padding: 20px 22px; margin-bottom: 20px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.panel h2 { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0; margin: 0 0 14px; }
.panel .note { font-size: 13px; color: var(--ink-3); margin-top: -6px; margin-bottom: 14px; line-height: 1.55; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.82); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  position: sticky; top: 0; z-index: 2; background: #e5e7eb; text-align: left; padding: 11px 12px; color: var(--ink-3);
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color var(--t-fast) var(--ease-std); }
tbody tr:hover { background: rgba(176, 18, 79, 0.045); }
tbody tr.is-test { background: #f1edf5; }
tbody tr.is-selected { background: rgba(176, 18, 79, 0.09); }
tbody tr.is-syncing { position: relative; }
tbody tr.is-syncing::after { content: 'Saving…'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--info); background: var(--info-bg); padding: 2px 8px; border-radius: 4px; }
tbody tr.is-saved-flash td { animation: row-saved-flash 1.1s ease both; }
@keyframes row-saved-flash { 0% { background: var(--ok-bg); } 100% { background: transparent; } }
.empty-note { color: var(--ink-3); font-size: 14px; padding: 16px 0; text-align: center; }

/* skeleton rows (placeholder until the first render replaces them) */
.skel td { padding: 14px 12px; }
.skel span { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #f1eefa 0%, #f1eefa 40%, #f1eefa 80%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Status pills (selects) */
.approval-select {
  padding: 6px 26px 6px 11px; border-radius: 4px; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 30px;
  border: 1px solid transparent; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2344475a' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: box-shadow var(--t-fast), filter var(--t-fast);
}
.approval-select:hover:not(:disabled) { filter: brightness(0.97); box-shadow: 0 0 0 3px rgba(176, 18, 79, 0.12); }
.approval-select:disabled { cursor: default; background-image: none; padding-right: 11px; }
.approval-select.st-pending, .approval-select.cf-noresponse { background-color: #e5e7eb; color: #1f1633; }
.approval-select.st-approved, .approval-select.cf-confirmed { background-color: var(--ok-bg); color: var(--ok); }
.approval-select.st-rejected, .approval-select.cf-cancelled { background-color: var(--danger-bg); color: var(--danger); }
.approval-select.st-waitlisted { background-color: #f1eefa; color: #422082; }
.approval-select.cf-tentative { background-color: var(--warn-bg); color: var(--warn); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; }
.badge-pending, .badge-notsent { background: #e5e7eb; color: #1f1633; }
.badge-approved, .badge-attended, .badge-sent { background: var(--ok-bg); color: var(--ok); }
.badge-rejected, .badge-failed { background: var(--danger-bg); color: var(--danger); }
.badge-source { background: var(--grad-soft); color: #b0124f; border: 1px solid rgba(176, 18, 79, 0.14); }
.badge-dup { background: var(--warn-bg); color: var(--warn); margin-left: 6px; }
.col-num { width: 44px; color: var(--ink-3); font-size: 12px; }

/* ---- Registrations table: two-line cells, sortable / movable headings ---- */
.table-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 12px 0 10px; }
.table-bar .result-count { margin: 0; }
#sync-status { margin: -4px 0 12px; }
#sync-status:empty { display: none; }
.table-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-pick { position: relative; display: inline-flex; align-items: center; }
.sort-pick svg { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.sort-pick select {
  min-height: 34px; max-width: 210px; padding: 6px 10px 6px 30px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.sort-pick select:hover:not(:disabled) { border-color: rgba(176, 18, 79, 0.35); }
.sort-pick select:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.sort-pick select:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 8px; font-size: 13px; gap: 6px; box-shadow: none; color: var(--ink-2); background: #fff; }
.btn.btn-sm.btn-brand { background: var(--grad); color: #fff; border-color: transparent; }
.btn.btn-sm.btn-brand:hover { background: var(--grad-hover); color: #fff; }

/* Long values take a second line instead of stretching the column; past
   two lines they end in an ellipsis (the full text is in the tooltip). */
.reg-table .cell-wrap {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  width: max-content; max-width: 200px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35;
}
.reg-table .cell-strong { font-weight: 600; color: var(--ink); }
.reg-table .w-name { max-width: 170px; }
.reg-table .w-job { max-width: 160px; }
.reg-table .w-company { max-width: 170px; }
.reg-table .w-industry { max-width: 140px; }
.reg-table .w-answer { max-width: 170px; }
.reg-table .w-email { max-width: 190px; }
.reg-table .w-notes { max-width: 190px; }
.reg-table .w-phone { max-width: 140px; overflow-wrap: normal; }
.reg-table .w-size { max-width: 110px; }
.reg-table .cell-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reg-table .cell-badges .badge { margin-left: 0; }
.reg-table tbody td { padding: 9px 10px; color: var(--ink-2); }
.reg-table thead th { padding-left: 10px; padding-right: 10px; }
.reg-table td.col-secondary { color: var(--ink-3); }
.reg-table .col-actions { width: 1%; }

.reg-table thead th[data-col] { padding: 0; user-select: none; -webkit-user-select: none; }
.reg-table .th-btn {
  display: flex; align-items: center; gap: 4px; width: 100%; padding: 11px 10px; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; text-align: left;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.reg-table .th-btn:hover { color: var(--info); background: rgba(176, 18, 79, 0.07); }
.reg-table .th-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.reg-table .sort-arrow { width: 10px; font-size: 12px; line-height: 1; color: var(--violet); }
.reg-table th.is-sorted { color: var(--info); }
.reg-table th.is-dragging { opacity: 0.45; }
.reg-table th.drop-before { box-shadow: inset 3px 0 0 var(--violet); }
.reg-table th.drop-after { box-shadow: inset -3px 0 0 var(--violet); }
body.col-dragging, body.col-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* Columns popover and the right-click menu on a heading */
.cols-menu { min-width: 290px; max-height: min(70vh, 560px); overflow-y: auto; }
.cols-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.cols-title .link-btn { text-transform: none; letter-spacing: 0; }
.cols-list { list-style: none; margin: 0; padding: 0; }
.cols-list li { display: flex; align-items: center; gap: 4px; }
.cols-list .menu-check { flex: 1; min-width: 0; padding: 6px 8px; }
.cols-list .menu-check small { display: block; font-size: 12px; color: var(--ink-3); }
.cols-list .icon-mini { width: 28px; height: 28px; flex-shrink: 0; font-size: 13px; }
.cols-hint { margin: 8px 8px 4px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.cols-formview { margin: 2px 4px 6px; padding: 8px 8px; border-radius: 8px; background: var(--grad-soft); }
.cols-fixed { display: block; padding: 5px 10px; font-size: 13px; color: var(--ink-2); }
.col-menu { position: fixed; z-index: 120; min-width: 210px; }
.menu-popover hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu-item:disabled { opacity: 0.4; cursor: default; background: none; color: var(--ink); }
.menu-item:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
@media (max-width: 640px) {
  .table-tools { margin-left: 0; width: 100%; }
  .sort-pick { flex: 1; } .sort-pick select { width: 100%; max-width: none; }
}
.col-check { width: 38px; }
.col-check input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--violet); }

/* ---------------------------------------------------------------- Toolbar & bulk */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 4px; }
.toolbar input[type="search"], .toolbar select, .toolbar-lite select {
  min-height: 42px; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; font-size: 14px; color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.toolbar input[type="search"] {
  flex: 1 1 240px; min-width: 190px; padding: 10px 14px 10px 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23636884' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center;
}
.toolbar select { padding: 9px 12px; cursor: pointer; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.toolbar label.checkbox-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); white-space: nowrap; cursor: pointer; }
.result-count { font-size: 13px; color: var(--ink-3); margin: 12px 0 14px; }
.bulk-bar {
  position: sticky; top: 76px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 14px;
  border-radius: var(--r-md); background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(176, 18, 79, 0.28);
  box-shadow: 0 14px 30px -18px rgba(66, 32, 130, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: rise-in 0.22s var(--ease-out) both;
}
.bulk-bar::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--grad-soft); pointer-events: none; }
.bulk-bar > * { position: relative; }
.bulk-bar .bulk-count { font-weight: 700; color: var(--info); }
.bulk-bar .bulk-spacer { flex: 1 1 auto; }
.bulk-bar .link-btn { color: var(--info); }
.bulk-bar .icon-btn { padding: 8px 14px; font-size: 13px; font-weight: 700; min-height: 36px; }
.bulk-bar .bulk-progress { font-size: 13px; color: var(--ink-3); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.pagination button { background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 14px; min-height: 36px; font-weight: 600; transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.pagination button:hover:not(:disabled) { border-color: var(--violet); }
.pagination button:active:not(:disabled) { transform: scale(0.97); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------------------------------------------------------- Tabs (segmented) */
.view-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; margin-bottom: 20px; width: fit-content; max-width: 100%;
  background: rgba(255, 255, 255, 0.62); border: 1px solid var(--glass-edge); border-radius: 12px; box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.view-tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 15px; border: none; border-radius: 12px;
  background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 700; isolation: isolate;
  transition: color var(--t-fast) var(--ease-std), transform var(--t-fast) var(--ease-out);
}
.view-tabs button svg { opacity: 0.8; }
.view-tabs button::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--grad); opacity: 0; transform: scale(0.92); box-shadow: 0 8px 18px -10px rgba(176, 18, 79, 0.8); transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-spring); }
.view-tabs button:hover { color: var(--ink); background: rgba(176, 18, 79, 0.07); }
.view-tabs button:active { transform: scale(0.97); }
.view-tabs button[aria-selected="true"] { color: #fff; background: transparent; }
.view-tabs button[aria-selected="true"]::before { opacity: 1; transform: scale(1); }
.view-tabs button[aria-selected="true"] svg { opacity: 1; }

/* Sub-view entrance: display none → block restarts this each time a tab opens */
#view-project > [id^="sub-"], #view-overview, #view-team, #view-project { animation: view-in 0.36s var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Check-in */
.ci-top {
  position: relative; overflow: hidden; margin-bottom: 16px; padding: 22px 24px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #2f1760 0%, #2f1760 55%, #3a4f00 100%); color: #fff; box-shadow: var(--shadow-lg);
}
.ci-top::after { content: ""; position: absolute; width: 280px; height: 280px; right: -60px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(74, 101, 0, 0.35), transparent 65%); pointer-events: none; }
.ci-summary { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.ci-big { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: 42px; font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ci-big small { font-family: var(--font-body); font-size: 16px; font-weight: 600; color: rgba(255, 255, 255, 0.7); }
.ci-meta { font-size: 14px; color: rgba(255, 255, 255, 0.75); }
.ci-progress { position: relative; height: 10px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; margin-top: 16px; overflow: hidden; }
.ci-progress > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4a6500, #4a6500); box-shadow: 0 0 16px rgba(74, 101, 0, 0.7); transition: width 0.6s var(--ease-out); }
.ci-offline { position: relative; margin-top: 12px; font-size: 13px; font-weight: 600; color: #5e4a72; background: rgba(94, 74, 114, 0.14); padding: 8px 12px; border-radius: 8px; }
.ci-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ci-tools input[type="search"] {
  flex: 1 1 260px; padding: 16px 18px 16px 46px; font-size: 17px; border: 2px solid var(--field-line); border-radius: 12px; background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23636884' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px center; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ci-tools input[type="search"]:focus { border-color: var(--violet); outline: none; box-shadow: var(--ring); }
.ci-tools .btn { padding: 14px 20px; font-size: 15px; border-radius: 12px; min-height: 54px; }
.btn-scan { background: var(--grad-ok); border-color: transparent; color: #fff; box-shadow: 0 12px 26px -12px rgba(58, 79, 0, 0.75); }
.btn-scan:hover { background: linear-gradient(115deg, #3a4f00, #3a4f00); color: #fff; border-color: transparent; }
.ci-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 10px 2px 10px; }
.ci-list { display: grid; gap: 10px; }
.ci-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-radius: var(--r-md);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); animation: rise-in 0.28s var(--ease-out) both;
}
.ci-card.is-in { background: linear-gradient(135deg, rgba(241, 250, 217, 0.95), rgba(241, 250, 217, 0.9)); border-color: rgba(58, 79, 0, 0.2); }
.ci-name { font-size: 16px; font-weight: 700; }
.ci-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.ci-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ci-btn {
  position: relative; overflow: hidden; border: none; border-radius: 12px; padding: 13px 22px; min-width: 128px; min-height: 48px;
  font-size: 15px; font-weight: 700; background: var(--grad-ok); color: #fff; box-shadow: 0 10px 22px -12px rgba(58, 79, 0, 0.8);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-med);
}
.ci-btn:hover { transform: translateY(-1px); }
.ci-btn:active { transform: scale(0.97); }
.ci-btn.undo { background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); font-weight: 600; min-width: 0; min-height: 36px; padding: 8px 14px; font-size: 13px; box-shadow: none; }
.ci-time { font-size: 13px; font-weight: 700; color: var(--ok); white-space: nowrap; }

/* ---------------------------------------------------------------- Modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(31, 22, 51, 0.42); backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2);
  animation: modal-backdrop-in 0.2s ease both;
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--glass-edge); box-shadow: 0 40px 90px -30px rgba(47, 23, 96, 0.55);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  animation: modal-panel-in 0.32s var(--ease-spring) both;
}
@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-panel-in { from { opacity: 0; transform: scale(0.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { position: relative; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad-bright); }
.modal-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin: 0; letter-spacing: 0; }
.modal-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.modal-close { width: 36px; height: 36px; border: none; border-radius: 8px; background: rgba(0, 0, 0, 0.05); font-size: 22px; line-height: 1; color: var(--ink-2); flex-shrink: 0; transition: background-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.modal-close:hover { background: rgba(0, 0, 0, 0.1); }
.modal-close:active { transform: scale(0.94); }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: rgba(229, 231, 235, 0.7); }
.modal-foot .icon-btn.approve { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); min-height: 42px; border-radius: 12px; font-size: 14px; }
.modal-foot .icon-btn.approve:hover { background: var(--grad-hover); }
.modal-form { padding: 20px 24px; display: grid; gap: 14px; overflow-y: auto; }
.modal-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.modal-form input[type="text"], .modal-form input[type="email"], .modal-form input[type="tel"], .modal-form input[type="date"], .modal-form input[type="password"], .modal-form input[type="number"],
.modal-form input[type="time"], .modal-form select, .modal-form textarea {
  padding: 11px 13px; min-height: 44px; border: 1px solid var(--field-line); border-radius: 12px; font-size: 15px; color: var(--ink); background: var(--field);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.modal-form .check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); }
.modal-form .check input { width: 17px; height: 17px; accent-color: var(--violet); }
.modal-form .form-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; display: grid; gap: 10px; }
.modal-form .form-section h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.muted-inline { text-transform: none; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }
.modal-form .modal-advanced summary, .fg .modal-advanced summary { list-style: none; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.modal-advanced summary::-webkit-details-marker { display: none; }
.modal-advanced summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--t-fast) var(--ease-out); }
.modal-advanced[open] summary::before { transform: rotate(45deg); }
.modal-advanced summary:hover { color: var(--info); }

.banner-field { display: grid; gap: 6px; }
.banner-preview-lg { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #e5e7eb; }
.banner-preview-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-remove { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 4px; border: none; background: rgba(31, 22, 51, 0.65); color: #fff; font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.banner-remove:hover { background: rgba(31, 22, 51, 0.85); }
.banner-drop-lg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; aspect-ratio: 16 / 9; border: 1.5px dashed var(--field-line); border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; text-align: center; background: var(--grad-soft); transition: border-color var(--t-fast), color var(--t-fast); }
.banner-drop-lg:hover { border-color: var(--violet); color: var(--info); }
.banner-hint { font-size: 12px; color: var(--ink-3); }
.banner-status { font-size: 12px; color: var(--ink-3); }
.banner-status.is-error { color: var(--danger); }
.link-row-wrap { display: block; }
.modal-form .link-row { display: flex; gap: 8px; margin-top: 4px; }
.modal-form .link-row input { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-3); background: #e5e7eb; }
.modal-form .link-row .btn { flex-shrink: 0; padding: 9px 14px; }
.modal-form .status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.modal-form .danger-details summary { color: var(--danger); font-weight: 700; }
.modal-form .danger-details[open] summary { margin-bottom: 10px; }
.modal-form .danger-zone { border: 1px solid rgba(176, 18, 79, 0.18); background: var(--danger-bg); border-radius: 12px; padding: 14px 16px; }
.modal-form .danger-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.modal-form .danger-copy { font-size: 13px; color: var(--ink); font-weight: 600; }
.modal-form .danger-copy small { display: block; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.modal-note { padding: 12px 14px; font-size: 13px; border-radius: 12px; line-height: 1.5; }
.modal-note.warn { background: var(--warn-bg); color: var(--warn); }
.modal-note.error { background: var(--danger-bg); color: var(--danger); }
.modal-note.info { background: var(--info-bg); color: var(--info); }
.modal-note ul { margin: 8px 0 0; padding-left: 18px; }
.dup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------------------------------------------------------------- Overview */
.overview-table td.name-cell { font-weight: 700; }
.overview-table td.name-cell a { color: var(--ink); text-decoration: none; }
.overview-table td.name-cell a:hover { color: var(--info); text-decoration: underline; }
.overview-table .forecast-cell { color: var(--info); font-weight: 700; }
.overview-table .rate-good { color: var(--ok); font-weight: 700; }
.overview-table .rate-bad { color: var(--danger); font-weight: 700; }

.ov-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 28px 30px; border-radius: var(--r-xl); overflow: hidden; color: #fff;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(176, 18, 79, 0.55), transparent 70%),
    radial-gradient(50% 80% at 0% 100%, rgba(176, 18, 79, 0.35), transparent 70%),
    linear-gradient(135deg, #2f1760 0%, #2f1760 60%, #2f1760 100%);
  box-shadow: 0 30px 60px -30px rgba(47, 23, 96, 0.7);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--t-slow) var(--ease-out);
}
.ov-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='32'%3E%3Cpath d='M0 16 28 0 56 16 28 32Z' fill='none' stroke='%23ffffff' stroke-opacity='.06'/%3E%3C/svg%3E"); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%); }
.ov-hero > * { position: relative; z-index: 1; }
.ov-hero .kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; background: var(--grad-bright); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ov-hero h2 { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; letter-spacing: 0; margin: 8px 0 10px; }
.ov-hero p { margin: 0 0 20px; color: rgba(255, 255, 255, 0.75); font-size: 14.5px; line-height: 1.6; max-width: 52ch; }
.ov-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ov-hero .btn:not(.btn-brand) { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: none; }
.ov-hero .btn:not(.btn-brand):hover { background: rgba(255, 255, 255, 0.18); }
.ov-hero .hero-art svg { width: 100%; max-height: 250px; display: block; }
.next-up { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 8px 12px 8px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); font-size: 13px; }
.next-up .cd { display: inline-flex; gap: 4px; }
.next-up .cd b { font-family: var(--font-display); font-size: 16px; min-width: 40px; text-align: center; padding: 4px 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); font-variant-numeric: tabular-nums; }
.next-up .cd small { display: block; font-size: 9.5px; font-weight: 600; opacity: 0.7; font-family: var(--font-body); }

.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 2px 12px; }
.section-title h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: 0; margin: 0; }
.section-title span { font-size: 13px; color: var(--ink-3); }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 20px; }
.event-card {
  position: relative; display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); cursor: pointer; text-align: left; width: 100%; font: inherit;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md); color: var(--ink);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out), border-color var(--t-fast);
  animation: rise-in 0.4s var(--ease-out) both;
}
.event-card:hover { --lift: -3px; box-shadow: var(--shadow-lg); border-color: rgba(176, 18, 79, 0.35); }
.event-card:active { --lift: 0px; }
.event-card .ec-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.event-card .ec-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.event-card .ec-date { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.event-card .ec-when { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 4px; background: var(--grad-soft); color: #b0124f; border: 1px solid rgba(176, 18, 79, 0.16); white-space: nowrap; }
.event-card .ec-when.past { background: #e5e7eb; color: var(--ink-3); border-color: transparent; }
.event-card .ec-when.today { background: var(--grad); color: #fff; border-color: transparent; }
.event-card .ec-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.event-card .ec-stats > span { display: block; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); }
.event-card .ec-name, .event-card .ec-date, .event-card .ec-stats span span { display: block; }
.event-card .ec-stats b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.event-card .ec-stats span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.event-card .ec-bar { height: 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.07); overflow: hidden; }
.event-card .ec-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-bright); transform-origin: left; animation: bar-grow 0.9s var(--ease-out) both; }
.event-card .ec-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); font-weight: 600; }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 16px; }
.empty-state img { width: 180px; height: auto; }
.empty-state h3 { font-family: var(--font-display); margin: 4px 0 0; font-size: 18px; }
.empty-state p { margin: 0; color: var(--ink-3); max-width: 44ch; }

/* Setup checklist (project view) */
.setup-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 20px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise-in 0.35s var(--ease-out) both; }
.setup-ring { position: relative; width: 62px; height: 62px; }
.setup-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.setup-ring circle { fill: none; stroke-width: 7; }
.setup-ring .track { stroke: rgba(0, 0, 0, 0.08); }
.setup-ring .fill { stroke-linecap: round; transition: stroke-dashoffset 0.8s var(--ease-out); }
.setup-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.setup-body h3 { font-family: var(--font-display); font-size: 16px; margin: 0 0 8px; }
.setup-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.setup-step { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 12px 6px 8px; border-radius: 4px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: #fff; color: var(--ink); transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.setup-step:hover { border-color: var(--violet); }
.setup-step:active { transform: scale(0.97); }
.setup-step i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line-2); font-style: normal; font-size: 12px; }
.setup-step.done { background: var(--ok-bg); border-color: rgba(58, 79, 0, 0.2); color: var(--ok); }
.setup-step.done i { border: none; background: var(--ok); color: #fff; }

/* ---------------------------------------------------------------- QR modal */
.qr-modal-panel { max-width: 360px; }
.qr-modal-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 22px; }
.qr-frame { display: inline-flex; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.qr-frame svg { display: block; width: 190px; height: 190px; max-width: 100%; }
.qr-security-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--ink-3); max-width: 270px; }
.qr-security-note svg { flex-shrink: 0; color: var(--warn); }

[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 2px;
}

/* ---------------------------------------------------------------- Kiosk mode */
.kiosk-exit-link { display: none; font-size: 12px; color: var(--info); margin-top: 4px; font-weight: 600; }
body.kiosk-mode .kiosk-exit-link { display: inline-block; }
body.kiosk-mode .sidebar, body.kiosk-mode .kiosk-hide, body.kiosk-mode #edit-project-btn, body.kiosk-mode #share-link-btn, body.kiosk-mode #sub-registrations { display: none !important; }
body.kiosk-mode .shell { display: block; }
body.kiosk-mode .content { padding: 14px 14px 40px; max-width: none; }
body.kiosk-mode #ci-header { position: sticky; top: 60px; z-index: 6; padding-top: 4px; margin: 0 -14px 12px; background: rgba(229, 231, 235, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
body.kiosk-mode #ci-header > .ci-top, body.kiosk-mode #ci-header > .ci-tools { margin-left: 14px; margin-right: 14px; }
body.kiosk-mode #ci-header > .ci-tools { padding-bottom: 12px; }
body.kiosk-mode .topbar { padding: 12px 16px; }
body.kiosk-mode .topbar h1 { font-size: 17px; }

/* ---------------------------------------------------------------- Charts (charts.js) */
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart-card { padding: 18px 20px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise-in 0.4s var(--ease-out) both; }
.chart-card h3 { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; margin: 0 0 2px; color: var(--ink); }
.chart-card .chart-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.chart-card.wide { grid-column: 1 / -1; }
.viz-root { position: relative; font-family: inherit; }
.viz-empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 30px 0; }
.viz-bar-row { display: flex; align-items: center; gap: 10px; height: 30px; }
.viz-bar-label { flex: 0 0 auto; width: 120px; font-size: 12px; color: var(--viz-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-bar-track { flex: 1; display: flex; align-items: center; height: 22px; padding: 3px 0; cursor: default; }
.viz-bar-fill { height: 16px; border-radius: 4px; width: 0; min-width: 0; transition: width 0.7s var(--ease-out); flex-shrink: 0; }
.viz-bar-value { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--viz-text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.viz-bar-row:hover .viz-bar-fill { filter: brightness(1.08); }
.viz-status-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; background: var(--viz-grid); gap: 2px; }
.viz-status-seg { height: 100%; width: 0; transition: width 0.7s var(--ease-out); position: relative; border-radius: 4px; min-width: 0; }
.viz-status-seg .seg-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; opacity: 0; transition: opacity 0.3s; }
.viz-status-seg:hover .seg-label { opacity: 1; }
.viz-status-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.viz-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--viz-text-secondary); }
.viz-legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.viz-trend-svg { width: 100%; height: auto; overflow: visible; }
.viz-trend-line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viz-trend-area { fill: var(--viz-1); opacity: 0.1; }
.viz-trend-dot { fill: var(--viz-1); stroke: var(--viz-surface); stroke-width: 2; }
.viz-trend-crosshair { stroke: var(--viz-baseline); stroke-width: 1; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.viz-trend-hit { fill: transparent; }
.viz-tooltip { position: absolute; pointer-events: none; background: #1f1633; color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, -100%) translateY(-8px); transition: opacity 0.12s; z-index: 10; white-space: nowrap; }
.viz-tooltip strong { font-size: 13px; }
.viz-tooltip .tt-label { color: rgba(255, 255, 255, 0.7); margin-top: 2px; display: block; }
.viz-tooltip.visible { opacity: 1; }

/* ================================================================ Roles */
body:not(.can-checkin) [data-perm="checkin"],
body:not(.can-write) [data-perm="write"],
body:not(.can-manage) [data-perm="manage"],
body:not(.can-team) [data-perm="team"] { display: none !important; }

/* ================================================================ Sidebar extras */
.nav-team-btn { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 42px; margin-top: 14px; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.04); color: var(--sidebar-text); font-size: 13px; font-weight: 600; transition: background-color var(--t-fast), color var(--t-fast); }
.nav-team-btn:hover, .nav-team-btn.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.whoami { margin-top: 12px; padding: 12px 10px 2px; border-top: 1px solid rgba(255, 255, 255, 0.07); display: flex; align-items: center; gap: 10px; }
.whoami::before { content: attr(data-initials); width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--grad); box-shadow: 0 6px 14px -6px rgba(176, 18, 79, 0.8); }
.whoami:empty::before { display: none; }
.whoami > span, .whoami-name, .whoami-role { display: block; }
.whoami-name { font-size: 13px; color: #fff; font-weight: 700; }
.whoami-role { font-size: 12px; color: #5f5870; }

/* Project chips */
.project-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 30px; border-radius: 4px; background: var(--glass-strong); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.chip-ok { background: var(--ok-bg); border-color: rgba(58, 79, 0, 0.2); color: var(--ok); }
.chip-ok::before { background: #4a6500; box-shadow: 0 0 0 3px rgba(74, 101, 0, 0.2); }
.chip-bad { background: var(--danger-bg); border-color: rgba(176, 18, 79, 0.2); color: var(--danger); }
.chip-bad::before { background: var(--danger); }
.chip-warn { background: var(--warn-bg); border-color: rgba(74, 58, 92, 0.18); color: var(--warn); }
.chip-warn::before { background: #5e4a72; }
.chip-link { color: var(--info); }
.chip-link::before { display: none; }
.chip-link:hover { border-color: var(--violet); }

/* Scanner overlay — futuristic dark */
.scanner-overlay { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; color: #fff; background: radial-gradient(60% 50% at 50% 30%, #2f1760 0%, #2f1760 70%); animation: modal-backdrop-in 0.2s ease both; }
.scanner-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); gap: 12px; }
.scanner-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.scanner-sub { font-size: 13px; color: rgba(255, 255, 255, 0.72); margin-top: 2px; }
.scanner-close { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; width: 44px; height: 44px; border-radius: 12px; font-size: 24px; line-height: 1; flex-shrink: 0; }
.scanner-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.scanner-stage video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; width: min(66vw, 300px); aspect-ratio: 1; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(47, 23, 96, 0.5); border: 2px solid rgba(255, 255, 255, 0.2); overflow: hidden; }
.scanner-frame::before { content: ""; position: absolute; inset: -2px; border-radius: 12px; padding: 3px; background: var(--grad-bright); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.9; }
.scanner-frame::after { content: ""; position: absolute; left: 8%; right: 8%; height: 2px; top: 10%; border-radius: 2px; background: linear-gradient(90deg, transparent, #b0124f, #422082, transparent); box-shadow: 0 0 14px 2px rgba(176, 18, 79, 0.7); animation: scan-line 2.2s ease-in-out infinite; }
@keyframes scan-line { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(min(52vw, 230px)); } }
.scanner-result { margin: 0 14px; padding: 16px 18px; border-radius: 12px; display: grid; gap: 4px; animation: modal-panel-in 0.28s var(--ease-spring) both; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6); }
.scanner-result strong { font-family: var(--font-display); font-size: 19px; }
.scanner-result span { font-size: 14px; opacity: 0.92; }
.scanner-result .ci-btn { margin-top: 8px; justify-self: start; background: rgba(255, 255, 255, 0.18); box-shadow: none; }
.scanner-result.is-ok { background: linear-gradient(135deg, #3a4f00, #3a4f00); }
.scanner-result.is-warn { background: linear-gradient(135deg, #5e4a72, #4a3a5c); }
.scanner-result.is-bad { background: linear-gradient(135deg, #b0124f, #b0124f); }
.scanner-bottom { padding: 14px 16px; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; }
.scanner-toggle { display: flex; gap: 9px; align-items: center; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.scanner-toggle input { width: 18px; height: 18px; accent-color: #4a6500; }
.scanner-manual { display: flex; gap: 8px; }
.scanner-manual input { flex: 1; min-width: 0; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 16px; font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.scanner-manual input::placeholder { color: rgba(255, 255, 255, 0.45); }
.scanner-manual input:focus { outline: none; border-color: #422082; box-shadow: 0 0 0 3px rgba(176, 18, 79, 0.35); }
.scanner-manual .btn { min-height: 48px; border-radius: 12px; }

/* Toast */
.toast { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 18px 12px 14px; border-radius: 12px; background: rgba(47, 23, 96, 0.92); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -18px rgba(47, 23, 96, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: toast-in 0.34s var(--ease-spring) both; }
.toast::before { content: ""; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: #4a6500 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center; }
.toast-bad { background: rgba(176, 18, 79, 0.95); }
.toast-bad::before { background-color: rgba(255, 255, 255, 0.2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E"); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(0.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* Modal variants, lists, meta */
.modal-panel.modal-wide { max-width: 780px; }
.file-drop { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; border: 1.5px dashed var(--field-line); border-radius: 12px; cursor: pointer; text-align: center; color: var(--ink-2); font-weight: 600; background: var(--grad-soft); transition: border-color var(--t-fast), color var(--t-fast); }
.file-drop:hover { border-color: var(--violet); color: var(--info); }
.list-rows { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.85); transition: background-color var(--t-med), border-color var(--t-med); }
.list-row.is-done { background: var(--ok-bg); border-color: rgba(58, 79, 0, 0.2); }
.meta-grid { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 12px; }
.meta-grid span:nth-child(odd) { font-weight: 700; }
.meta-grid code { font-size: 13px; color: var(--ink); letter-spacing: 0.06em; }
.ea-multi { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; display: grid; gap: 4px; }
.ea-multi legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }

/* Generic form grid used on the tabs */
.fg { display: grid; gap: 12px; }
.fg > h2 { margin-bottom: 2px; }
.fg label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fg input[type="text"], .fg input[type="email"], .fg input[type="tel"], .fg input[type="url"], .fg input[type="number"], .fg input[type="password"],
.fg input[type="datetime-local"], .fg select, .fg textarea, .inline-form input, .toolbar-lite select, .agenda-row input, .tpl-actions input {
  padding: 10px 12px; min-height: 42px; border: 1px solid var(--field-line); border-radius: 12px; font-size: 14px; color: var(--ink); background: var(--field); min-width: 0; width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.fg input:focus, .fg select:focus, .fg textarea:focus, .inline-form input:focus, .agenda-row input:focus, .tpl-actions input:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.fg textarea { resize: vertical; line-height: 1.55; }
.fg input[readonly], .fg textarea[readonly] { background: #e5e7eb; color: var(--ink-3); }
.fg > .btn, .fg > button.btn { justify-self: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 0; line-height: 1.55; }
.hint code, .note code { background: rgba(176, 18, 79, 0.08); color: #422082; padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 8px 0 0; font-weight: 700; }
.fg .check-inline, .check-inline { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check-inline input { width: 17px; height: 17px; accent-color: var(--violet); }
.empty-inline { font-size: 13px; color: var(--ink-3); padding: 14px 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, 0.5); }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row input { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-3); background: #e5e7eb; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 12px; min-height: 42px; }
.color-row { display: flex; gap: 8px; }
.color-row input[type="color"] { width: 46px; height: 42px; padding: 3px; border: 1px solid var(--field-line); border-radius: 12px; background: #fff; cursor: pointer; flex-shrink: 0; }

/* Switch */
.switch-row { display: flex !important; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row .switch-label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.switch-row small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; margin-top: 1px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch-ui { position: absolute; inset: 0; background: #f1eefa; border-radius: 4px; transition: background-color var(--t-med) var(--ease-std), box-shadow var(--t-med); }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(47, 23, 96, 0.25); transition: transform var(--t-med) var(--ease-spring); }
.switch input:checked + .switch-ui { background: #b0124f; background-image: var(--grad); box-shadow: 0 4px 12px -4px rgba(176, 18, 79, 0.6); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--violet); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: 0.5; }

/* Form & page tab */
.config-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.config-side { position: sticky; top: 86px; }
.preview-card { border-radius: var(--r-lg); overflow: hidden; background: #2f1760; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, 0.4); }
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.75); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.preview-head span { display: inline-flex; align-items: center; gap: 7px; }
.preview-head span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4a6500; box-shadow: 0 0 10px #4a6500; }
.preview-head .link-btn { color: #b0124f; text-decoration-color: rgba(241, 238, 250, 0.4); }
.preview-card iframe { display: block; width: 100%; height: 720px; border: 0; background: #2f1760; }
.builtin-table td, .builtin-table th { white-space: nowrap; }
.builtin-table input { width: 17px; height: 17px; accent-color: var(--violet); cursor: pointer; }
.q-list { display: grid; gap: 10px; }
.q-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; background: rgba(255, 255, 255, 0.8); animation: rise-in 0.25s var(--ease-out) both; }
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-head select { flex: 0 1 230px; }
.q-head > input[type="text"] { flex: 1 1 240px; }
.q-num { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 12px -6px rgba(176, 18, 79, 0.7); }
.q-tools { margin-left: auto; display: flex; gap: 4px; }
.icon-mini { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; width: 32px; height: 32px; font-size: 14px; line-height: 1; color: var(--ink-2); transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.icon-mini:hover:not(:disabled) { background: #f1eefa; color: var(--info); }
.icon-mini:active:not(:disabled) { transform: scale(0.94); }
.icon-mini.danger:hover { color: var(--danger); border-color: rgba(176, 18, 79, 0.3); background: var(--danger-bg); }
.icon-mini:disabled { opacity: 0.35; cursor: default; }
.agenda-list { display: grid; gap: 8px; }
.agenda-row { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; align-items: center; }
.share-qr { display: flex; gap: 16px; align-items: center; }
.share-qr .qr-frame svg { width: 120px; height: 120px; }
.save-bar { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 8px; padding: 10px 12px 10px 18px; border-radius: 12px; color: #fff; background: rgba(47, 23, 96, 0.92); box-shadow: 0 24px 48px -20px rgba(47, 23, 96, 0.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: toast-bar-in 0.3s var(--ease-spring) both; }
@keyframes toast-bar-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.save-bar span { margin-right: auto; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.save-bar span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5e4a72; box-shadow: 0 0 10px #5e4a72; }
.save-bar .btn:not(.btn-brand) { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.28); box-shadow: none; }

/* Messaging tab */
.tpl-list { display: grid; gap: 8px; }
.tpl-item { border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.85); transition: border-color var(--t-fast), box-shadow var(--t-med); }
.tpl-item[open] { border-color: rgba(176, 18, 79, 0.3); box-shadow: var(--shadow-md); }
.tpl-item > summary { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 52px; cursor: pointer; list-style: none; }
.tpl-item > summary::-webkit-details-marker { display: none; }
.tpl-title { font-size: 14px; font-weight: 700; flex: 1; }
.tpl-state { font-size: 12px; font-weight: 700; color: var(--ink-3); background: #e5e7eb; padding: 3px 10px; border-radius: 4px; }
.tpl-state.on { color: var(--ok); background: var(--ok-bg); }
.tpl-body { padding: 0 14px 14px; }
.tpl-actions { display: flex; gap: 8px; }
.tpl-actions input { flex: 1; }
.tpl-save { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.tpl-save span { font-size: 13px; color: var(--warn); font-weight: 700; }
.composer-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.composer-preview { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #e5e7eb; font-size: 14px; line-height: 1.6; animation: rise-in 0.22s var(--ease-out) both; }
.pv-subject { font-weight: 700; margin-bottom: 8px; }
.composer-actions { display: flex; justify-content: flex-end; }
.wa-queue { border: 1px solid rgba(58, 79, 0, 0.22); border-radius: 12px; padding: 14px; background: linear-gradient(135deg, rgba(241, 250, 217, 0.8), rgba(241, 250, 217, 0.6)); display: grid; gap: 10px; animation: rise-in 0.3s var(--ease-out) both; }
.wa-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wa-progress { font-size: 13px; color: var(--ink-3); font-weight: 700; margin-right: auto; font-variant-numeric: tabular-nums; }

/* Engagement + Team */
.engage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; align-items: start; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input[type="text"] { flex: 1; }
.inline-form input[type="number"] { width: 96px; flex: none; }
.qz-options { display: grid; gap: 6px; }
.qz-opt { display: flex !important; align-items: center; gap: 8px; }
.qz-opt input[type="radio"] { width: 19px; height: 19px; accent-color: var(--ok); flex-shrink: 0; min-height: 0; }
.qz-opt input[type="text"] { flex: 1; }
.q-head .pts { display: flex; align-items: center; gap: 6px; }
.q-head .pts input { width: 84px; }
.pz-result { position: relative; overflow: hidden; border-radius: 12px; padding: 20px; text-align: center; display: grid; gap: 8px; color: #fff; background: radial-gradient(70% 90% at 50% 0%, rgba(94, 74, 114, 0.5), transparent 70%), linear-gradient(135deg, #2f1760, #2f1760); animation: modal-panel-in 0.4s var(--ease-spring) both; }
.pz-prize { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #5e4a72; }
.pz-winner strong { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.pz-winner span { font-size: 13px; color: rgba(255, 255, 255, 0.75); }
.role-list { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 7px; font-size: 14px; line-height: 1.55; }
.scope-list { display: grid; gap: 6px; padding: 8px 0 0 26px; }
.act-summary { white-space: normal; min-width: 220px; color: var(--ink-3); }
.fb-comment { margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; line-height: 1.55; color: var(--ink); }
.toolbar-lite { display: flex; gap: 8px; margin-bottom: 12px; }

/* ================================================================ 2026-09-25 (round 2)
   Brand mark, sign-in modes, sidebar toggle, event groups + drag order,
   account menu, team passcodes, draw stage, feedback forms, CRM. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body:not(.can-crm) [data-perm="crm"] { display: none !important; }

/* Brand mark */
.gate-kicker { display: inline-flex; align-items: center; gap: 9px; }
.gate-kicker img { width: 24px; height: 24px; filter: drop-shadow(0 4px 12px rgba(176, 18, 79, 0.45)); }
.sidebar .brand .brand-tag img { width: 18px; height: 18px; flex-shrink: 0; filter: drop-shadow(0 3px 8px rgba(176, 18, 79, 0.4)); }

/* Sign-in modes */
.gate-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 6px 0 20px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); }
.gate .gate-modes button { width: auto; padding: 10px 8px; font-size: 14px; font-weight: 700; background: transparent; box-shadow: none; color: rgba(255, 255, 255, 0.7); border-radius: 8px; overflow: visible; transition: background-color var(--t-fast), color var(--t-fast); }
.gate .gate-modes button:hover { transform: none; box-shadow: none; color: #fff; }
.gate .gate-modes button[aria-selected="true"] { background: rgba(255, 255, 255, 0.15); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.gate .gate-modes button:focus-visible { outline: 2px solid #b0124f; outline-offset: 2px; }
.gate .gate-remember { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 13px; color: rgba(255, 255, 255, 0.75); margin: -2px 0 16px; cursor: pointer; }
.gate .gate-remember input { width: 18px; height: 18px; padding: 0; margin: 0; flex-shrink: 0; accent-color: #b0124f; }

/* Topbar + sidebar toggle */
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-toggle {
  flex-shrink: 0; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--glass-strong); color: var(--ink-2); box-shadow: var(--shadow-sm);
  transition: color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.icon-toggle:hover { color: var(--ink); border-color: rgba(176, 18, 79, 0.4); box-shadow: var(--shadow-md); }
.icon-toggle:active { transform: scale(0.94); }
.icon-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-toggle .chev { transition: transform var(--t-med) var(--ease-out); transform-box: fill-box; transform-origin: center; }
body.sidebar-hidden .icon-toggle .chev { transform: scaleX(-1); }
body.kiosk-mode .icon-toggle { display: none; }
.sidebar { transition: margin-left var(--t-slow) var(--ease-out), visibility 0s linear 0s; }
body.sidebar-hidden .sidebar { margin-left: -256px; visibility: hidden; transition: margin-left var(--t-slow) var(--ease-out), visibility 0s linear var(--t-slow); }

/* Sidebar groups */
.sidebar .nav-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .nav-item { justify-content: flex-start; }
.sidebar .nav-item .count { margin-left: auto; }
.sidebar .nav-item:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(241, 238, 250, 0.8); }
.sidebar .nav-section { display: flex; align-items: center; gap: 8px; }
.sidebar .nav-section b { font-size: 12px; font-weight: 700; color: #422082; background: rgba(255, 255, 255, 0.07); padding: 1px 7px; border-radius: 4px; letter-spacing: 0; }
.sidebar .nav-section-toggle { width: calc(100% - 24px); border: none; background: none; padding: 4px 0; cursor: pointer; font-family: inherit; text-align: left; border-radius: 6px; }
.sidebar .nav-section-toggle svg { margin-left: auto; transition: transform var(--t-med) var(--ease-out); }
.sidebar .nav-section-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.sidebar .nav-section-toggle:hover { color: #fff; }
.sidebar .nav-section-toggle:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(241, 238, 250, 0.8); }
.sidebar .nav-item.is-done:not(.active) { color: #5f5870; }
.sidebar .nav-item.is-done:not(.active) .count { opacity: 0.7; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4a6500; box-shadow: 0 0 0 3px rgba(74, 101, 0, 0.22); flex-shrink: 0; }
.nav-filter-note { font-size: 12px; color: #5f5870; margin: 10px 12px; line-height: 1.5; }
.sidebar .nav-filter-note .link-btn { color: #b0124f; font-size: 12px; text-decoration-color: rgba(241, 238, 250, 0.4); }
.nav-team-btn-tight { margin-top: 6px; }

/* Drag to reorder */
.drag-handle { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 28px; margin: -4px 2px -4px -6px; padding: 0; border: none; border-radius: 8px; background: transparent; color: inherit; opacity: 0.55; cursor: grab; touch-action: none; transition: opacity var(--t-fast), background-color var(--t-fast); }
.drag-handle:hover, .drag-handle:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.1); outline: none; }
.drag-handle:focus-visible { box-shadow: 0 0 0 2px rgba(241, 238, 250, 0.9); }
.drag-handle:active { cursor: grabbing; }
.is-dragging { position: fixed !important; z-index: 300; pointer-events: none; margin: 0 !important; opacity: 0.97; animation: none !important; box-shadow: 0 30px 60px -18px rgba(0, 0, 0, 0.55) !important; }
.sidebar .nav-item.is-dragging { background: #2f1760; color: #fff; }
.drag-placeholder { border: 2px dashed rgba(176, 18, 79, 0.55); border-radius: 12px; background: rgba(176, 18, 79, 0.07); margin-bottom: 3px; }
.drag-placeholder.is-card { border-radius: var(--r-lg); margin: 0; }

/* Overview: sort/filter + grouped cards */
.events-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 16px; }
.events-head .section-title { margin-bottom: 0; }
.events-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-select { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tool-select select { border: none; background: transparent; font-weight: 600; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink); padding: 6px 4px; min-height: 34px; cursor: pointer; border-radius: 8px; }
.tool-select select:focus-visible { outline: none; box-shadow: var(--ring); }
.tool-range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.tool-range input { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--field-line); background: var(--field); font-size: 13px; min-height: 40px; }
.ev-group { margin-bottom: 24px; }
.ev-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 2px 12px; }
.ev-group-head h3 { margin: 0; font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.ev-count { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 4px; background: var(--grad-soft); color: #b0124f; border: 1px solid rgba(176, 18, 79, 0.16); }
.ev-group-note { font-size: 12px; color: var(--ink-3); }
.ev-group-done { padding-top: 20px; border-top: 1px dashed var(--line-2); }
.ev-group-done .ev-count { background: var(--ok-bg); color: var(--ok); border-color: rgba(58, 79, 0, 0.2); }
.ev-group .event-grid { margin-bottom: 0; }
.ev-hidden-note { font-size: 13px; color: var(--ink-3); margin: -10px 2px 22px; }
.event-card .ec-hit { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; padding: 0; border: none; background: transparent; border-radius: inherit; cursor: pointer; }
.event-card .ec-hit:focus-visible { outline: none; box-shadow: var(--ring); }
.event-card > span { position: relative; z-index: 1; pointer-events: none; }
.event-card .ec-top-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.event-card .drag-handle { pointer-events: auto; position: relative; z-index: 2; color: var(--ink-3); margin: -4px 0; }
.event-card .drag-handle:hover, .event-card .drag-handle:focus-visible { background: rgba(0, 0, 0, 0.06); }
.event-card .ec-when.done { display: inline-flex; align-items: center; gap: 4px; background: var(--ok-bg); color: var(--ok); border-color: rgba(58, 79, 0, 0.2); }
.event-card .ec-when.nodate { background: #e5e7eb; color: var(--ink-3); border-color: transparent; }
.event-card.is-done { background: rgba(255, 255, 255, 0.55); }
.event-card.is-done .ec-name { color: var(--ink-2); }
.event-card.is-done .ec-stats > span { background: rgba(255, 255, 255, 0.5); }
.event-card.is-done .ec-bar i { background: linear-gradient(90deg, #4a6500, #3a4f00); }
.event-card.is-live { border-color: rgba(74, 101, 0, 0.45); box-shadow: 0 0 0 1px rgba(74, 101, 0, 0.2), var(--shadow-md); }

/* Account menu */
.whoami { position: relative; }
.whoami-btn { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; text-align: left; padding: 6px 8px; margin: -6px -4px -6px -8px; border: none; border-radius: 8px; background: none; color: inherit; cursor: pointer; transition: background-color var(--t-fast); }
.whoami-btn:hover, .whoami-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.07); }
.whoami-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(241, 238, 250, 0.8); }
.whoami-btn .whoami-name, .whoami-btn .whoami-role { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami-btn svg { grid-column: 2; grid-row: 1 / span 2; color: #5f5870; }
.whoami-menu { top: auto; bottom: calc(100% + 10px); left: 0; right: 0; min-width: 0; transform-origin: bottom left; }
.whoami-menu button { display: block; width: 100%; text-align: left; min-height: 40px; padding: 9px 10px; border: none; border-radius: 8px; background: none; font-size: 14px; font-weight: 600; color: var(--ink); }
.whoami-menu button:hover { background: rgba(176, 18, 79, 0.08); color: var(--info); }
.menu-note { font-size: 13px; color: var(--ink-3); margin: 4px 8px 8px; line-height: 1.5; }

/* Team: passcodes */
.pass-row { display: flex; gap: 8px; align-items: center; }
.pass-row input { flex: 1; min-width: 0; }
.signin-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-mini { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: #f1eefa; color: var(--info); }
.tag-mini.muted { background: #e5e7eb; color: var(--ink-3); }


/* Draw stage: full screen shows only the prize, the reel and the Draw
   button (settings hide); spotlights sweep while the reel spins; the
   winner's name pops in letter by letter. */
.draw-stage:fullscreen .ds-settings, .draw-stage:fullscreen .ds-hint, .draw-stage:fullscreen .ds-pool-note { display: none; }
.draw-stage:fullscreen .ds-prize { border-bottom-color: transparent; pointer-events: none; }
.draw-stage:fullscreen .ds-prize:placeholder-shown { visibility: hidden; }
.ds-settings { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.draw-stage .hype-picker { min-height: 42px; }
.draw-stage::after { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: 0; z-index: 0;
  background: conic-gradient(from 0deg at 50% 110%, transparent 0 40deg, rgba(94, 74, 114, 0.16) 48deg, transparent 58deg 150deg, rgba(241, 238, 250, 0.16) 160deg, transparent 170deg 360deg);
  transition: opacity 0.4s ease; }
.draw-stage.is-spinning::after { opacity: 1; animation: ds-beams 2.4s linear infinite; }
@keyframes ds-beams { to { rotate: 360deg; } }
.ds-name.is-winner strong i { display: inline-block; font-style: normal; animation: ds-letter 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  /* each letter is its own box, so it needs the gradient text itself */
  background: linear-gradient(115deg, #5e4a72, #b0124f 50%, #b0124f); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes ds-letter { from { opacity: 0; transform: translateY(40%) scale(0.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
.draw-stage.has-winner .ds-window { box-shadow: 0 0 0 2px rgba(94, 74, 114, 0.6), 0 0 80px 10px rgba(176, 18, 79, 0.35); }
@media (prefers-reduced-motion: reduce) { .draw-stage.is-spinning::after { animation: none; } .ds-name.is-winner strong i { animation: none; } }

/* ---------------------------------------------------------------- Draw stage */
.draw-stage {
  position: fixed; inset: 0; z-index: 400; color: #fff; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto;
  background: radial-gradient(60% 55% at 50% 38%, rgba(176, 18, 79, 0.35), transparent 70%), radial-gradient(40% 40% at 12% 90%, rgba(176, 18, 79, 0.28), transparent 70%), radial-gradient(40% 40% at 88% 10%, rgba(94, 74, 114, 0.25), transparent 70%), #2f1760;
  animation: fade-only 0.25s ease both;
}
.draw-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='32'%3E%3Cpath d='M0 16 28 0 56 16 28 32Z' fill='none' stroke='%23ffffff' stroke-opacity='.06'/%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 85%); mask-image: radial-gradient(80% 70% at 50% 45%, #000 30%, transparent 85%); }
.draw-stage > * { position: relative; z-index: 1; }
.ds-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: clamp(14px, 2.4vh, 28px) clamp(16px, 3vw, 40px); }
.ds-kicker { display: flex; align-items: center; gap: 10px; font-size: clamp(12px, 1.1vw, 15px); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.ds-kicker img { width: 26px; height: 26px; }
.ds-tools { display: flex; gap: 8px; }
.ds-tool { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.07); color: #fff; font-weight: 700; font-size: 13px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background-color var(--t-fast); }
.ds-tool:hover { background: rgba(255, 255, 255, 0.14); }
.ds-tool:focus-visible, .ds-draw:focus-visible, .ds-prize:focus-visible, .ds-controls select:focus-visible, .ds-controls input:focus-visible { outline: 2px solid #b0124f; outline-offset: 3px; }
.ds-center { display: grid; align-content: center; justify-items: center; gap: clamp(14px, 3vh, 34px); padding: 0 clamp(16px, 4vw, 60px); text-align: center; min-height: 0; }
.ds-prize { width: min(900px, 100%); text-align: center; background: transparent; border: none; border-bottom: 1px dashed rgba(255, 255, 255, 0.2); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3.4vw, 52px); letter-spacing: 0; padding: 4px 8px; }
.ds-prize::placeholder { color: rgba(255, 255, 255, 0.35); }
.ds-window { position: relative; width: min(1100px, 100%); height: clamp(120px, 24vh, 240px); border-radius: 32px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)); border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 40px 90px -40px rgba(0, 0, 0, 0.8); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.ds-window::before, .ds-window::after { content: ""; position: absolute; left: 0; right: 0; height: 28%; z-index: 2; pointer-events: none; }
.ds-window::before { top: 0; background: linear-gradient(180deg, rgba(47, 23, 96, 0.9), transparent); }
.ds-window::after { bottom: 0; background: linear-gradient(0deg, rgba(47, 23, 96, 0.9), transparent); }
.ds-rim { position: absolute; inset: -1px; border-radius: inherit; padding: 2px; z-index: 3; pointer-events: none; background: linear-gradient(115deg, #5e4a72, #b0124f 50%, #422082); opacity: 0; transition: opacity 0.3s ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.draw-stage.is-spinning .ds-rim, .draw-stage.has-winner .ds-rim { opacity: 1; }
.ds-name { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; padding: 0 24px; }
.ds-name strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 6.2vw, 96px); line-height: 1.02; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-name span { font-size: clamp(14px, 1.6vw, 24px); color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.ds-name.is-idle strong { font-size: clamp(22px, 3.2vw, 44px); color: rgba(255, 255, 255, 0.55); font-weight: 700; }
.ds-name.is-winner strong { background: linear-gradient(115deg, #5e4a72, #b0124f 50%, #b0124f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 30px rgba(176, 18, 79, 0.45)); }
.draw-stage.has-winner .ds-window { animation: ds-pop 0.6s var(--ease-spring) both; }
@keyframes ds-pop { 0% { scale: 1; } 40% { scale: 1.035; } 100% { scale: 1; } }
.ds-pool-note { margin-top: calc(-1 * clamp(6px, 1.6vh, 20px)); font-size: clamp(13px, 1.2vw, 16px); font-weight: 600; color: rgba(255, 255, 255, 0.6); }
.ds-winner-label { font-size: clamp(12px, 1.2vw, 16px); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #5e4a72; min-height: 1.4em; }
.ds-controls { display: flex; align-items: flex-end; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ds-controls label { display: grid; gap: 6px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.ds-controls select, .ds-controls input { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); color: #fff; font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.ds-controls select option { color: #1f1633; }
.ds-controls input[type="number"] { width: 96px; }
.ds-draw { position: relative; overflow: hidden; min-height: 64px; padding: 0 clamp(28px, 4vw, 54px); border: none; border-radius: 12px; font-family: var(--font-display); font-size: clamp(17px, 1.8vw, 22px); font-weight: 700; color: #fff; background: var(--grad); box-shadow: 0 22px 50px -18px rgba(176, 18, 79, 0.8); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out), opacity var(--t-fast); }
.ds-draw:hover { transform: translateY(-2px); box-shadow: 0 28px 60px -18px rgba(176, 18, 79, 0.9); }
.ds-draw:active { transform: scale(0.97); }
.ds-draw:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.ds-draw::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.4) 50%, transparent 80%); animation: ds-sheen 2.8s ease-in-out infinite; }
@keyframes ds-sheen { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.ds-msg { min-height: 1.5em; font-size: 14px; color: #fee8f0; font-weight: 600; }
.ds-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: clamp(12px, 2vh, 24px) clamp(16px, 3vw, 40px); }
.ds-winners { display: flex; gap: 8px; flex-wrap: wrap; max-width: 75%; }
.ds-winners .w { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 4px; font-size: 14px; font-weight: 700; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); animation: rise-in 0.4s var(--ease-out) both; }
.ds-winners .w small { color: rgba(255, 255, 255, 0.6); font-weight: 600; }
.ds-hint { font-size: 13px; color: rgba(255, 255, 255, 0.55); }
.ds-hint kbd { font-family: var(--font-mono); font-size: 12px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); }
.ds-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.draw-stage:fullscreen { width: 100vw; height: 100vh; }
.pz-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Feedback forms */
.fb-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.fb-forms { display: grid; gap: 10px; position: sticky; top: 86px; }
.fb-form-card { position: relative; display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; text-align: left; width: 100%; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-sm); transition: border-color var(--t-fast), box-shadow var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.fb-form-card:hover { border-color: rgba(176, 18, 79, 0.35); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.fb-form-card[aria-current="true"] { border-color: transparent; box-shadow: 0 0 0 2px #422082, var(--shadow-md); background: #fff; }
.fb-form-card strong { font-family: var(--font-display); font-size: 14.5px; line-height: 1.3; }
.fb-form-card .meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.fb-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.05); margin-bottom: 16px; flex-wrap: wrap; }
.fb-seg button { min-height: 38px; padding: 8px 16px; border: none; border-radius: 8px; background: none; font-weight: 700; font-size: 14px; color: var(--ink-3); transition: background-color var(--t-fast), color var(--t-fast); }
.fb-seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.fb-seg button:focus-visible { outline: none; box-shadow: var(--ring); }
.fbq { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: rgba(255, 255, 255, 0.85); animation: rise-in 0.25s var(--ease-out) both; }
.fbq-head { display: grid; grid-template-columns: auto minmax(0, 1fr) 170px auto; gap: 10px; align-items: center; }
.fbq-num { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--grad); }
.fbq-tools { display: flex; gap: 4px; }
.fbq-opts { display: grid; gap: 6px; }
.fbq-opt { display: flex; gap: 6px; align-items: center; }
.fbq-opt input { flex: 1; }
.fbq-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.fbq-row label.inline { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.fbq-preview { font-size: 12px; color: var(--ink-3); }
.fb-add { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-add .btn { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.fb-share { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.fb-share .qr-frame svg { width: 220px; height: 220px; }
.fb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fb-stat { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); }
.fb-stat b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fb-stat span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.fb-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.fb-sum-card { padding: 16px; border-radius: 12px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.fb-sum-card h4 { margin: 0; font-size: 14px; line-height: 1.4; }
.fb-sum-card .big { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: 0; }
.fb-sum-card .big small { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.fb-bar { display: grid; grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13px; }
.fb-bar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.fb-bar .t { height: 10px; border-radius: 4px; background: rgba(0, 0, 0, 0.07); overflow: hidden; }
.fb-bar .t i { display: block; height: 100%; border-radius: inherit; background: var(--grad-bright); transform-origin: left; animation: bar-grow 0.8s var(--ease-out) both; }
.fb-bar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; }
.fb-texts { display: grid; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 4px; }
.fb-texts blockquote { margin: 0; padding: 10px 12px; border-radius: 12px; background: #e5e7eb; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.fb-texts blockquote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--ink-3); }
.fb-nps { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; font-weight: 700; }
.fb-nps span { padding: 3px 9px; border-radius: 4px; }
.fb-nps .pro { background: var(--ok-bg); color: var(--ok); }
.fb-nps .pas { background: #e5e7eb; color: var(--ink-3); }
.fb-nps .det { background: var(--danger-bg); color: var(--danger); }
.fb-resp td { white-space: normal; vertical-align: top; }
.fb-resp td.ans { min-width: 240px; max-width: 420px; font-size: 13px; color: var(--ink-2); }
.resp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.resp-head h2 { margin: 0; }
.claim-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.claim-progress strong { color: var(--ok); font-size: 15px; }
.claim-bar { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.claim-bar i { display: block; height: 100%; border-radius: 4px; background: var(--ok); transition: width .3s ease; }
.resp-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 12px; }
.resp-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--ink-3); }
.resp-search:focus-within { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.resp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 14.5px; color: var(--text); padding: 10px 0; }
.claim-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #e5e7eb; }
.claim-seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 8px 12px; min-height: 38px; border-radius: 8px; cursor: pointer; }
.claim-seg button b { font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.claim-seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(47, 23, 96, .12); }
.fb-resp td.claim-cell { width: 1%; white-space: nowrap; }
.fb-resp td:nth-child(2) { min-width: 230px; }
.claim-box { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.claim-box input { width: 20px; height: 20px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.claim-box:hover { border-color: var(--ok); }
.claim-tag { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.fb-resp tr.is-claimed td { background: var(--ok-bg); }
.fb-resp tr.is-claimed td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.fb-resp tr.is-claimed .claim-box { background: var(--ok); border-color: var(--ok); color: #fff; }
.fb-resp tr.is-claimed .claim-box input { accent-color: #fff; }
.fb-resp tr.is-claimed .claim-tag { color: var(--ok); }
.intro-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.intro-head label { font-weight: 600; }
.intro-tools { display: inline-flex; gap: 6px; }
.intro-tools .btn { min-width: 34px; justify-content: center; }
.fbq-fmt { display: inline-flex; gap: 4px; }
.fbq-fmt .btn { min-width: 30px; justify-content: center; padding-inline: 8px; }
/* Link bar under a feedback-form field (replaces the browser's link dialog) */
.fb-linkbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); animation: fb-linkbar-in 0.14s ease-out; }
.fb-linkbar:focus-within { border-color: var(--ink-3); }
.fb-linkbar-l { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.fb-linkbar input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; outline: none; padding: 5px 2px; font-size: 13px; }
.fb-linkbar input:focus { box-shadow: none; outline: none; }
@keyframes fb-linkbar-in { from { opacity: 0; } to { opacity: 1; } }
/* Pictures on a feedback form (banner, example per question) */
.fb-img { display: inline-flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fb-img img { display: block; max-width: 260px; max-height: 150px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; object-fit: contain; }
.fb-img-actions { display: inline-flex; align-items: center; gap: 12px; }
.fb-form-img { padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, 0.6); }
.fbq-img { display: grid; gap: 6px; justify-items: start; }
.fbq-img small { font-size: 12px; color: var(--ink-3); }
.fbq-addimg { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; text-decoration: none; }
.fbq-addimg:hover { text-decoration: underline; }
/* Email quota (Resend) on the Messaging tab */
.quota-strip { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); display: grid; gap: 10px; }
.quota-strip[hidden] { display: none; }
.quota-strip.is-warn { border-color: rgba(94, 74, 114, 0.35); background: var(--warn-bg); }
.quota-strip.is-critical, .quota-strip.is-over { border-color: rgba(176, 18, 79, 0.35); background: var(--danger-bg); }
.quota-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.quota-head span { color: var(--ink-3); font-size: 13px; }
.quota-head .link-btn { margin-left: auto; }
.quota-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; }
.quota-line { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.quota-line span { color: var(--ink-3); min-width: 78px; }
.quota-line em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--ink-2); }
.quota-bar { height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.1); overflow: hidden; }
.quota-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width 0.4s var(--ease-out); }
.quota-bar i.warn { background: var(--warn); }
.quota-bar i.bad { background: var(--danger); }
.quota-strip .hint { margin: 0; }
/* Files attached to a feedback form */
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 30px; padding: 4px 10px; margin: 2px 4px 2px 0; border: 1px solid rgba(176, 18, 79, 0.28); border-radius: 4px; background: #f1eefa; color: var(--info); font-size: 12px; font-weight: 600; transition: background-color var(--t-fast), border-color var(--t-fast); }
.file-chip:hover { background: var(--info-bg); border-color: var(--violet); }
.file-chip svg { flex-shrink: 0; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.file-chip small { flex-shrink: 0; font-weight: 500; color: var(--ink-3); }
.fb-files { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.fb-file-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 8px 10px; border-radius: 12px; background: #e5e7eb; font-size: 13px; }
.fb-file-row .who { display: grid; min-width: 0; }
.fb-file-row .who small { font-size: 12px; color: var(--ink-3); }
.fb-file-row .chips { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.ans-files { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.file-view { display: grid; place-items: center; min-height: 200px; border-radius: 12px; background: #f1eefa; overflow: hidden; }
.file-view img { display: block; max-width: 100%; max-height: 68vh; }
.file-view iframe { display: block; width: 100%; height: 68vh; border: 0; background: #fff; }
.present-qr { position: fixed; inset: 0; z-index: 400; display: grid; place-content: center; justify-items: center; gap: clamp(12px, 3vh, 28px); padding: 24px; text-align: center; color: #fff;
  background: radial-gradient(60% 55% at 50% 40%, rgba(176, 18, 79, 0.35), transparent 70%), radial-gradient(40% 40% at 10% 90%, rgba(176, 18, 79, 0.25), transparent 70%), #2f1760; animation: fade-only 0.25s ease both; }
.present-qr .pq-kicker { font-size: clamp(13px, 1.3vw, 18px); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #5e4a72; }
.present-qr h2 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 64px); letter-spacing: 0; line-height: 1.05; max-width: 20ch; }
.present-qr .pq-code { padding: clamp(14px, 2vw, 26px); border-radius: 32px; background: #fff; box-shadow: 0 50px 120px -40px rgba(176, 18, 79, 0.6); }
.present-qr .pq-code svg { display: block; width: min(52vh, 70vw); height: min(52vh, 70vw); }
.present-qr .pq-url { font-family: var(--font-mono); font-size: clamp(14px, 1.6vw, 22px); color: rgba(255, 255, 255, 0.8); }
.present-qr .ds-tools { position: absolute; top: 20px; right: 20px; }

/* ---------------------------------------------------------------- CRM */
.crm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; margin-bottom: 18px; }
.crm-stat { position: relative; overflow: hidden; padding: 16px 18px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md); text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: box-shadow var(--t-med) var(--ease-out), transform var(--t-fast) var(--ease-out), border-color var(--t-fast); }
.crm-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.crm-stat[aria-pressed="true"] { border-color: transparent; box-shadow: 0 0 0 2px #422082, var(--shadow-md); }
.crm-stat b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.crm-stat span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.crm-stat i { position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; opacity: 0.18; background: var(--grad-bright); }
.crm-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.crm-toolbar input[type="search"], .crm-toolbar select { min-height: 42px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--field); font-size: 14px; }
.crm-toolbar input[type="search"] { flex: 1 1 240px; min-width: 200px; }
.crm-toolbar select { max-width: 220px; }
.crm-table td { vertical-align: middle; }
.crm-table .who { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.crm-avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--grad); box-shadow: 0 6px 14px -8px rgba(176, 18, 79, 0.8); }
.crm-avatar.prospect { background: var(--grad-cool); }
.crm-avatar.lg { width: 56px; height: 56px; border-radius: 12px; font-size: 18px; }
.crm-table .who strong { display: block; }
.crm-table .who small { display: block; color: var(--ink-3); font-size: 12px; }
.crm-name-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.crm-name-btn:hover { color: var(--info); text-decoration: underline; text-underline-offset: 3px; }
.type-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.type-badge.attendee { background: var(--ok-bg); color: var(--ok); }
.type-badge.registrant { background: var(--warn-bg); color: var(--warn); }
.type-badge.prospect { background: var(--info-bg); color: var(--info); }
.tag-list { display: flex; gap: 4px; flex-wrap: wrap; max-width: 260px; }
.crm-drawer-back { position: fixed; inset: 0; z-index: 250; background: rgba(31, 22, 51, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade-only 0.2s ease both; }
.crm-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 251; width: min(560px, 100vw); overflow-y: auto; background: var(--ground); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.5); animation: drawer-in 0.32s var(--ease-out) both; display: grid; grid-template-rows: auto 1fr auto; }
@keyframes drawer-in { from { translate: 40px 0; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.crm-drawer-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 14px; align-items: center; padding: 20px 22px; background: rgba(229, 231, 235, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.crm-drawer-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; }
.crm-drawer-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.crm-drawer-head .modal-close { margin-left: auto; }
.crm-drawer-body { padding: 18px 22px 24px; display: grid; gap: 16px; align-content: start; }
.crm-drawer-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: rgba(229, 231, 235, 0.94); border-top: 1px solid var(--line); }
.crm-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline { display: grid; gap: 0; }
.tl-item { position: relative; display: grid; gap: 4px; padding: 0 0 16px 22px; border-left: 2px solid rgba(176, 18, 79, 0.2); margin-left: 6px; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #422082; }
.tl-item.attended::before { background: #4a6500; border-color: #3a4f00; }
.tl-item strong { font-size: 14px; }
.tl-item small { font-size: 12px; color: var(--ink-3); }
.invite-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.invite-list .list-row { padding: 8px 12px; }

/* ================================================================ Round 3 (2026-09-25): settings,
   email design + preview, delivery problems, UTM cards, Google Sheet link, CRM companies. */
.set-card { max-width: 980px; }
.set-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-head h2 { margin-bottom: 4px; }
.set-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 700; background: #e5e7eb; color: var(--ink-3); white-space: nowrap; }
.set-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.set-status.on { background: var(--ok-bg); color: var(--ok); }
.set-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.set-steps a { font-weight: 700; }
.set-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-test { display: grid; gap: 8px; padding: 14px 16px; border-radius: 12px; background: rgba(176, 18, 79, 0.05); border: 1px solid rgba(176, 18, 79, 0.14); }
.set-test-row { display: flex; gap: 8px; flex-wrap: wrap; }
.set-test-row select, .set-test-row input { flex: 1 1 200px; min-height: 42px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--field); font-size: 14px; }
.set-domain { display: grid; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.8); margin-top: 6px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.dns-val { white-space: normal; word-break: break-all; max-width: 380px; }
.stat-card.warn .stat-value { color: var(--danger); }

/* Messaging: email design + live preview */
.msg-design-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 20px; align-items: start; }
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.design-grid > .fg { align-content: start; gap: 10px; }
.design-upload { display: grid; gap: 8px; justify-items: start; padding: 10px 0 4px 26px; }
.design-upload img { width: 100%; max-width: 280px; border-radius: 8px; border: 1px solid var(--line); }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] { width: 46px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--field-line); background: #fff; cursor: pointer; }
.email-preview-panel { position: sticky; top: 86px; padding: 14px; }
.preview-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.preview-bar small { display: grid; gap: 1px; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.preview-bar select { max-width: 200px; min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--field-line); background: #fff; font-size: 13px; }
.email-frame { display: block; width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 12px; background: #e5e7eb; }
.save-dock { position: sticky; bottom: 14px; z-index: 15; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: -6px 0 20px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.72); border: 1px solid var(--glass-edge); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow-md); }
.save-dock span { font-size: 13px; color: var(--warn); font-weight: 700; }
.save-dock.is-dirty { box-shadow: 0 0 0 2px rgba(94, 74, 114, 0.5), var(--shadow-lg); }
.chip-btn { min-height: 34px; padding: 6px 12px; border-radius: 4px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chip-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.problems-panel { border-left: 4px solid var(--danger); }
.wa-api-box { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: rgba(74, 101, 0, 0.06); border: 1px solid rgba(58, 79, 0, 0.18); }
.wa-body { margin: 0; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: #fff; border: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.wa-body mark { background: #5e4a72; border-radius: 4px; padding: 0 3px; }

/* UTM / channel cards */
.utm-card { padding: 18px 20px; margin-bottom: 20px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: rise-in 0.35s var(--ease-out) both; }
.utm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.utm-head h2 { font-family: var(--font-display); font-size: 16px; margin: 0; }
.utm-head p { margin: 3px 0 0; font-size: 13px; color: var(--ink-3); }
.utm-rows { display: grid; gap: 8px; }
.utm-row { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(80px, 1fr) auto; gap: 14px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); }
.utm-row.is-untagged { opacity: 0.75; }
.utm-name strong { display: block; font-size: 14px; }
.utm-name small { font-size: 12px; color: var(--ink-3); }
.utm-bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.07); overflow: hidden; }
.utm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-bright); transform-origin: left; animation: bar-grow 0.8s var(--ease-out) both; }
.utm-nums { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.utm-nums b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ci-utm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.ci-utm-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.ci-utm-chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 11px; border-radius: 4px; background: var(--grad-soft); border: 1px solid rgba(176, 18, 79, 0.16); font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ci-utm-chip.muted { background: #e5e7eb; border-color: transparent; }
.badge-utm { background: rgba(66, 32, 130, 0.14); color: #2f1760; }

/* Live Google Sheet box (Edit project) */
.sheet-box { display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(58, 79, 0, 0.22); background: linear-gradient(180deg, rgba(74, 101, 0, 0.06), rgba(74, 101, 0, 0.02)); }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; }
.sheet-head strong { display: block; font-size: 14px; }
.sheet-head small { font-size: 13px; color: var(--ink-3); }
.sheet-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4a6500, #3a4f00); }
.sheet-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sheet-steps .link-row { margin-top: 6px; }
.sheet-steps input { font-family: var(--font-mono); font-size: 12px !important; }
.sheet-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.sheet-box .note { font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* CRM: companies, charts, filters */
.crm-modes { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.crm-modes button { min-height: 36px; padding: 6px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; font-size: 13px; color: var(--ink-3); }
.crm-modes button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 4px; background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 700; }
.filter-pill button { width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(176, 18, 79, 0.12); color: var(--info); font-size: 15px; line-height: 1; }
.iv-from { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, rgba(255, 255, 255, 0.6)); }
.iv-from .hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .iv-from { grid-template-columns: 1fr; } }
.im-done { display: grid; justify-items: center; gap: 14px; text-align: center; }
.im-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); font-size: 26px; font-weight: 700; animation: im-pop 0.35s cubic-bezier(.2, 1.4, .4, 1) both; }
.im-none .im-icon { background: var(--warn-bg); color: var(--warn); }
.im-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.im-tile { display: grid; gap: 4px; padding: 14px 10px; border-radius: 12px; background: var(--surface-2, #f1eefa); }
.im-tile b { font-size: 26px; line-height: 1; }
.im-tile span { font-size: 12px; color: var(--text-muted); }
.im-tile.good b { color: var(--ok); }
.im-tile.info b { color: var(--info); }
.im-tile.warn b { color: var(--warn); }
.im-done .hint { margin: 0; }
@keyframes im-pop { from { scale: 0.6; opacity: 0; } to { scale: 1; opacity: 1; } }
@media (max-width: 640px) { .im-tiles { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .im-icon { animation: none; } }
.crm-charts-toggle { display: flex; justify-content: flex-end; margin: -8px 2px 10px; }
.crm-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.inline-input { width: 100%; min-width: 180px; min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; font: inherit; font-size: 13px; color: var(--ink); }
.inline-input:hover { border-color: var(--line-2); background: #fff; }
.inline-input:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); background: #fff; }

/* ================================================================ Responsive */
/* Booth Quest (admin-quest.js) */
.qs-stat { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px; border-radius: 4px; background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 700; }
.qs-stat b { font-size: 15px; }
.qs-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qs-mode { display: grid !important; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.qs-mode input { position: absolute; opacity: 0; pointer-events: none; }
.qs-mode strong { font-size: 14px; color: var(--ink); }
.qs-mode span { font-size: 12px; font-weight: 500; color: var(--ink-3); line-height: 1.45; }
.qs-mode.on { border-color: transparent; box-shadow: 0 0 0 2px var(--violet); background: var(--info-bg); }
.qs-img { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qs-img img { width: 220px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.qs-rows { display: grid; gap: 8px; }
.qs-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.qs-row.faq { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; }
.qbe-emojis { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.fg .qbe-emojis input { width: 70px; text-align: center; font-size: 18px; }
.qbe-emojis button { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: 18px; }
.qbe-types { align-self: start; }
.qbe-q { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); }
.qbe-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qbe-map { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); cursor: crosshair; }
.qbe-map img { display: block; width: 100%; height: auto; }
.qbe-pin { position: absolute; transform: translate(-50%, -100%); min-width: 32px; height: 32px; padding: 0 6px; border-radius: 12px 16px 16px 4px; border: 2px solid #fff; display: grid; place-content: center; color: #fff; font-size: 16px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3); pointer-events: none; }
@media (max-width: 760px) { .qs-modes, .qbe-opts, .qs-row, .qs-row.faq { grid-template-columns: 1fr; } }

/* Live quiz panel + editor (host stage styles are in live.css) */
.lq-list { display: grid; gap: 8px; }
.lq-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; }
.lqe-list { display: grid; gap: 12px; }
.lqe-q { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; }
.lqe-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lqe-head input[type="text"] { flex: 1 1 260px; min-width: 0; }
.fg .lqe-head select { width: auto; min-height: 38px; padding: 6px 10px; font-size: 13px; }
.lqe-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lqe-opt { display: flex !important; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: var(--tile); color: #fff; }
.lqe-opt .lq-shape { font-size: 18px; }
.fg .lqe-opt input[type="text"] { flex: 1; min-width: 0; min-height: 36px; border-color: transparent; border-radius: 8px; }
.lqe-ok { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: #fff; }
.lqe-ok input { width: 18px; height: 18px; accent-color: #fff; }
@media (max-width: 640px) { .lqe-opts { grid-template-columns: 1fr; } }

/* Feedback: template gallery, BANT questions, leads */
.ft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.ft-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; }
.ft-card.is-bant { border-color: rgba(176, 18, 79, 0.35); background: linear-gradient(#fff, #fff) padding-box, var(--grad-soft); }
.ft-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ft-top strong { font-size: 14px; }
.ft-badge { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: var(--grad); color: #fff; }
.ft-card p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.ft-card ol { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.ft-card li.more { list-style: none; margin-left: -18px; color: var(--ink-3); }
.ft-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.fbq.is-bant { border-color: rgba(176, 18, 79, 0.35); }
.fbq.is-bant .fbq-num { background: var(--grad); color: #fff; }
.fbq-bant { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; padding-top: 4px; }
.fbq-bant label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.fbq-bant label.check-inline { display: flex; font-weight: 600; }
.fbq-bant select { min-height: 36px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--field-line); background: #fff; font-size: 13px; }
.fbq-pts { flex-shrink: 0; width: auto !important; min-height: 36px; padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(176, 18, 79, 0.35); background: var(--info-bg); color: var(--info); font-size: 12px; font-weight: 700; }
.fbq-yn { min-width: 60px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.leads-panel .note { max-width: 640px; }
.lead-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 14px; }
.lead-stat { display: grid; justify-items: start; min-width: 110px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; text-align: left; }
.lead-stat b { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.lead-stat span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.lead-stat.hot b { color: #b0124f; } .lead-stat.warm b { color: #5e4a72; } .lead-stat.cold b { color: #422082; }
.lead-stat.on { box-shadow: 0 0 0 2px var(--violet); }
.lead-badge { display: inline-flex; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.lead-badge.hot { background: #f1edf5; color: #b0124f; } .lead-badge.warm { background: #f1edf5; color: #5e4a72; } .lead-badge.cold { background: #f1eefa; color: #422082; }
.dim-dots { display: inline-flex; gap: 3px; }
.dim-dots i { width: 9px; height: 9px; border-radius: 50%; background: #f1eefa; }
.dim-dots i.on { background: var(--violet); }
.leads-table td { vertical-align: middle; }

/* ------------------------------------------------------------------
   Email editor, template studio and library (email-editor.js)
------------------------------------------------------------------ */
.modal-panel.modal-xl { max-width: 1180px; }
.kind-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 6px; }
.kind-tab { flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; text-align: left; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast); }
.kind-tab small { grid-column: 2; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.kind-tab:hover { border-color: rgba(176, 18, 79, 0.4); }
.kind-tab.on { border-color: transparent; background: var(--info-bg); box-shadow: 0 0 0 2px var(--violet); }
.kind-dot { grid-row: span 2; width: 9px; height: 9px; border-radius: 50%; background: #cfcfdb; }
.kind-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.kind-dot.manual { background: var(--violet); box-shadow: 0 0 0 3px var(--info-bg); }
.tpl-studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 20px; align-items: start; }
.tpl-edit { gap: 14px; align-content: start; min-width: 0; }
.tpl-preview { position: sticky; top: 86px; min-width: 0; }
.tpl-preview .email-frame { height: 720px; }
.tpl-when { padding: 10px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); }
.auto-row { display: flex !important; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(229, 231, 235, 0.8); border: 1px solid var(--line); cursor: pointer; }
.auto-row strong { display: block; font-size: 14px; color: var(--ink); }
.auto-row small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.subject-row { display: flex; gap: 8px; }
.subject-row input { flex: 1; min-width: 0; }
.subject-row .icon-btn { flex-shrink: 0; min-width: 42px; justify-content: center; }
.tpl-opts { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.tpl-opts [data-custom-url], .tpl-opts [data-c="btn-url-row"], .tpl-opts #iv-btn-url-row { grid-column: 1 / -1; }
.tpl-checks { display: grid; gap: 8px; }
.cal-warn { font-size: 12px; color: var(--warn); background: var(--warn-bg); padding: 6px 10px; border-radius: 8px; justify-self: start; }
.tpl-lib-row { flex-wrap: wrap; }
.tpl-lib-row .btn { gap: 6px; }
.wa-details { border-top: 1px solid var(--line); padding-top: 10px; }
.wa-details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.wa-details textarea { width: 100%; }
.tpl-timing { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pv-err { color: var(--danger); font-weight: 700; }
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 18px; align-items: start; }
.composer-grid[hidden] { display: none; }
.composer-side { position: sticky; top: 0; min-width: 0; }
.composer-side .email-frame { height: 600px; }
.iv-optin { align-self: end; padding-bottom: 10px; }

/* Body editor: format switch + toolbar + writing area */
.body-ed { display: grid; gap: 8px; min-width: 0; }
.body-ed-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.body-ed-note { font-size: 12px; color: var(--ink-3); flex: 1; min-width: 180px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #f1eefa; gap: 2px; }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); min-height: 32px; }
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(47, 23, 96, 0.12); }
.rte { border: 1px solid var(--field-line); border-radius: 12px; background: #fff; overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); min-width: 0; }
.rte:focus-within { border-color: var(--violet); box-shadow: var(--ring); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: rgba(229, 231, 235, 0.9); position: sticky; top: 0; z-index: 2; }
.rte-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 34px; height: 34px; padding: 0 7px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 15px; line-height: 1; transition: background-color var(--t-fast), color var(--t-fast); }
.rte-btn:hover:not(:disabled) { background: rgba(176, 18, 79, 0.1); color: var(--ink); }
.rte-btn.on { background: var(--info-bg); color: var(--info); }
.rte-btn:disabled { opacity: 0.35; cursor: default; }
.rte-btn b, .rte-btn i, .rte-btn u, .rte-btn s { font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.rte-lbl { font-size: 12px; font-weight: 700; }
.rte-a { display: inline-grid; justify-items: center; font-weight: 700; font-size: 15px; line-height: 1; }
.rte-a i { display: block; width: 16px; height: 3px; border-radius: 2px; margin-top: 2px; }
.rte-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.fg .rte-block, .rte-block { width: auto; min-height: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600; padding: 0 8px; color: var(--ink); }
.rte-area { min-height: 320px; max-height: 620px; overflow-y: auto; padding: 22px 26px; outline: none; }
.rte-source, .hte-code, .fg .rte-source, .fg .hte-code { display: block; border-radius: 0; min-height: 420px; width: 100%; min-height: 420px; border: 0; padding: 16px 18px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; color: #2f1760; background: #f1eefa; resize: vertical; outline: none; }
.rte.is-readonly .rte-bar { display: none; }
.rte-imgbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--info-bg); font-size: 12px; font-weight: 700; color: var(--info); }
.rte-imgbar[hidden] { display: none; }
.rte-imgbar span { margin-right: 6px; }
.rte-imgbar button { border: 1px solid rgba(176, 18, 79, 0.2); background: #fff; border-radius: 8px; padding: 4px 9px; font-size: 12px; font-weight: 700; color: var(--info); }
.hte-frame { display: block; width: 100%; height: 640px; border: 0; background: #e5e7eb; }
.hte-frame[hidden] { display: none; }

/* What the message looks like while writing: mirrors the email's inline styles */
.email-body { --email-accent: #b0124f; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 1.6; color: #2f1760; }
.rte .email-body { color: #2f1760; }
.email-body p { margin: 0 0 16px; }
.email-body h1 { margin: 0 0 14px; font-size: 24px; line-height: 1.25; }
.email-body h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.3; }
.email-body h3 { margin: 0 0 10px; font-size: 16px; line-height: 1.35; }
.email-body ul, .email-body ol { margin: 0 0 16px; padding-left: 24px; }
.email-body li { margin: 0 0 6px; }
.email-body a { color: var(--email-accent); }
.email-body blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--email-accent); background: #e5e7eb; color: #1f1633; }
.email-body hr { border: 0; border-top: 1px solid #f1eefa; margin: 20px 0; }
.email-body img { max-width: 100%; height: auto; }
.email-body img.rte-img-on { outline: 3px solid var(--violet); outline-offset: 2px; }
.email-body table { border-collapse: collapse; margin: 0 0 16px; }
.email-body td, .email-body th { padding: 6px 10px; vertical-align: top; min-width: 40px; }
.email-body [data-block] { position: relative; margin: 6px 0 16px; padding: 16px 14px 12px; border: 1.5px dashed #f1eefa; border-radius: 12px; background: #f1eefa; text-align: center; font-family: var(--font-mono); font-size: 12px; color: #422082; cursor: default; user-select: none; }
.email-body [data-block]::before { content: attr(data-label); display: block; font-family: var(--font-body); font-size: 13px; font-weight: 700; color: #422082; margin-bottom: 2px; }
.email-body [data-uploading] { display: inline-block; padding: 8px 12px; border-radius: 8px; background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 700; }

/* "QR only" parts: green = only with the QR code, orange = only without.
   The ones that don't apply to the current choice are faded. */
.email-body [data-if] { box-shadow: inset 3px 0 0 var(--if-c); background: var(--if-bg); padding-left: 10px; border-radius: 4px; transition: opacity var(--t-fast); }
.email-body [data-if="qr"] { --if-c: #4a6500; --if-bg: #f1fad9; }
.email-body [data-if="noqr"] { --if-c: #5e4a72; --if-bg: #f1edf5; }
.email-body li[data-if] { margin-left: -10px; }
.rte[data-qr="on"] .email-body [data-if="noqr"], .rte[data-qr="off"] .email-body [data-if="qr"], .rte[data-qr="off"] .email-body [data-block="qrCode"] { opacity: 0.38; }
.rte-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-3); background: #f1eefa; }
.rte-legend[hidden] { display: none; }
.rte-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rte-legend .lg-qr::before { background: #4a6500; }
.rte-legend .lg-noqr::before { background: #5e4a72; }
.rte-legend .lg-hint { font-weight: 500; }
.rte-legend .lg-hint::before { display: none; }
.rte-menu button.on { background: var(--info-bg); }
.qr-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(229, 231, 235, 0.8); }
.qr-choice-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.qr-choice small { flex-basis: 100%; font-size: 13px; color: var(--ink-3); }

/* Toolbar popovers */
.rte-pop { position: absolute; z-index: 80; min-width: 240px; max-width: 360px; max-height: 420px; overflow-y: auto; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(47, 23, 96, 0.45); animation: rise-in 0.16s var(--ease-out) both; }
.rte-menu { display: grid; gap: 2px; }
.rte-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--ink); }
.rte-menu button:hover { background: var(--info-bg); }
.rte-menu code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.rte-menu small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.rte-linkform { display: grid; gap: 10px; padding: 6px; width: 320px; max-width: 100%; }
.rte-linkform label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rte-linkform input, .rte-linkform select { min-height: 38px; border: 1px solid var(--field-line); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.rte-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rte-chips button { border: 1px solid var(--line-2); background: #fff; border-radius: 4px; padding: 5px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.rte-chips button:hover { border-color: var(--violet); color: var(--info); }
.rte-pop-actions { display: flex; justify-content: flex-end; }
.rte-swatches { display: grid; grid-template-columns: repeat(6, 30px); gap: 8px; padding: 6px; }
.rte-swatches button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); }
.rte-custom-color { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rte-custom-color input { width: 44px; height: 30px; border: 1px solid var(--field-line); border-radius: 8px; padding: 2px; background: #fff; }

/* Template library */
.lib-body { gap: 16px; }
.lib-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lib-import > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.lib-import label.btn { cursor: pointer; }
.lib-set { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(176, 18, 79, 0.2); }
.lib-set strong { display: block; font-family: var(--font-display); font-size: 15px; }
.lib-set span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.5; }
.lib-set .btn { flex-shrink: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; transition: box-shadow var(--t-med), border-color var(--t-fast), translate var(--t-med) var(--ease-out); }
.lib-card:hover { box-shadow: var(--shadow-md); border-color: rgba(176, 18, 79, 0.35); translate: 0 -2px; }
.lib-thumb { position: relative; height: 230px; overflow: hidden; background: #e5e7eb; border-bottom: 1px solid var(--line); }
.lib-thumb iframe { position: absolute; top: 0; left: 50%; width: 640px; height: 900px; border: 0; transform: translateX(-50%) scale(0.42); transform-origin: top center; pointer-events: none; }
.lib-meta { display: grid; gap: 8px; padding: 14px; flex: 1; align-content: start; }
.lib-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.lib-meta p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.lib-badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: #e5e7eb; color: var(--ink-2); }
.lib-badge.b-built { background: var(--info-bg); color: var(--info); }
.lib-badge.b-saved { background: var(--ok-bg); color: var(--ok); }
.lib-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.lib-busy { align-items: center; justify-content: center; min-height: 140px; font-weight: 700; color: var(--info); background: var(--info-bg); }
.lib-paste textarea { font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 1180px) {
  .tpl-studio, .composer-grid { grid-template-columns: minmax(0, 1fr); }
  .tpl-preview, .composer-side { position: static; }
  .tpl-preview .email-frame, .composer-side .email-frame { height: 560px; }
}
@media (max-width: 640px) {
  .kind-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .kind-tabs::-webkit-scrollbar { display: none; }
  .tpl-opts { grid-template-columns: minmax(0, 1fr); }
  .rte-area { padding: 16px; min-height: 260px; }
  .lib-set { flex-direction: column; align-items: stretch; }
  .lib-import { width: 100%; }
  .rte-lbl { display: none; }
}

@media (max-width: 1100px) {
  .config-layout { grid-template-columns: 1fr; }
  .config-side { position: static; }
  .preview-card iframe { height: 560px; }
  .ov-hero { grid-template-columns: 1fr; }
  .ov-hero .hero-art { display: none; }
}
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; align-content: start; }
  .gate-art { order: -1; }
  .gate-art svg { max-height: 200px; }
  .shell { flex-direction: column; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; gap: 8px; }
  .sidebar::before, .sidebar::after { display: none; }
  .sidebar .brand { padding: 0 10px 0 0; border: none; margin: 0; flex-shrink: 0; }
  .sidebar .brand .brand-tag { display: none; }
  .sidebar nav { display: flex; flex: none; overflow: visible; gap: 4px; }
  .sidebar .nav-item { margin: 0; white-space: nowrap; }
  .sidebar .nav-section { display: none; }
  .sidebar .add-project-btn { width: auto; margin: 0; padding: 8px 12px; white-space: nowrap; flex-shrink: 0; }
  .whoami { display: none; }
  .nav-team-btn { width: auto; margin: 0; white-space: nowrap; flex-shrink: 0; }
  .topbar { top: 0; padding: 12px 16px; }
  .content { padding: 18px 16px 70px; }
  .bulk-bar { top: 64px; }
  .ci-card { flex-direction: column; align-items: stretch; }
  .ci-actions { justify-content: space-between; }
  .ci-btn { flex: 1; }
  .modal-form .row2, .row2, .row3 { grid-template-columns: 1fr; }
  .engage-grid { grid-template-columns: 1fr; }
  .agenda-row { grid-template-columns: 80px 1fr 32px; }
  .share-qr { flex-direction: column; align-items: flex-start; }
  .setup-card { grid-template-columns: auto 1fr; }
  .setup-card > .link-btn { grid-column: 1 / -1; justify-self: start; }
  .view-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .view-tabs button { flex-shrink: 0; }
  .ov-hero { padding: 22px; }
  body.sidebar-hidden .sidebar { display: none; }
  .sidebar .nav-group { display: contents; }
  .sidebar .nav-group[hidden] { display: none; }
  .sidebar .nav-section-toggle, .sidebar .nav-filter-note, .sidebar .drag-handle { display: none; }
  .sidebar .brand .brand-tag { display: none; }
  .events-head { align-items: stretch; }
  .events-tools { width: 100%; }
  .tool-select { flex: 1 1 200px; }
  .tool-select select { flex: 1; min-width: 0; }
  .fb-layout { grid-template-columns: 1fr; }
  .fb-forms { position: static; }
  .fbq-head { grid-template-columns: auto minmax(0, 1fr); }
  .fbq-head select, .fbq-tools { grid-column: 1 / -1; }
  .fb-share { grid-template-columns: 1fr; justify-items: start; }
  .ds-winners { max-width: 100%; }
  .msg-design-layout, .design-grid, .crm-charts { grid-template-columns: 1fr; }
  .email-preview-panel { position: static; }
  .email-frame { height: 480px; }
  .utm-row { grid-template-columns: 1fr; gap: 6px; }
  .utm-nums { flex-wrap: wrap; }
}

/* ================================================================ Motion: tiered reduced-motion
   Tier 1 (removed): aurora drift, 3D tilt, floating art, scan line, orb pulse.
   Tier 2 (softened): entrances become short fades, springs become ease.
   Tier 3 (kept): color/background/focus transitions, progress bar width. */
@media (prefers-reduced-motion: reduce) {
  .lib-card:hover { translate: none; }
  .rte-pop { animation: none; }
  body::before, .iso-float, .iso-shadow, .iso-orbs circle, .scanner-frame::after, .topbar .sub::before { animation: none !important; }
  .iso-bars > g, .event-card .ec-bar i { animation: none !important; }
  .stat-card, .event-card, .ov-hero { transform: none !important; }
  .stat-card:hover, .event-card:hover { --lift: 0px; }
  .btn-brand::after, .btn-scan::after, .ci-btn::after { display: none; }
  #view-project > [id^="sub-"], #view-overview, #view-team, #view-project, .gate-card, .chart-card, .event-card, .ci-card, .q-card,
  .setup-card, .bulk-bar, .composer-preview, .wa-queue, .menu-popover, .modal-panel, .toast, .save-bar, .scanner-result, .pz-result {
    animation: fade-only 0.15s ease both !important;
  }
  .btn:hover, .btn:active, .icon-btn:active, .ci-btn:hover, .ci-btn:active, .view-tabs button:active { transform: none; }
  .view-tabs button::before { transition: opacity 0.12s ease; transform: none; }
  .switch-ui::after { transition: transform 0.12s ease; }
  .skel span { animation: none; }
  .sidebar, body.sidebar-hidden .sidebar { transition: none; }
  .ds-draw::after, .draw-stage.has-winner .ds-window { animation: none; }
  .crm-drawer, .fbq, .ds-winners .w, .draw-stage, .present-qr, .crm-drawer-back { animation: fade-only 0.15s ease both !important; }
  .crm-stat:hover, .fb-form-card:hover, .ds-draw:hover { transform: none; }
  html { scroll-behavior: auto; }
}
@keyframes fade-only { from { opacity: 0; } to { opacity: 1; } }

/* Daily report (admin-report.js) */
.rp-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 520px); }
.rp-form { gap: 12px; }
.rp-checks, .rp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.rp-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rp-grid .composer-side .email-frame { height: 760px; background: #fff; }
@media (max-width: 760px) { .rp-checks, .rp-cols { grid-template-columns: 1fr 1fr; } }

/* Daily report: custom signature (rich editor without the email-only tools) */
.rte-lite [data-rte="field"], .rte-lite [data-rte="block"], .rte-lite [data-rte="cond"], .rte-lite [data-rte="button"],
.rte-lite [data-rte="rowAdd"], .rte-lite [data-rte="rowDel"], .rte-lite [data-rte-block] { display: none; }
.rte-lite .rte-area { min-height: 140px; max-height: 320px; overflow: auto; font-size: 13px; }
.rte-lite .rte-area p { margin: 0 0 4px; }
.rp-sig-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.rp-sig-tools .hint { margin: 0; flex: 1 1 220px; }

/* ==================================================================
   Overview at scale (2026-09-28): view switch, month/year filters,
   hide completed, list view, month headings, sidebar search, calendar
   ================================================================== */
.events-head { margin-bottom: 12px; align-items: center; }
.ev-view .seg-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ev-view .seg-btn svg { opacity: 0.75; }
.ev-view .seg-btn.on svg { opacity: 1; color: #b0124f; }
#ev-tools { margin-bottom: 18px; }
#ev-tools.is-calendar { display: none; }
.tool-check { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 42px; border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tool-check input { width: 16px; height: 16px; accent-color: #b0124f; margin: 0; }
.tool-check b { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 4px; background: var(--ok-bg); color: var(--ok); margin-left: 2px; }
.events-tools [hidden] { display: none !important; }
.ov-scope { margin: 4px 2px 12px; font-size: 13px; color: var(--ink-3); }
.ov-scope strong { color: var(--ink); }
.ov-scope:empty { display: none; }
.table-more { display: flex; justify-content: center; padding-top: 14px; }
.ev-more { display: flex; margin: 14px auto 0; }
.ev-month { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 6px 2px -2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ev-month::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.ev-month b { font-size: 12px; font-weight: 700; color: var(--ink-3); background: rgba(0, 0, 0, 0.06); padding: 1px 8px; border-radius: 4px; }
.ev-month:first-child { margin-top: 0; }

/* List view: one compact row per event, scales to hundreds */
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-list .ev-month { margin: 10px 2px 2px; }
.evl-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 104px 78px 78px 78px 110px; align-items: center; gap: 14px;
  width: 100%; padding: 10px 16px 10px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-strong);
  box-shadow: var(--shadow-sm); text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  animation: rise-in 0.4s var(--ease-out) both;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.evl-row:hover { border-color: rgba(176, 18, 79, 0.35); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.evl-row:focus-visible { outline: none; box-shadow: var(--ring); }
.evl-row.is-done { opacity: 0.72; }
.evl-row.is-live { border-color: rgba(176, 18, 79, 0.35); }
.evl-date { width: 52px; height: 52px; border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(176, 18, 79, 0.14); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.evl-date b { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--ink); }
.evl-date small { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: #b0124f; margin-top: 3px; }
.evl-row.is-done .evl-date { background: #e5e7eb; border-color: transparent; }
.evl-row.is-done .evl-date small { color: var(--ink-3); }
.evl-main { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.evl-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evl-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evl-row .ec-when { justify-self: start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 4px; background: var(--grad-soft); color: #b0124f; border: 1px solid rgba(176, 18, 79, 0.16); white-space: nowrap; }
.evl-row .ec-when.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.evl-row .ec-when.today { background: var(--grad); color: #fff; border-color: transparent; }
.evl-row .ec-when.nodate { background: #e5e7eb; color: var(--ink-3); border-color: transparent; }
.evl-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.evl-num b { font-family: var(--font-display); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.evl-num small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.evl-bar { height: 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.08); overflow: hidden; }
.evl-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-bright); }
@media (max-width: 1100px) {
  .evl-row { grid-template-columns: 52px minmax(0, 1fr) 104px 70px 70px; }
  .evl-row .evl-num:nth-of-type(3), .evl-row .evl-bar { display: none; }
}
@media (max-width: 640px) {
  .evl-row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding-right: 12px; }
  .evl-date { width: 46px; height: 46px; }
  .evl-row .evl-num { display: none; }
}

/* Sidebar: find an event + "Show all" in long groups */
.nav-search { position: relative; margin: 2px 0 6px; }
.nav-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #5f5870; pointer-events: none; }
.nav-search input { width: 100%; min-height: 38px; padding: 8px 10px 8px 32px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.06); color: #fff; font: inherit; font-size: 13px; }
.nav-search input::placeholder { color: #5f5870; }
.nav-search input:focus { outline: none; border-color: rgba(241, 238, 250, 0.6); background: rgba(255, 255, 255, 0.09); }
.sidebar .nav-more { display: block; width: calc(100% - 12px); margin: 2px 6px 6px; padding: 6px 8px; border: none; border-radius: 8px; background: none; color: #b0124f; font: inherit; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.sidebar .nav-more:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
@media (max-width: 860px) {
  .nav-search { display: none !important; }
  .sidebar .nav-more { width: auto; margin: 0; white-space: nowrap; flex-shrink: 0; padding: 8px 12px; }
}

/* Calendar */
#event-groups.is-calendar { margin-bottom: 20px; }
.cal-root { border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow-md); padding: 18px; animation: rise-in 0.4s var(--ease-out) both; }
.cal-head { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h3 { margin: 0 6px; min-width: 180px; text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 0; }
.cal-nav h3 span { background: var(--grad-bright); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cal-arrow { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: background-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.cal-arrow:hover { background: var(--grad-soft); color: var(--ink); }
.cal-arrow:active { transform: scale(0.94); }
.cal-arrow:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-today { min-height: 36px; padding: 6px 14px; margin-left: 4px; }
.cal-sum { font-size: 13px; color: var(--ink-3); }
.cal-sum b { color: var(--ink); }
.cal-legend { margin-left: auto; display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend span::before { content: ""; width: 10px; height: 10px; border-radius: 4px; }
.cal-legend .live::before { background: var(--grad); }
.cal-legend .up::before { background: #f1eefa; border: 1px solid rgba(176, 18, 79, 0.45); }
.cal-legend .done::before { background: #f1eefa; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.cal-week span { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-cell { position: relative; min-height: 104px; min-width: 0; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.cal-cell.out { background: transparent; border-style: dashed; }
.cal-cell.out .cal-day { color: #422082; }
.cal-cell.has { border-color: rgba(176, 18, 79, 0.22); }
.cal-cell.today { border-color: rgba(176, 18, 79, 0.55); box-shadow: 0 0 0 2px rgba(176, 18, 79, 0.14); }
.cal-cell.sel { border-color: #422082; box-shadow: 0 0 0 3px rgba(176, 18, 79, 0.22); }
.cal-day { align-self: flex-start; min-width: 28px; height: 28px; padding: 0 6px; border: none; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--grad-soft); color: var(--ink); }
.cal-day:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-cell.today .cal-day { background: var(--grad); color: #fff; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 4px 7px; border-radius: 8px; border: 1px solid rgba(176, 18, 79, 0.28); background: #f1eefa; color: #422082; font: inherit; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast); }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip small { flex-shrink: 0; font-size: 12px; font-weight: 700; opacity: 0.75; font-variant-numeric: tabular-nums; }
.cal-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(176, 18, 79, 0.6); }
.cal-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-chip.live { background: var(--grad); border-color: transparent; color: #fff; }
.cal-chip.done { background: #e5e7eb; border-color: transparent; color: #5f5870; }
.cal-chip.cont { border-style: dashed; opacity: 0.85; }
.cal-more { border: none; background: none; padding: 2px 4px; font: inherit; font-size: 12px; font-weight: 700; color: var(--info); text-align: left; cursor: pointer; }
.cal-more:hover { text-decoration: underline; }
.cal-dots { display: none; }
.cal-agenda { border-radius: 12px; background: linear-gradient(180deg, rgba(241, 238, 250, 0.7), rgba(255, 255, 255, 0.7)); border: 1px solid var(--line); padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.cal-ag-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-ag-head strong { font-family: var(--font-display); font-size: 14.5px; }
.cal-ag-head > span { font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 4px; background: var(--grad-soft); color: #b0124f; }
.cal-ag-list { display: flex; flex-direction: column; gap: 8px; }
.cal-ag-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; text-align: left; color: var(--ink); cursor: pointer; position: relative; transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast); }
.cal-ag-row:hover { border-color: rgba(176, 18, 79, 0.35); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cal-ag-row:focus-visible { outline: none; box-shadow: var(--ring); }
.cal-ag-row.done { opacity: 0.75; }
.cal-ag-date { width: 44px; height: 44px; border-radius: 12px; background: var(--grad-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cal-ag-date b { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.cal-ag-date small { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #b0124f; margin-top: 2px; }
.cal-ag-row.done .cal-ag-date { background: #e5e7eb; }
.cal-ag-row.done .cal-ag-date small { color: var(--ink-3); }
.cal-ag-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-right: 4px; }
.cal-ag-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.cal-ag-sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ag-nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-3); }
.cal-ag-nums b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-ag-when { position: absolute; top: 10px; right: 10px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.cal-ag-when.live { background: var(--grad); color: #fff; }
.cal-ag-when.done { background: var(--ok-bg); color: var(--ok); }
.cal-ag-row:has(.cal-ag-when) .cal-ag-name { padding-right: 70px; }
.cal-ag-empty { font-size: 13px; color: var(--ink-3); margin: 6px 0; line-height: 1.6; }
.cal-nodate { margin-top: 14px; font-size: 13px; }
.cal-nodate summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.cal-nodate > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cal-nodate .cal-chip { width: auto; }
@media (max-width: 1180px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-agenda { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .cal-root { padding: 12px; border-radius: 12px; }
  .cal-nav h3 { min-width: 0; font-size: 17px; }
  .cal-legend { display: none; }
  .cal-week, .cal-grid { gap: 3px; }
  .cal-week span { padding: 0; text-align: center; font-size: 12px; letter-spacing: 0.04em; }
  .cal-cell { min-height: 52px; padding: 3px; border-radius: 8px; align-items: center; }
  .cal-day { align-self: center; min-width: 26px; height: 26px; font-size: 13px; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; gap: 3px; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: #422082; }
  .cal-dots i.live { background: #b0124f; }
  .cal-dots i.done { background: #422082; }
}
@media (prefers-reduced-motion: reduce) {
  .evl-row, .cal-root { animation: none; }
}
@media (max-width: 860px) {
  #ev-tools [data-tool="month"], #ev-tools [data-tool="year"] { flex: 1 1 140px; }
}

/* Person in charge (projects.picName) */
.pic { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 13px; font-weight: 600; color: var(--ink-2); vertical-align: middle; }
.pic > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pic i { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; color: #fff; background: var(--grad-bright); box-shadow: 0 2px 6px -2px rgba(176, 18, 79, 0.6); }
.pic.sm { font-size: 12px; }
.pic.sm i { width: 20px; height: 20px; font-size: 9px; }
.pic.xs { font-size: 12px; gap: 5px; }
.pic.xs i { width: 17px; height: 17px; font-size: 8px; }
.event-card .ec-pic { display: flex; margin-top: 7px; }
.evl-sub { display: flex; align-items: center; gap: 8px; }
.evl-sub > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.evl-sub .pic { flex-shrink: 0; max-width: 45%; color: var(--ink-2); }
.cal-ag-pic { display: flex; margin-top: 1px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.pic-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border-radius: 4px; background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.pic-chip .pic-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: #b0124f; padding: 3px 7px; border-radius: 4px; background: var(--grad-soft); }
.overview-table .pic { max-width: 160px; }
@media (max-width: 640px) {
  .pic-chip .pic > span { max-width: 110px; }
}

/* Sessions (Form & page, Registrations, Check-in) */
.badge-session { background: #f1eefa; color: #422082; border: 1px solid rgba(176, 18, 79, 0.25); margin-left: 6px; }
.session-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ss-stat { display: grid; gap: 5px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-strong); box-shadow: var(--shadow-sm); font: inherit; color: var(--ink); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.ss-stat:hover { border-color: rgba(176, 18, 79, 0.35); box-shadow: var(--shadow-md); }
.ss-stat.on { border-color: #422082; box-shadow: 0 0 0 3px rgba(176, 18, 79, 0.18); }
.ss-stat-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; }
.ss-stat-name em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--danger); background: var(--danger-bg); padding: 1px 7px; border-radius: 4px; margin-left: 4px; }
.ss-stat-nums { font-size: 13px; color: var(--ink-3); }
.ss-stat-nums b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ss-stat-bar { height: 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.08); overflow: hidden; }
.ss-stat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-bright); }
.ss-stat-cap { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ss-list { display: grid; gap: 12px; }
.ss-card { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.ss-head { display: flex; align-items: center; gap: 10px; }
.ss-head input { flex: 1; min-width: 0; font-weight: 700; }
.ss-count { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--ink-3); background: rgba(0, 0, 0, 0.05); padding: 3px 10px; border-radius: 4px; }
.ss-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.ss-form { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px; }
.ss-form select { min-height: 36px; }
.form-target { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin: 2px 0 6px; border-radius: 12px; background: var(--grad-soft); }
.form-target .hint { margin: 0; }
.mono-input { font-family: var(--font-mono); font-size: 13px !important; letter-spacing: 0.02em; }

/* Google Sheets sources + multi-file import */
.sync-sources { display: grid; gap: 8px; }
.src-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.src-row.failed { border-color: rgba(176, 18, 79, 0.35); background: var(--danger-bg); }
.src-main { display: grid; gap: 2px; min-width: 0; }
.src-main strong { font-size: 14px; }
.src-url { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-meta { font-size: 12px; color: var(--ink-3); }
.src-row select { min-height: 36px; max-width: 170px; }
.src-actions { display: flex; align-items: center; gap: 6px; }
.import-parts { display: grid; gap: 6px; max-height: 220px; overflow: auto; padding: 4px; }
.import-part { display: flex !important; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #f1eefa; font-size: 13px; }
.import-part span { color: var(--ink-3); font-size: 12px; }
.import-part em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; }
.import-part em.ok { color: var(--ok); }
.import-part em.bad { color: var(--danger); }
@media (max-width: 640px) {
  .src-row { grid-template-columns: 1fr; }
  .src-row select { max-width: none; }
}

/* ------------------------------------------------------------------
   Client view, Review tab and the blacklist (2026-10-14)
------------------------------------------------------------------ */
body:not(.can-approve) [data-perm="approve"],
body:not(.can-blacklist) [data-perm="blacklist"] { display: none !important; }
/* The client view keeps to their guests: no games, booths or draws. */
body.role-client #tab-engage { display: none !important; }

.seg-btn[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(47, 23, 96, 0.12); }
.seg-btn b { margin-left: 3px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 4px; background: #b0124f; color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.view-tabs button[aria-selected="true"] .tab-count { background: rgba(255, 255, 255, 0.24); }

/* Blacklist marks */
.badge-flag { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(176, 18, 79, 0.22); }
.badge-flag-soft { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(74, 58, 92, 0.2); }
.badge-waitlisted { background: var(--warn-bg); color: var(--warn); }
button.badge { font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
button.badge:hover { filter: brightness(0.96); }
tbody tr.is-flagged { background: #fee8f0; box-shadow: inset 3px 0 0 var(--danger); }
tbody tr.is-flagged:hover { background: #fee8f0; }
tbody tr.is-flagged-soft { box-shadow: inset 3px 0 0 #5e4a72; }
.flag-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-md); background: linear-gradient(135deg, #fee8f0, #f1edf5); border: 1px solid rgba(176, 18, 79, 0.2); color: #b0124f; font-size: 14px; line-height: 1.5; animation: rise-in 0.28s var(--ease-out) backwards; }
.flag-banner > svg { color: var(--danger); flex-shrink: 0; }
.flag-banner > span { flex: 1 1 260px; }
.flag-box { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--danger-bg); border: 1px solid rgba(176, 18, 79, 0.22); color: #b0124f; font-size: 13px; line-height: 1.5; }
.flag-box strong { font-size: 14px; color: var(--danger); }
.flag-box.is-soft { background: var(--warn-bg); border-color: rgba(74, 58, 92, 0.2); color: #4a3a5c; }
.flag-box.is-soft strong { color: var(--warn); }
.flag-box.is-cleared { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: #f1eefa; border-color: var(--line); color: var(--ink-3); }
.flag-who { font-weight: 700; }
.flag-why { white-space: pre-line; }
.flag-src { font-size: 12px; opacity: 0.8; }
.flag-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.ci-card.is-flagged { border-color: rgba(176, 18, 79, 0.3); box-shadow: inset 4px 0 0 var(--danger), var(--shadow-sm); }
.ci-sub.ci-flag { color: var(--danger); font-weight: 600; }
.scanner-result.is-flag { background: linear-gradient(135deg, #b0124f, #7a0f3a); }
.ec-flag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: 700; white-space: nowrap; }
.evl-sub .ec-flag { margin-right: 4px; }
.modal-foot .foot-start { margin-right: auto; }
.btn-quiet-danger { color: var(--danger); background: transparent; border-color: rgba(176, 18, 79, 0.3); }
.btn-quiet-danger:hover { background: var(--danger-bg); color: var(--danger); }

/* Review tab: one card per person */
.rv-head { display: grid; gap: 14px; }
.rv-intro { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.rv-intro h2 { margin: 0 0 4px; font-size: 19px; }
.rv-seg { flex-wrap: wrap; width: fit-content; max-width: 100%; }
.rv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rv-tools input[type="search"], .rv-tools select { min-height: 42px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--field); font-size: 14px; }
.rv-tools input[type="search"] { flex: 1 1 240px; min-width: 0; }
.rv-tools input:focus, .rv-tools select:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); }
.rv-flag-only b { background: var(--danger-bg); color: var(--danger); }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-bottom: 18px; }
.rv-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-lg); outline: none;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-md);
  animation: rise-in 0.3s var(--ease-out) backwards;
  transition: box-shadow var(--t-med) var(--ease-out), opacity 0.22s ease, translate 0.22s var(--ease-out), scale 0.22s var(--ease-out);
}
.rv-card:hover { box-shadow: var(--shadow-lg); }
.rv-card:focus-visible { box-shadow: 0 0 0 3px rgba(176, 18, 79, 0.55), var(--shadow-lg); }
.rv-card.is-flagged { border-color: rgba(176, 18, 79, 0.38); }
.rv-card.is-flagged-soft { border-color: rgba(94, 74, 114, 0.5); }
.rv-card.is-leaving { opacity: 0; translate: 0 -10px; scale: 0.97; pointer-events: none; }
.rv-card header { display: flex; align-items: flex-start; gap: 12px; }
.rv-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; background: var(--grad); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.rv-card.st-approved .rv-avatar { background: var(--grad-ok); }
.rv-card.st-rejected .rv-avatar { background: #422082; }
.rv-who { flex: 1; min-width: 0; }
.rv-who h3 { margin: 0; font-family: var(--font-display); font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.rv-who p { margin: 3px 0 0; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.rv-status { flex-shrink: 0; padding: 4px 10px; border-radius: 4px; background: #e5e7eb; color: #1f1633; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.rv-status.st-approved { background: var(--ok-bg); color: var(--ok); }
.rv-status.st-rejected { background: var(--danger-bg); color: var(--danger); }
.rv-status.st-waitlisted { background: var(--warn-bg); color: var(--warn); }
.rv-flag { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--danger-bg); color: #b0124f; font-size: 13px; line-height: 1.45; }
.rv-flag svg { flex-shrink: 0; margin-top: 1px; color: var(--danger); }
.rv-flag.is-soft { background: var(--warn-bg); color: #4a3a5c; }
.rv-flag.is-soft svg { color: var(--warn); }
.rv-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.rv-facts > div { min-width: 0; }
.rv-facts .rv-wide { grid-column: 1 / -1; }
.rv-facts dt { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.rv-facts dd { margin: 2px 0 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.rv-decided { margin: 0; font-size: 12px; color: var(--ink-3); }
.rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.rv-btn {
  display: inline-flex; flex: 1 1 110px; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 16px;
  border: 1px solid transparent; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-std), box-shadow var(--t-fast) var(--ease-std);
}
.rv-btn:active { transform: scale(0.97); }
.rv-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.rv-btn.is-approve { background: var(--grad-ok); color: #fff; box-shadow: 0 10px 22px -12px rgba(58, 79, 0, 0.8); }
.rv-btn.is-approve:hover { background: linear-gradient(115deg, #3a4f00, #3a4f00); }
.rv-btn.is-reject { background: #fff; color: var(--danger); border-color: rgba(176, 18, 79, 0.35); }
.rv-btn.is-reject:hover { background: var(--danger-bg); }
.rv-extra { display: flex; justify-content: flex-end; gap: 16px; width: 100%; }
.rv-empty { display: grid; place-items: center; gap: 8px; padding: 44px 20px; text-align: center; color: var(--ink-3); }
.rv-empty svg { color: var(--ok); }
.rv-empty p { margin: 0; font-size: 14px; }
.rv-more { display: flex; justify-content: center; margin-bottom: 14px; }
.rv-keys { margin: 0 0 18px; text-align: center; font-size: 12px; color: var(--ink-3); }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: #fff; font-family: var(--font-mono); font-size: 12px; text-align: center; color: var(--ink-2); }
.rv-undo { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%; margin: 0 auto; padding: 11px 16px; border-radius: 12px; background: rgba(47, 23, 96, 0.92); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 20px 40px -18px rgba(47, 23, 96, 0.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: rv-undo-in 0.3s var(--ease-spring) backwards; }
.rv-undo .link-btn { color: #b0124f; font-size: 14px; text-decoration-color: rgba(241, 238, 250, 0.5); }
@keyframes rv-undo-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 640px) {
  .rv-facts { grid-template-columns: 1fr; }
  .rv-intro .btn { width: 100%; justify-content: center; }
  .rv-keys { display: none; }
}

/* Blacklist page */
.bl-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 22px; background: linear-gradient(135deg, rgba(254, 232, 240, 0.92), rgba(241, 238, 250, 0.88)); }
.bl-hero h2 { margin-bottom: 6px; font-size: 19px; }
.bl-hero p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.bl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bl-stat { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.82); border: 1px solid var(--line); }
.bl-stat b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.bl-stat span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.bl-stat.is-warn b { color: var(--danger); }
.bl-last { margin: -4px 0 12px; }
.bl-table td { vertical-align: top; }
.bl-table .ci-sub { display: block; max-width: 220px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.bl-table .cell-wrap { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; width: max-content; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.bl-table .cell-strong { font-weight: 600; color: var(--ink); }
.bl-table td, .bl-table th { padding-left: 10px; padding-right: 10px; }
.bl-table .w-name, .bl-table .w-company { max-width: 170px; }
.bl-table .ci-sub { max-width: 190px; }
.bl-table .w-email { max-width: 220px; }
.bl-table .w-entry { max-width: 220px; }
.bl-table .ci-sub.bl-person { max-width: 260px; }
.bl-table .bl-mobile { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bl-table .w-notes { max-width: 210px; -webkit-line-clamp: 3; line-clamp: 3; }
.bl-sec-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.bl-sec-head h2 { margin: 0; }
.bl-alerts .tpl-save { display: flex; justify-content: flex-start; }
.bl-form .bl-wide { grid-column: 1 / -1; }
.bl-match-list { display: grid; gap: 10px; margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
@media (max-width: 860px) { .bl-hero { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .rv-card, .flag-banner, .rv-undo { animation-duration: 0.15s; animation-name: fade-in-only; }
  .rv-card { transition: opacity 0.15s ease; }
  .rv-card.is-leaving { translate: none; scale: none; }
  .rv-btn:active { transform: none; }
}
@keyframes fade-in-only { from { opacity: 0; } to { opacity: 1; } }
.event-card .ec-flagline { display: block; margin-top: 6px; }

/* Pinned events (each person's own priorities; admin.js pinButton / togglePin). */
.pin-btn { flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; margin: -4px 0; padding: 0; border: none; border-radius: 8px; background: transparent; color: inherit; opacity: 0; cursor: pointer; transition: opacity var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
.pin-btn svg { transition: transform var(--t-fast) var(--ease-out); }
.pin-btn.is-pinned { opacity: 1; color: #5e4a72; }
.pin-btn.is-pinned svg { fill: currentColor; transform: rotate(-25deg); }
.pin-btn:focus-visible { opacity: 1; outline: none; box-shadow: 0 0 0 2px rgba(241, 238, 250, 0.9); }
.sidebar .nav-item:hover .pin-btn, .sidebar .nav-item:focus-within .pin-btn { opacity: 0.7; }
.sidebar .nav-item .pin-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }
.sidebar .nav-item .pin-btn.is-pinned { opacity: 1; }
.sidebar .nav-item.active .pin-btn.is-pinned { color: #fff; }
.event-card .pin-btn { pointer-events: auto; position: relative; z-index: 2; color: var(--ink-3); opacity: 0.45; }
.event-card:hover .pin-btn, .event-card .pin-btn:focus-visible { opacity: 0.85; }
.event-card .pin-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.event-card .pin-btn.is-pinned { opacity: 1; color: #5e4a72; }
.event-card.is-pinned { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px rgba(94, 74, 114, 0.35); }
.evl-pin { display: inline-grid; place-items: center; color: #5e4a72; margin-right: 6px; vertical-align: -1px; }
.evl-pin svg { transform: rotate(-25deg); }
.pin-head { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 4px; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.pin-head:hover { color: var(--ink); }
.pin-head:active { transform: scale(0.96); }
.pin-head:focus-visible { outline: none; box-shadow: var(--ring); }
.pin-head.is-pinned { color: #5e4a72; background: #f1edf5; border-color: #5e4a72; }
.pin-head.is-pinned svg { fill: currentColor; transform: rotate(-25deg); }
.ev-group-pinned .ev-group-head h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #5e4a72; vertical-align: 2px; }
@media (hover: none) { .sidebar .nav-item .pin-btn:not(.is-pinned) { opacity: 0.5; } .event-card .pin-btn { opacity: 0.85; } }
@media (max-width: 760px) { .sidebar .pin-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { .pin-btn svg, .pin-head { transition: none; } }

/* Review tab: List layout (2026-10-15) */
.rv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.rv-layout .seg-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rv-layout .seg-btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(47, 23, 96, 0.12); }
.rv-layout .seg-btn[aria-pressed="true"] svg { color: #b0124f; }
.rv-list { padding: 6px; display: grid; gap: 2px; }
.rv-card.rv-row {
  display: grid; grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1.3fr) 120px auto; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 12px; background: transparent; border: 1px solid transparent; box-shadow: none; animation-duration: 0.2s;
}
.rv-card.rv-row:hover { background: rgba(176, 18, 79, 0.05); box-shadow: none; }
.rv-card.rv-row:focus-visible { background: #fff; box-shadow: 0 0 0 2px rgba(176, 18, 79, 0.55); }
.rv-card.rv-row.is-flagged { background: #fee8f0; box-shadow: inset 3px 0 0 var(--danger); border-color: transparent; }
.rv-card.rv-row.is-flagged-soft { box-shadow: inset 3px 0 0 #5e4a72; border-color: transparent; }
.rv-card.rv-row.is-leaving { translate: -12px 0; scale: 1; }
.rv-row .rv-avatar { width: 36px; height: 36px; border-radius: 8px; font-size: 12px; }
.rv-row-who, .rv-row-contact, .rv-row-state { display: grid; gap: 2px; min-width: 0; }
.rv-row-who strong { font-size: 14px; overflow-wrap: anywhere; }
.rv-row-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.rv-row small { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-row-contact > span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-row-state { justify-items: start; }
.rv-row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rv-row .rv-btn { flex: 0 0 auto; min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.rv-row-more { display: flex; gap: 10px; margin-left: 4px; }
@media (max-width: 980px) {
  .rv-card.rv-row { grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 8px; }
  .rv-row-contact { grid-column: 2 / -1; grid-row: 2; }
  .rv-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
/* Source filter: the toolbar select and the clickable "Where registrations came from" rows. */
#filter-source.is-set { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(176, 18, 79, 0.12); }
.utm-row[data-utm-filter] { cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast); }
.utm-row[data-utm-filter]:hover { border-color: var(--line-2); background: #fff; }
.utm-row[data-utm-filter]:focus-visible { outline: none; box-shadow: var(--ring); }
.utm-row.on { border-color: rgba(176, 18, 79, 0.55); background: #fff; box-shadow: 0 0 0 2px rgba(176, 18, 79, 0.18); opacity: 1; }

/* ------------------------------------------------------------------
   Self check-in kiosk (2026-10-15, admin-kiosk.js): a guest-facing,
   full-screen screen. Big type, the event banner behind, one message
   at a time.
------------------------------------------------------------------ */
body.kz-open { overflow: hidden; }
.kz { position: fixed; inset: 0; z-index: 400; display: grid; grid-template-rows: auto 1fr auto; color: #fff; font-family: var(--font-display); background: #2f1760; user-select: none; -webkit-user-select: none; }
.kz-bg { position: absolute; inset: 0; background: var(--grad) center / cover no-repeat; transform: scale(1.06); filter: saturate(1.1) blur(2px); }
.kz-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(47, 23, 96, .55) 0%, rgba(47, 23, 96, .72) 55%, rgba(47, 23, 96, .9) 100%); }
.kz-head, .kz-main, .kz-foot { position: relative; z-index: 1; }
.kz-head { padding: clamp(20px, 4vh, 44px) clamp(20px, 5vw, 64px) 0; text-align: center; }
.kz-event { font-weight: 700; font-size: clamp(22px, 3.4vw, 40px); letter-spacing: 0; line-height: 1.15; text-shadow: 0 2px 18px rgba(0, 0, 0, .4); }
.kz-when { margin-top: 6px; font-family: var(--font-body, inherit); font-size: clamp(14px, 1.7vw, 20px); opacity: .85; }
.kz-main { align-self: center; justify-self: center; width: min(760px, calc(100vw - 40px)); padding: clamp(28px, 5vh, 56px) clamp(24px, 4vw, 56px); border-radius: 32px; text-align: center;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  animation: kz-in .35s var(--ease-out) backwards; }
.kz-main h1 { margin: 14px 0 0; font-size: clamp(32px, 5.4vw, 64px); line-height: 1.08; letter-spacing: 0; }
.kz-main h2 { margin: 18px 0 0; font-size: clamp(24px, 3.4vw, 40px); }
.kz-lead { margin: 14px auto 0; max-width: 560px; font-family: var(--font-body, inherit); font-size: clamp(18px, 2.3vw, 26px); line-height: 1.4; opacity: .95; }
.kz-sub { margin: 10px 0 0; font-family: var(--font-body, inherit); font-size: clamp(15px, 1.8vw, 20px); opacity: .75; }
.kz-icon { display: inline-grid; place-items: center; width: clamp(96px, 13vw, 132px); height: clamp(96px, 13vw, 132px); border-radius: 50%; background: rgba(255, 255, 255, .14); }
.kz-main.is-idle .kz-icon { animation: kz-pulse 2.4s ease-in-out infinite; }
.kz-main.is-ok { background: linear-gradient(150deg, rgba(58, 79, 0, .92), rgba(58, 79, 0, .9)); border-color: rgba(74, 101, 0, .5); }
.kz-main.is-desk { background: linear-gradient(150deg, rgba(94, 74, 114, .94), rgba(94, 74, 114, .92)); border-color: rgba(94, 74, 114, .5); }
.kz-main.is-again { background: linear-gradient(150deg, rgba(66, 32, 130, .92), rgba(66, 32, 130, .9)); border-color: rgba(66, 32, 130, .5); }
.kz-spinner { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: kz-spin .8s linear infinite; }
.kz-video { position: absolute; z-index: 1; right: clamp(16px, 3vw, 40px); bottom: clamp(64px, 9vh, 96px); width: clamp(200px, 26vw, 340px); aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 3px solid rgba(255, 255, 255, .7); transform: scaleX(-1); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .7); }
.kz-input { position: absolute; left: -9999px; top: 0; width: 10px; height: 10px; opacity: 0; }
.kz-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 3vw, 32px) clamp(14px, 2.4vh, 24px); font-family: var(--font-body, inherit); font-size: 14px; opacity: .8; }
.kz-gear { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .7); cursor: pointer; position: relative; }
.kz-gear.is-holding::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid #fff; clip-path: inset(0 0 0 0); animation: kz-hold 2s linear forwards; }
.kz-print { position: fixed; left: -10000px; top: 0; width: 62mm; height: 100mm; border: 0; }
.kz-sheet { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(47, 23, 96, .6); padding: 20px; }
.kz-sheet-panel { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px 24px; border-radius: 12px; background: #fff; color: var(--ink); font-family: var(--font-body, inherit); user-select: text; display: grid; gap: 12px; }
.kz-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.kz-sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.kz-x { border: 0; background: #e5e7eb; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; color: var(--ink-2); }
.kz-note { margin: 0; font-size: 13px; color: var(--ink-3); }
.kz-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.kz-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #b0124f; }
.kz-check small { display: block; font-weight: 500; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.kz-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kz-field select { min-height: 42px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--field-line); font-size: 14px; background: #fff; }
.kz-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kz-actions.kz-end { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
.kz-log h3 { margin: 4px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kz-log ul { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; max-height: 160px; overflow: auto; }
@keyframes kz-in { from { opacity: 0; scale: .96; } to { opacity: 1; scale: 1; } }
@keyframes kz-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
@keyframes kz-spin { to { rotate: 360deg; } }
@keyframes kz-hold { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  .kz-main { animation-duration: .15s; animation-name: fade-in-only; }
  .kz-main.is-idle .kz-icon, .kz-spinner { animation: none; }
}

/* Column manager (2026-10-15): drag grips, quick sets, saved views, find box. */
.cols-menu { min-width: 320px; width: min(400px, calc(100vw - 24px)); max-height: min(78vh, 720px); }
.cols-title b { margin-left: 6px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.cols-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 8px; }
.cols-quick .chip-btn { border: 1px solid var(--line-2); background: #fff; border-radius: 4px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.cols-quick .chip-btn:hover { background: #f1eefa; border-color: rgba(176, 18, 79, 0.4); color: var(--info); }
.cols-views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; margin: 0 4px 8px; border-radius: 12px; background: #f1eefa; }
.cols-none { font-size: 12px; color: var(--ink-3); }
.view-chip { display: inline-flex; align-items: center; border-radius: 4px; background: #fff; border: 1px solid var(--line-2); overflow: hidden; }
.view-chip button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); padding: 4px 4px 4px 11px; cursor: pointer; }
.view-chip button:hover { color: var(--info); }
.view-chip .view-x { padding: 4px 9px 4px 5px; color: var(--ink-3); font-size: 15px; line-height: 1; }
.view-chip .view-x:hover { color: var(--danger); }
.cols-save { display: flex; gap: 6px; width: 100%; }
.cols-save input { flex: 1; min-width: 0; min-height: 32px; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--field-line); font: inherit; font-size: 13px; }
.cols-find { display: block; width: calc(100% - 16px); margin: 0 8px 6px; min-height: 34px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--field-line); font: inherit; font-size: 13px; }
.cols-list li { border-radius: 8px; transition: background-color var(--t-fast); }
.cols-list li.is-off .menu-check span, .cols-list li.is-off .cols-name { color: var(--ink-3); }
.cols-list li.is-dragging { background: #f1eefa; box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.45); position: relative; z-index: 1; }
.cols-grip { flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 30px; border: 0; background: none; color: var(--ink-3); border-radius: 8px; cursor: grab; touch-action: none; }
.cols-grip:hover { color: var(--info); background: #f1eefa; }
.cols-grip:focus-visible { outline: none; box-shadow: var(--ring); color: var(--info); }
.cols-list li.is-dragging .cols-grip { cursor: grabbing; }
body.col-list-dragging { cursor: grabbing; user-select: none; }
.cols-formview small { display: block; font-size: 12px; color: var(--ink-3); }

/* ---- Guided tour (admin-tour.js) ---- */
.tour-root { position: fixed; inset: 0; z-index: 200; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(47, 23, 96, 0.62), 0 0 0 3px #fff; pointer-events: none; transition: top .25s var(--ease-out), left .25s var(--ease-out), width .25s var(--ease-out), height .25s var(--ease-out); }
.tour-card { position: fixed; width: 340px; max-width: calc(100vw - 24px); padding: 18px 18px 14px; border-radius: 12px; background: #fff; color: var(--text); border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(47, 23, 96, 0.55); outline: none; }
.tour-count { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3, #5f5870); }
.tour-title { margin: 4px 0 6px; font-size: 17px; }
.tour-text { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.tour-off { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 12px; color: var(--text-3, #5f5870); }
.tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tour-sp { flex: 1; }
.tour-offer { position: fixed; z-index: 190; right: 20px; bottom: 20px; width: 320px; max-width: calc(100vw - 32px); display: grid; gap: 6px; padding: 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(47, 23, 96, 0.45); animation: rise-in 0.3s var(--ease-out) both; }
.tour-offer span { font-size: 14px; color: var(--text-3, #5f5870); margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } .tour-offer { animation: none; } }

/* Column manager, bulk + per-session (2026-10-15) */
.cols-list li { min-height: 34px; padding-right: 2px; }
.cols-pick { flex-shrink: 0; width: 16px; height: 16px; margin: 0 4px 0 2px; accent-color: var(--info); cursor: pointer; }
.cols-name { flex: 1; min-width: 0; padding: 6px 4px; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.cols-name small { display: block; font-size: 12px; color: var(--ink-3); }
.cols-eye { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--info); cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.cols-eye:hover { background: #f1eefa; }
.cols-eye:focus-visible { outline: none; box-shadow: var(--ring); }
.cols-list li.is-off .cols-eye { color: var(--ink-3); opacity: 0.75; }
.cols-list li.is-picked { background: #f1eefa; }
.cols-list li.is-riding { opacity: 0.45; }
.cols-list li.is-group { position: relative; }
.cols-list li.is-group::after { content: attr(data-count); position: absolute; right: 40px; top: 50%; translate: 0 -50%; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--info); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.cols-selrow { display: flex; align-items: center; gap: 8px; padding: 2px 10px 6px; font-size: 12px; color: var(--ink-3); }
.cols-bulk { position: sticky; top: -6px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 0 4px 6px; padding: 6px 6px 6px 4px; border-radius: 12px; background: #2f1760; color: #fff; box-shadow: 0 8px 20px -12px rgba(47, 23, 96, 0.8); }
.cols-bulk-n { font-size: 12px; font-weight: 700; margin-right: 4px; }
.cols-bulk button { display: inline-grid; place-items: center; min-width: 27px; height: 26px; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 4px; padding: 0 8px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background-color var(--t-fast); }
.cols-bulk button svg { width: 14px; height: 14px; }
.cols-bulk button:hover { background: rgba(255, 255, 255, 0.24); }
.cols-bulk button:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff; }
.cols-bulk .cols-bulk-x { min-width: 22px; border: 0; background: none; font-size: 16px; line-height: 1; padding: 0 4px; }
.cols-bulk .cols-bulk-n { margin-right: 6px; }
.cols-scope { margin: 0 4px 8px; padding: 7px 10px; border-radius: 12px; background: #f1eefa; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.cols-scope p { margin: 0; }
.cols-scope b { color: var(--ink); }
.cols-scope small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.cols-menu .cols-formview { padding: 6px 8px; }
.cols-scope-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
body.col-list-dragging { cursor: grabbing; user-select: none; }
@media (prefers-reduced-motion: reduce) { .cols-eye, .cols-bulk button { transition: none; } }

/* ---- Booth Quest 2 (admin-quest.js, 2026-10-17) ---- */
.qa-logo { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 28%; overflow: hidden; font-family: var(--font-display, inherit); font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07); }
.qa-logo.has-img img { width: 78%; height: 78%; object-fit: contain; }
/* Wordmarks (QuestArt.logo): a wider plate, or the full width of a square one. */
.qa-logo.has-img.wide img { width: 86%; height: 64%; }
.qa-logo.has-img.fill-w img, .qa-logo.has-img.fill-h img { width: 90%; height: 90%; }
.qa-stamp { display: block; width: 100%; height: 100%; }
.hint-inline { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.qs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.qs-main { min-width: 0; }
.qs-preview { position: sticky; top: 16px; display: grid; gap: 10px; }
.qs-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qs-phone { width: 340px; max-width: 100%; height: 640px; margin: 0 auto; border-radius: 34px; padding: 10px; background: #2f1760; box-shadow: 0 30px 60px -30px rgba(47, 23, 96, 0.6), inset 0 0 0 2px #1f1633; }
.qs-phone iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #1f1633; }
.qs-pick { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); }
.qs-pick-img { flex-shrink: 0; width: 120px; height: 68px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: repeating-conic-gradient(#e5e7eb 0 25%, #fff 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line); }
.qs-pick-img img { width: 100%; height: 100%; object-fit: contain; }
.qs-pick-img span { font-size: 12px; color: var(--ink-3); }
.qs-pick strong { font-size: 14px; }
.qs-pick .hint { margin: 2px 0 6px; }
.qs-layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.qs-lay-thumb { width: 54px; height: 72px; margin-bottom: 6px; }
.qs-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qs-color { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.qs-color input[type="color"] { width: 44px; height: 34px; padding: 2px; border-radius: 8px; }
.qs-color small { color: var(--ink-3); font-size: 12px; }
.qbe-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.qbe-type { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.qbe-type strong { font-size: 14px; color: var(--ink); }
.qbe-type span { font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.qbe-type.on { border-color: transparent; box-shadow: 0 0 0 2px var(--violet); background: var(--info-bg); }
.qbe-logo { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.qbe-logo > div { flex: 1; min-width: 240px; }
.qbe-logo-prev { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #1f1633; }
.qbe-paper { width: 92px; height: 92px; border-radius: 12px; padding: 4px; background: #f1edf5; }
.qbe-paper .qa-stamp { mix-blend-mode: multiply; }
.qbe-lucky { display: grid; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.qbe-lucky-h, .qbe-lucky-r { min-width: 560px; }
.qbe-lucky-h, .qbe-lucky-r { display: grid; grid-template-columns: minmax(0, 2fr) 76px 96px 84px 70px 30px; gap: 6px; align-items: center; }
.qbe-lucky-h span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.qbe-chance { display: flex; align-items: center; gap: 4px; }
.qbe-chance input { min-width: 0; }
.qbe-chance small { font-size: 12px; color: var(--ink-3); width: 32px; }
.qbe-2col { grid-template-columns: 1fr 1fr; }
.pic-list { display: grid; gap: 8px; }
.pic-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); }
.pic-link { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--info-bg); }
.pic-link p { margin: 0 0 6px; }
.ps-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.ps-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ps-preview { height: 430px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #f1eefa; }
.ps-preview iframe { width: 100%; height: 100%; border: 0; }
.eg-booth { display: flex; align-items: center; gap: 10px; }
.eg-team { display: flex; flex-wrap: wrap; gap: 4px; }
.qr-frame.qr-styled svg { width: 220px; height: 220px; }
@media (max-width: 1100px) { .qs-grid { grid-template-columns: 1fr; } .qs-preview { position: static; } }
@media (max-width: 760px) { .qs-layouts, .qs-modes, .ps-grid, .ps-formats, .qbe-2col { grid-template-columns: 1fr; } .qs-phone { height: 560px; } }
.qs-pick label.btn, .qbe-logo label.btn { display: inline-flex; width: auto; }
.fg label > .hint-inline { display: inline; }
.pic-row > div:first-child { flex: 1 1 220px; min-width: 0; }
.pic-row .pz-actions { flex: 0 1 auto; min-width: 0; }
.pic-link .link-row { flex-wrap: wrap; }
.pic-link .link-row input { flex-basis: 220px; }

/* Live preview: phone width (Messaging > Email templates) */
.preview-bar .pv-size { flex: none; }
.tpl-preview.is-mobile .email-frame { width: min(399px, 100%); margin: 0 auto; border: 12px solid #1f1633; border-radius: 40px; background: #fff; }

/* Email previews for approval (email-pack.js) */
.pack-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.pack-kind { justify-content: flex-start; }
.pack-kind span { flex: 1; }
.pack-st { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pack-st.on { color: #3a4f00; }
.pack-st.manual { color: #b0124f; }
.pack-quick { font-size: 13px; color: var(--ink-3); margin-top: -4px; }
.pack-row { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.pack-row .sub-h { margin-bottom: 6px; }
#pack-foot .btn svg { vertical-align: -3px; margin-right: 2px; }
@media (max-width: 560px) { .pack-kinds { grid-template-columns: minmax(0, 1fr); } }

/* Rejection reasons (2026-10-20, admin-reasons.js) */
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #b0124f; color: #fff; border-color: transparent; }
.rr-panel { width: min(560px, calc(100vw - 24px)); }
.rr-body { display: grid; gap: 16px; max-height: min(64vh, 620px); overflow-y: auto; }
.rr-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.rr-group legend { padding: 0 0 8px; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--ink); }
.rr-group legend span { margin-left: 6px; font-family: var(--font-body, inherit); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.rr-list { display: grid; gap: 6px; }
.rr-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.rr-opt:hover { border-color: rgba(176, 18, 79, 0.4); }
.rr-opt.is-on { border-color: rgba(176, 18, 79, 0.55); background: #fee8f0; }
.rr-opt input { margin-top: 3px; accent-color: var(--danger); flex-shrink: 0; }
.rr-opt b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.rr-opt b em { margin-left: 6px; padding: 1px 7px; border-radius: 4px; background: #f1edf5; color: #5e4a72; font-size: 12px; font-style: normal; font-weight: 700; }
.rr-opt small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
.rr-note { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rr-note textarea { width: 100%; min-height: 54px; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; font-size: 14px; font-weight: 400; resize: vertical; }
.rr-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 13px; }
.rr-table th, .rr-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.rr-table th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.rr-table td + td, .rr-table th + th { text-align: right; white-space: nowrap; }
.rr-notes { margin-top: 10px; font-size: 13px; }
.rr-notes summary { cursor: pointer; font-weight: 600; color: var(--info); }
.rr-notes ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-height: 260px; overflow-y: auto; }
.rr-notes li span { color: var(--ink-3); }
.rr-notes li p { margin: 2px 0 0; color: var(--ink-2); }
.rv-reason { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 2px 8px; padding: 8px 12px; border-radius: 12px; background: #fee8f0; border: 1px solid rgba(176, 18, 79, 0.18); font-size: 13px; }
.rv-reason > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #b0124f; }
.rv-reason b { font-weight: 600; color: var(--ink); }
.rv-reason p { grid-column: 1 / -1; margin: 0; color: var(--ink-2); }
.rv-row-reason { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b0124f !important; }
.rv-reasons-btn { white-space: nowrap; }
.rs-panel .rs-body { display: grid; gap: 12px; max-height: min(68vh, 700px); overflow-y: auto; }
.rs-req { padding: 8px 10px; border-radius: 12px; background: var(--grad-soft); }
.rs-req small, .rs-sec header small { display: block; font-size: 12px; color: var(--ink-3); }
.rs-sec { padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; }
.rs-sec.is-on { border-color: rgba(176, 18, 79, 0.3); }
.rs-sec header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rs-sec header select { padding: 6px 8px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; }
.rs-list { margin: 10px 0 6px; padding-left: 22px; display: grid; gap: 6px; }
.rs-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.rs-list input { min-width: 0; min-height: 32px; padding: 5px 9px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; font-size: 13px; }
.rs-tools { display: inline-flex; gap: 3px; }
.rs-tools .icon-mini { width: 28px; height: 28px; font-size: 13px; }
@media (max-width: 640px) { .rs-list li { grid-template-columns: 1fr; } .rs-tools { justify-self: end; } }
@media (prefers-reduced-motion: reduce) { .rr-opt { transition: none; } }
/* .modal-form label is a stacked grid; these two dialogs lay theirs out in a row. */
.rr-panel .modal-form .rr-opt { display: flex; gap: 10px; font-size: inherit; font-weight: 400; }
.rr-panel .modal-form .rr-opt input { width: 16px; height: 16px; margin: 2px 0 0; }
.rr-panel .modal-form .rr-note { display: grid; }
.rs-panel .modal-form label.menu-check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--ink); }
.rs-panel .modal-form label.menu-check input { margin-top: 2px; flex-shrink: 0; }
.rs-panel .modal-form label.menu-check b, .rs-panel .modal-form label.menu-check > span { font-weight: 600; font-size: 14px; }
.rs-panel .modal-form .rs-list input[type="text"] { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.rs-panel .modal-form .rs-sec header select { width: auto; min-width: 180px; padding: 6px 8px; font-size: 13px; }

/* ---------------- Live room (admin-room.js) ---------------- */
.room-code { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; background: #f1eefa; color: var(--info); padding: 3px 8px; border-radius: 8px; }
.room-tpls { display: grid; gap: 10px; }
.room-tpl { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.room-tpl:hover { border-color: var(--violet); }
.room-tpl:active { transform: scale(0.99); }
.room-tpl strong { font-family: var(--font-display); font-size: 15px; }
.room-tpl span { font-size: 13px; color: var(--ink-3); }
.room-polls { display: grid; gap: 10px; }
.room-poll { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #f1eefa; }
.room-poll .qbe-2col { grid-template-columns: 1fr 1fr; }
.room-themes { display: grid; gap: 6px; }
.room-theme { display: grid; grid-template-columns: 30px 1fr 44px 110px 32px; gap: 6px; align-items: center; }
.room-theme-ic { width: 30px; height: 30px; padding: 6px; border-radius: 8px; color: var(--tc); background: #2f1760; box-shadow: inset 0 0 0 1px var(--tc); }
.room-theme input[type="color"] { padding: 2px; height: 34px; }
.room-cards { display: grid; gap: 6px; }
.room-cardrow { display: grid; grid-template-columns: 170px 1fr 32px; gap: 6px; align-items: center; }
.room-fieldrow { display: grid; grid-template-columns: 1fr 1fr auto auto 32px; gap: 8px; align-items: center; }
@media (max-width: 720px) { .room-cardrow, .room-fieldrow, .room-theme { grid-template-columns: 1fr 32px; } .room-theme-ic { display: none; } }

body.rc-open { overflow: hidden; }
.rc { position: fixed; inset: 0; z-index: 48; display: grid; grid-template-rows: auto auto 1fr; background: #e5e7eb; animation: modal-panel-in 0.2s var(--ease-out, ease-out); }
.rc-loading { display: grid; place-items: center; gap: 12px; height: 100%; color: var(--ink-3); }
.rc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; background: #2f1760; color: #fff; }
.rc-top .btn { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.18); }
.rc-top .btn:hover { background: rgba(255, 255, 255, 0.16); }
.rc-title { display: grid; line-height: 1.2; }
.rc-title strong { font-family: var(--font-display); font-size: 16px; }
.rc-title span { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.rc-code, .rc-people { font-size: 13px; color: rgba(255, 255, 255, 0.75); padding: 4px 10px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
.rc-code b { font-family: var(--font-mono); color: #fff; letter-spacing: 0.08em; font-size: 15px; }
.rc-people b { color: #fff; }
.rc-sp { flex: 1; }
.rc-modes { display: flex; gap: 4px; padding: 8px 20px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.rc-mode { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.rc-mode:hover { background: #f1eefa; }
.rc-mode.on { background: #f1eefa; color: var(--info); }
.rc-mode em { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #fff; background: #4a6500; padding: 2px 7px; border-radius: 4px; }
.rc-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--danger); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.rc-body { display: grid; grid-template-columns: 1fr 352px; gap: 18px; padding: 18px 20px; overflow: hidden; min-height: 0; }
.rc-main { overflow-y: auto; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; min-height: 0; }
.rc-side { display: grid; align-content: start; gap: 14px; overflow-y: auto; min-height: 0; }
.rc-preview { padding: 12px; border-radius: 12px; background: #2f1760; }
.rc-preview > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); margin-bottom: 8px; }
.rc-frame { position: relative; width: 320px; height: 180px; overflow: hidden; border-radius: 8px; background: #2f1760; }
.rc-frame iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; transform: scale(0.25); transform-origin: 0 0; pointer-events: none; }
.rc-help { font-size: 13px; line-height: 1.6; color: var(--ink-2); padding: 14px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.rc-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-h h3 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.rc-h h4 { margin: 0; }
.rc-sec { margin-top: 18px; }
.rc-sec h4 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.rc-sec summary { font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; margin-bottom: 8px; }
.rc-q { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: #fff; }
.rc-q.hl { border-color: #4a6500; box-shadow: 0 0 0 2px rgba(74, 101, 0, 0.18); background: #f1fad9; }
.rc-q.hidden { opacity: 0.5; }
.rc-q .v { font-family: var(--font-display); font-size: 18px; font-weight: 700; text-align: center; color: var(--info); background: #f1eefa; border-radius: 8px; padding: 6px 0; }
.rc-q .t p { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rc-q .t small { font-size: 12px; color: var(--ink-3); }
.rc-q .a { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rc-poll { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.rc-poll.active { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(176, 18, 79, 0.15); }
.rc-poll-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rc-poll-h p { margin: 6px 0 2px; font-weight: 700; font-size: 14.5px; }
.rc-poll-h small { color: var(--ink-3); font-size: 12px; }
.rc-bars { display: grid; gap: 4px; margin-top: 10px; }
.rc-bars div { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; font-size: 13px; border-radius: 8px; background: #f1eefa; overflow: hidden; isolation: isolate; }
.rc-bars i { position: absolute; left: 0; top: 0; bottom: 0; z-index: -1; background: #f1eefa; border-radius: 8px; transition: width 0.4s var(--ease-out, ease-out); }
.rc-words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rc-words span { font-size: 13px; padding: 3px 10px; border-radius: 4px; background: #f1eefa; color: var(--info); }
.rc-open { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.rc-theme { --tc: #422082; margin-bottom: 14px; }
.rc-theme h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.rc-theme h4 .ra-ic { width: 22px; height: 22px; padding: 4px; border-radius: 7px; color: var(--tc); background: #2f1760; }
.rc-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.rc-mini { position: relative; text-align: left; padding: 10px 12px 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 8px; background: #fff; font-size: 13px; line-height: 1.4; color: var(--ink); transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast); }
.rc-mini:hover { box-shadow: 0 4px 14px -6px rgba(47, 23, 96, 0.25); }
.rc-mini:active { transform: scale(0.98); }
.rc-mini.used { opacity: 0.5; }
.rc-mini em { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.rc-h .pz-actions input { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; width: 220px; }
.rc-current { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.rc-cardprev .ra-card { width: 220px; font-size: 12px; }
.rc-cardctl { display: grid; gap: 12px; }
.rc-cardctl label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.rc-cardctl input { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 14px; }
.rc-phases { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 12px; background: #f1eefa; width: fit-content; }
.rc-phase { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.rc-phase.on { background: #2f1760; color: #fff; }
.rc-notes { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; font: inherit; font-size: 14px; line-height: 1.55; resize: vertical; }
.rc-synth { padding: 14px 16px; border-radius: 12px; background: linear-gradient(160deg, #f1eefa, #fff 60%); border: 1px solid #f1eefa; font-size: 14px; }
.rc-synth-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rc-synth-h strong { font-family: var(--font-display); font-size: 16px; }
.rc-synth h5 { margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.rc-synth ol, .rc-synth ul { margin: 0; padding-left: 20px; }
.rc-synth li { margin: 2px 0; }
.rc-synth .pz-actions { margin-top: 10px; }
.rc-syncard { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.rc-syncard p { margin: 0; font-size: 13px; }
.rc-danger { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.rc-danger .link-btn { color: var(--danger); text-decoration-color: rgba(176, 18, 79, 0.35); }
@media (max-width: 1000px) {
  .rc-body { grid-template-columns: 1fr; overflow-y: auto; }
  .rc-main { overflow: visible; }
  .rc-current { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .rc { animation: none; } .rc-bars i { transition: none; } }

/* Booth logo upload status (admin-quest.js editBooth). */
.qbe-logo-msg { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.qbe-logo-msg.busy { background: #f1eefa; color: var(--info); }
.qbe-logo-msg.ok { background: var(--ok-bg, #f1fad9); color: var(--ok, #3a4f00); }
.qbe-logo-msg.err { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
