:root {
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Tight", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ink: #12122b;
  --ink-2: #34364f;
  --muted: #5f6279;
  --placeholder: #6c6f87;
  --line: #e7e7f1;
  --line-strong: #d6d7e5;
  --canvas: #f7f7fc;
  --surface: #ffffff;
  --surface-2: #fafafe;
  --brand: #5454e8;
  --brand-strong: #4141c9;
  --brand-soft: #eeeeff;
  --brand-tint: #f6f6ff;
  --violet: #8b5cf6;
  --success: #0e7a43;
  --success-soft: #e8f7ef;
  --warning: #855000;
  --warning-soft: #fff5e3;
  --danger: #b42330;
  --danger-soft: #fff0f1;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(18, 18, 43, .05);
  --shadow-card: 0 1px 2px rgba(18, 18, 43, .04), 0 12px 32px -18px rgba(39, 36, 120, .2);
  --shadow-pop: 0 22px 54px -24px rgba(39, 36, 120, .45);
  --sidebar-width: 256px;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 78% -240px, rgba(110, 104, 255, .16), transparent 70%),
    radial-gradient(760px 420px at 22% -180px, rgba(186, 170, 255, .2), transparent 72%),
    var(--canvas);
  background-repeat: no-repeat;
}
h1, h2, h3, p { margin-top: 0; }
a { color: var(--brand-strong); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(84, 84, 232, .45); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; border-radius: 10px;
  color: #fff; background: var(--brand-strong); font-weight: 600; transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar-width); display: flex; flex-direction: column;
  padding: 22px 16px 18px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(140%) blur(12px);
}
.brand {
  display: flex; align-items: center; gap: 11px; padding: 6px 10px 22px; color: var(--ink);
  font: 700 20px/1 var(--font-display); letter-spacing: -.02em; text-decoration: none;
}
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 11px; color: #fff;
  font-size: 17px; font-weight: 800;
  background: linear-gradient(140deg, #7a74ff 0%, #5454e8 55%, #8b5cf6 100%);
  box-shadow: 0 8px 18px -8px rgba(84, 84, 232, .75);
}
.brand-light { color: var(--brand); }
.sidebar-nav { display: grid; gap: 3px; }
.nav-label { margin: 18px 12px 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 1px solid transparent;
  border-radius: 10px; color: var(--ink-2); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.nav-item:hover { color: var(--ink); background: #f2f2fa; }
.nav-item.active { color: var(--brand-strong); background: var(--brand-soft); font-weight: 600; }
.nav-icon { width: 20px; height: 20px; flex: none; color: #75788f; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { color: var(--brand); }
.nav-create { margin: 4px 0; color: var(--brand-strong); border-color: #d9d8fb; border-style: dashed; background: var(--brand-tint); }
.nav-create:hover { background: var(--brand-soft); }
.nav-create.active {
  color: #fff; border: 1px solid transparent; background: linear-gradient(180deg, #5f5ff0, #4a4adb);
  box-shadow: 0 10px 20px -12px rgba(74, 74, 219, .9);
}
.nav-create.active .nav-icon { color: #fff; }
.sidebar-card {
  display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; color: var(--muted); background: linear-gradient(160deg, #fff, var(--brand-tint)); font-size: 12px;
}
.sidebar-card strong { display: block; color: var(--ink); font-size: 13px; }
.status-dot {
  width: 8px; height: 8px; flex: none; margin-top: 5px; border-radius: 50%; background: #22a565;
  box-shadow: 0 0 0 4px rgba(34, 165, 101, .16);
}
.main-content { min-height: 100vh; display: flex; flex-direction: column; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky; top: 0; z-index: 15; min-height: 68px; display: flex; align-items: center; gap: 20px; padding: 12px 40px;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .8); backdrop-filter: saturate(140%) blur(14px);
}
.breadcrumbs { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; }
.breadcrumbs strong { color: var(--ink); font-weight: 600; }
.crumb-separator { color: #b4b6c8; }
.global-search { position: relative; flex: 1; max-width: 440px; margin-left: auto; }
.global-search input { height: 42px; padding: 0 40px 0 42px; border-radius: 12px; background: var(--surface-2); }
.search-icon { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.global-search kbd {
  position: absolute; top: 50%; right: 10px; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line-strong);
  border-radius: 6px; color: var(--muted); background: #fff; font: 600 12px/18px var(--font-sans); text-align: center; transform: translateY(-50%);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.environment-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid #c9ebd8;
  border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 12px; font-weight: 600;
}
.environment-pill .status-dot { width: 7px; height: 7px; margin: 0; }
.environment-pill[data-tone="development"] { border-color: #f1dfb8; color: var(--warning); background: var(--warning-soft); }
.environment-pill[data-tone="other"] { border-color: var(--line-strong); color: var(--muted); background: #f0f0f6; }
[data-tone="development"] .status-dot { background: #d29a25; box-shadow: 0 0 0 4px rgba(210, 154, 37, .18); }
[data-tone="other"] .status-dot { background: var(--muted); box-shadow: 0 0 0 4px rgba(95, 98, 121, .14); }
.icon-button {
  width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 11px;
  color: var(--ink-2); background: #fff; cursor: pointer; box-shadow: var(--shadow-xs);
}
.icon-button:hover { color: var(--brand-strong); border-color: #c9c8f6; }
.icon-button svg { width: 18px; height: 18px; }
.avatar {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 50%; color: var(--brand-strong);
  background: var(--brand-soft); font-size: 13px; font-weight: 700;
}
.user-menu { position: relative; }
.user-button {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 3px 10px 3px 4px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink); background: #fff; cursor: pointer; box-shadow: var(--shadow-xs);
}
.user-button:hover { border-color: var(--line-strong); }
.user-name { max-width: 160px; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 16px; height: 16px; color: var(--muted); }
.user-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 280px; padding: 16px; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; box-shadow: var(--shadow-pop);
}
.user-menu-name { margin: 0; color: var(--ink); font-weight: 700; }
.user-menu-email { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.user-menu-meta { margin: 10px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px;
  color: var(--danger); background: transparent; font-size: 14px; font-weight: 600; cursor: pointer;
}
.menu-item:hover { background: var(--danger-soft); }
.menu-item svg { width: 18px; height: 18px; }
.page-content { width: 100%; max-width: 1320px; flex: 1; margin: 0 auto; padding: 40px 40px 32px; }
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--brand-strong); font-size: 12px;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.eyebrow-icon {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: #fff;
  background: linear-gradient(140deg, #6a66ff, #5454e8); box-shadow: 0 6px 14px -6px rgba(84, 84, 232, .7);
}
.eyebrow-icon:empty { display: none; }
.eyebrow-icon svg { width: 16px; height: 16px; color: #fff; }
h1 { margin: 0; color: var(--ink); font: 700 clamp(30px, 3.4vw, 44px)/1.08 var(--font-display); letter-spacing: -.035em; }
h2 { margin: 0; color: var(--ink); font: 700 22px/1.25 var(--font-display); letter-spacing: -.02em; }
h3 { margin: 0; color: var(--ink); font: 650 16px/1.3 var(--font-display); }
.accent { color: var(--brand); background: linear-gradient(92deg, #5454e8 0%, #7c5cf6 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.heading-period { color: var(--brand); -webkit-text-fill-color: currentColor; }
.subheading { max-width: 640px; margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.organization-picker {
  width: 260px; display: grid; flex: none; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.notice {
  margin: 0 0 24px; padding: 13px 16px; border: 1px solid #c9ebd8; border-radius: 12px; color: var(--success);
  background: var(--success-soft); font-size: 14px; overflow-wrap: anywhere;
}
.notice.error { border-color: #f2c7cb; color: var(--danger); background: var(--danger-soft); }

/* Controls */
label { display: grid; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; outline: none; color: var(--ink);
  background: #fff; font-size: 15px; font-weight: 400; transition: border-color .15s ease, box-shadow .15s ease;
}
input, select { height: 46px; padding: 0 14px; }
select {
  appearance: none; padding-right: 40px; background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6279' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
textarea { padding: 12px 14px; resize: vertical; }
textarea.code-input { font: 13px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; }
input:hover, select:hover, textarea:hover { border-color: #c4c5d8; }
input:focus, select:focus, textarea:focus { border-color: #9d98f4; box-shadow: 0 0 0 4px rgba(84, 84, 232, .14); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--brand); }
input[type="color"] { padding: 4px; cursor: pointer; }
input:disabled, select:disabled { color: var(--muted); background: var(--surface-2); cursor: not-allowed; }
.checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 46px; font-weight: 500; }
.optional-label { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.field-help { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 10px; font: 600 14px/1 var(--font-sans); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.button-primary {
  color: #fff; background: linear-gradient(180deg, #5f5ff0, #4a4adb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 20px -12px rgba(74, 74, 219, .9);
}
.button-primary:hover { background: linear-gradient(180deg, #5555ea, #3f3fcf); }
.button-secondary { color: var(--brand-strong); border-color: #dcdbfd; background: var(--brand-soft); }
.button-secondary:hover { background: #e5e4ff; }
.button-quiet { color: var(--ink-2); border-color: var(--line-strong); background: #fff; box-shadow: var(--shadow-xs); }
.button-danger { color: var(--danger); border-color: #f2c7cb; background: #fff; }
.button-danger:hover { background: var(--danger-soft); }
.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); box-shadow: 0 30px 80px -30px rgba(18, 18, 43, .45); }
.modal::backdrop { background: rgba(18, 18, 43, .45); }
.modal-form { display: grid; gap: 14px; padding: 24px; }
.modal-form h2 { margin: 0; font-size: 20px; }
.modal-form label { display: grid; gap: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.modal-form textarea { resize: vertical; }
.modal-form .form-actions { margin: 4px 0 0; }
.confirm-option { justify-self: start; }
.referral-retarget { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin: 0 0 14px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.referral-retarget label { display: grid; gap: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.button-quiet:hover { border-color: #c4c5d8; background: var(--surface-2); }
.button-white { color: var(--brand-strong); background: #fff; }
.button-white:hover { background: #f1f0ff; }
.button-ghost-light { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); }
.button-ghost-light:hover { background: rgba(255, 255, 255, .18); }
.button-sm { min-height: 36px; padding: 0 13px; border-radius: 9px; font-size: 13px; }
.button:disabled, .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.compact { gap: 12px; }
.form-span { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.chip, .count-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  color: var(--brand-strong); background: var(--brand-soft); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.count-badge { min-width: 28px; justify-content: center; padding: 0 8px; }
.chip-success { color: var(--success); background: var(--success-soft); }
.chip-warning { color: var(--warning); background: var(--warning-soft); }
.chip-muted { color: var(--muted); background: #f0f0f6; }

/* Cards */
.panel, .kpi-card, .stat-card, .integration-card, .feature-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card);
}
.panel { padding: 28px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel .eyebrow, .feature-card .eyebrow, .stat-card .eyebrow, .integration-banner .eyebrow { margin-bottom: 8px; font-size: 11px; }
.detail-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.detail-meta { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }
.loading { padding: 24px 8px; color: var(--muted); font-size: 14px; text-align: center; }
.empty-state { padding: 36px 12px 24px; text-align: center; }
.empty-icon {
  width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; color: var(--brand);
  background: var(--brand-soft); font-size: 22px;
}
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 14px; }

/* Overview */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.kpi-card { display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 20px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--ink-2); font: 600 14px/1.3 var(--font-sans); letter-spacing: 0; }
.kpi-link { color: var(--brand-strong); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.kpi-link:hover { text-decoration: underline; }
.kpi-value { margin: 6px 0 12px; font: 700 36px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-note { margin: auto 0 0; padding-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.meter-list, .source-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(44px, 64px) 36px; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.meter-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-track, .bar-track, .progress { height: 8px; overflow: hidden; border-radius: 999px; background: #ececf5; }
.meter-fill, .bar-fill, .progress-fill {
  display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7a74ff, #5454e8);
  transition: width .5s ease;
}
.meter-fill.alt { background: linear-gradient(90deg, #c4b5fd, #8b5cf6); }
.meter-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.source-item { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.source-item .source-name { flex: 1; min-width: 0; overflow: hidden; color: var(--ink-2); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.overview-grid > .panel > .field-help { margin-top: 16px; }
.setup-panel .progress { margin-bottom: 18px; }
.setup-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.setup-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.setup-step.done { background: #fff; }
.step-marker {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 50%;
  color: var(--muted); background: #fff; font-size: 13px; font-weight: 700;
}
.setup-step.done .step-marker { border-color: transparent; color: #fff; background: linear-gradient(140deg, #22a565, #128a4f); }
.step-copy strong { display: block; color: var(--ink); font-size: 14px; }
.step-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.step-copy a { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.step-copy a:hover { text-decoration: underline; }
.cta-band {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding: 36px 40px;
  overflow: hidden; border-radius: var(--radius-xl); color: #fff;
  background: radial-gradient(620px 260px at 88% -10%, rgba(170, 150, 255, .6), transparent 70%), linear-gradient(120deg, #1f1c58 0%, #372ca0 55%, #5a46d8 100%);
  box-shadow: var(--shadow-pop);
}
.cta-band h2 { color: #fff; font-size: 26px; }
.cta-band .accent { color: #d9d4ff; background: linear-gradient(92deg, #cfc9ff, #f2ccff); -webkit-background-clip: text; background-clip: text; }
.cta-band p { max-width: 580px; margin: 8px 0 0; color: #dedbff; font-size: 15px; line-height: 1.6; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Tables */
.table-wrap { position: relative; margin: 0 -4px; padding: 0 4px; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
.data-table th {
  padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-2); font-size: 12px;
  font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.data-table th:first-child { border-top-left-radius: 10px; }
.data-table th:last-child { border-top-right-radius: 10px; }
.data-table td { padding: 16px 14px; border-bottom: 1px solid #efeff6; color: var(--ink-2); font-size: 14px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfbff; }
.data-table.compact td { padding: 10px 14px; font-variant-numeric: tabular-nums; }
.table-empty { margin: 24px 0 8px; color: var(--muted); font-size: 14px; text-align: center; }
.link-cell { display: flex; align-items: flex-start; gap: 12px; min-width: 240px; }
.link-avatar {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 11px; color: var(--brand-strong);
  background: var(--brand-soft); font-size: 14px; font-weight: 700; text-transform: uppercase;
}
.link-copy { min-width: 0; max-width: 260px; }
.link-title { display: block; color: var(--ink); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
a.link-title:hover { color: var(--brand-strong); text-decoration: underline; }
a.link-title:focus-visible { border-radius: 4px; outline: 2px solid var(--brand); outline-offset: 2px; }
.link-url { display: block; max-width: 240px; overflow: hidden; color: var(--brand-strong); font-size: 13px; font-weight: 500; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.link-url:hover { text-decoration: underline; }
.link-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; color: #4a3fb8; background: #f1efff; font-size: 12px; font-weight: 500; }
.destination-cell { color: var(--muted); font-size: 13px; }
.destination-host { display: block; color: var(--ink-2); font-weight: 600; }
.destination-url { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-cell { color: var(--muted); font-size: 13px; white-space: nowrap; }
.link-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 300px; margin-left: auto; }
.link-actions .button { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.bar-cell { display: grid; grid-template-columns: minmax(56px, 140px) auto; align-items: center; gap: 12px; min-width: 150px; }
.bar-value { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.numeric-cell { font-variant-numeric: tabular-nums; }
.error-text { color: var(--danger); font-size: 13px; }
.link-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(140px, .45fr) minmax(150px, .45fr) auto; align-items: end; gap: 14px; margin-bottom: 12px; }
.links-panel > .field-help { margin-bottom: 12px; }

/* Campaigns */
.campaigns-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.referral-panel { grid-column: 1 / -1; }
.referral-panel code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); font-size: 12px; }
.referral-form { display: grid; gap: 14px; margin: 18px 0 8px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.referral-form label { display: grid; gap: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.referral-form textarea { min-height: 96px; resize: vertical; }
.referral-channels { margin: 0; padding: 0; border: 0; }
.referral-channels legend { margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.referral-channel-options { display: flex; flex-wrap: wrap; gap: 10px; }
.check-option { display: inline-flex !important; align-items: center; gap: 8px !important; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 500 !important; cursor: pointer; }
.referral-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; }
.referral-toolbar .field-help { margin: 0; }
.referral-table td { vertical-align: top; }
.referral-person { display: grid; gap: 2px; min-width: 130px; }
.referral-remove { margin-top: 8px; min-height: 28px; padding: 0 10px; font-size: 12px; }
.referral-meta { color: var(--muted); font-size: 12px; }
.referral-link-cell { min-width: 150px; }
.referral-link-cell .link-url { max-width: 170px; }
.referral-cell-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.referral-visits { color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.muted-cell, .empty-cell { color: var(--muted); }
.inline-form { margin-bottom: 20px; padding: 18px; border: 1px solid #e3e1fb; border-radius: 14px; background: var(--brand-tint); }
.campaign-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.campaign-item {
  width: 100%; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  color: inherit; background: #fff; text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.campaign-item:hover { border-color: #cfcdf8; background: var(--surface-2); }
.campaign-item.selected { border-color: #b9b6f6; background: var(--brand-tint); box-shadow: 0 0 0 3px rgba(84, 84, 232, .1); }
.campaign-symbol {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 12px; color: #fff;
  background: linear-gradient(140deg, #7a74ff, #5454e8); font-weight: 700;
}
.campaign-copy { flex: 1; min-width: 0; }
.campaign-title { display: block; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.campaign-key { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.campaign-arrow { color: #a3a5bb; font-size: 20px; }
.subsection-heading { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; }
.channel-list { display: grid; gap: 10px; }
.channel-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.channel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.channel-name { color: var(--ink); font-size: 14px; font-weight: 600; }
.channel-key { color: var(--muted); font-size: 12px; }
.utm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.utm-tag { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: #fff; font-size: 12px; overflow-wrap: anywhere; }
.channel-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.channel-form { display: grid; gap: 14px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.channel-form .eyebrow { margin: 0; font-size: 11px; }
.channel-form .button { justify-self: start; }

/* Link generation */
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.creation-panel > .detail-description { margin-bottom: 8px; }
.creation-form { display: grid; margin-top: 8px; }
.form-section { display: grid; gap: 18px; min-width: 0; margin: 0; padding: 24px 0; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-step {
  width: 26px; height: 26px; display: inline-grid; place-items: center; flex: none; border-radius: 8px; color: var(--brand-strong);
  background: var(--brand-soft); font-size: 13px; font-weight: 700;
}
.attribution-section summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.attribution-section summary::-webkit-details-marker { display: none; }
.attribution-section summary::after { content: "+"; margin-left: auto; color: var(--brand); font-size: 22px; font-weight: 500; line-height: 1; }
.attribution-section[open] summary::after { content: "−"; }
.summary-title { color: var(--ink); font: 650 16px/1.3 var(--font-display); }
.attribution-section[open] > :not(summary) { margin-top: 2px; }
.path-controls { display: grid; align-content: start; gap: 8px; }
.url-preview {
  display: grid; gap: 6px; padding: 16px 18px; border: 1px solid #dedcff; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-tint), #fff);
}
.url-preview .eyebrow { margin: 0; font-size: 11px; }
.url-preview output { color: var(--brand-strong); font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.domain-warning {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; padding: 14px; border: 1px solid #f1dfb8; border-radius: 12px;
  color: var(--warning); background: var(--warning-soft); font-size: 14px; line-height: 1.5;
}
.warning-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #fff; background: #d29a25; font-size: 12px; font-weight: 700; }
.creation-actions {
  position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-pop);
}
.generated-link {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding: 16px; border: 1px solid #c9ebd8;
  border-radius: 14px; color: var(--success); background: var(--success-soft); font-size: 14px; overflow-wrap: anywhere;
}
.generated-link a:not(.button) { color: var(--brand-strong); font-weight: 600; }
.feature-card {
  position: sticky; top: 96px; padding: 28px;
  background: radial-gradient(420px 220px at 100% 0%, rgba(122, 115, 255, .16), transparent 70%), #fff;
}
.step-list { display: grid; gap: 18px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: step; }
.step-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; counter-increment: step; }
.step-list li::before {
  content: counter(step); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px;
  color: var(--brand-strong); background: var(--brand-soft); font-weight: 700;
}
.step-list strong { display: block; color: var(--ink); font-size: 14px; }
.step-list span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Library selection */
.data-table .select-cell { width: 44px; padding-right: 4px; }
.select-cell input[type="checkbox"] { display: block; cursor: pointer; }
.data-table tbody tr.selected td { background: var(--brand-tint); }
.selection-bar {
  position: sticky; top: 76px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 0 0 12px; padding: 10px 14px; border: 1px solid #dcdbfd; border-radius: 12px; color: var(--brand-strong);
  background: var(--brand-soft); box-shadow: var(--shadow-xs); font-size: 14px;
}
.selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Bulk upload */
.drop-zone {
  justify-items: center; gap: 6px; padding: 28px 20px; border: 1.5px dashed var(--line-strong); border-radius: 14px;
  text-align: center; background: var(--brand-tint); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.drop-zone.has-file { border-style: solid; border-color: #c9ebd8; background: var(--success-soft); }
.drop-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--brand-strong); background: #fff; box-shadow: var(--shadow-xs); }
.drop-icon svg { width: 22px; height: 22px; }
.drop-title { color: var(--ink); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.drop-title u { color: var(--brand-strong); text-underline-offset: 3px; }
.bulk-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-summary:empty { display: none; }
.chip-danger { color: var(--danger); background: var(--danger-soft); }
.bulk-table-wrap { max-height: 460px; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.bulk-table thead th { position: sticky; top: 0; z-index: 1; }
.bulk-table th:first-child, .bulk-table th:last-child { border-radius: 0; }
.bulk-table td { vertical-align: top; }
.bulk-table .cell-row { width: 56px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bulk-table .cell-url { min-width: 200px; max-width: 360px; font-size: 13px; overflow-wrap: anywhere; }
.bulk-table .cell-url a { color: var(--brand-strong); font-weight: 600; }
.bulk-table .cell-path { min-width: 130px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.bulk-table .cell-path .bulk-meta { font-family: var(--font-sans); overflow-wrap: normal; }
.bulk-table tr.row-error td { background: #fffafa; }
.bulk-issue { display: block; min-width: 160px; margin-top: 4px; font-size: 12px; line-height: 1.45; white-space: normal; }
.bulk-issue.error { color: var(--danger); }
.bulk-issue.warning { color: var(--warning); }
.bulk-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.bulk-result-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.bulk-qr-format { width: 120px; font-size: 13px; }
.bulk-progress { margin-top: 12px; }
.bulk-progress:empty { display: none; }
.bulk-columns-help { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.bulk-columns-help summary { color: var(--brand-strong); font-size: 14px; font-weight: 600; cursor: pointer; }
.bulk-columns-help dl { margin: 6px 0 0; font-size: 13px; }
.bulk-columns-help dt { margin-top: 12px; color: var(--ink); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; font-weight: 600; }
.bulk-columns-help dd { margin: 2px 0 0; color: var(--muted); line-height: 1.5; }
.bulk-columns-help code { font-size: 12px; }

/* QR */
.report-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.qr-details { margin-bottom: 8px; }
.qr-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; }
.qr-form .button { grid-column: 1 / -1; justify-self: start; }
.qr-stage {
  min-height: 300px; display: grid; place-items: center; margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 16px;
  background-color: #fafaff; background-image: radial-gradient(rgba(84, 84, 232, .13) 1px, transparent 1.3px); background-size: 14px 14px;
}
.qr-preview { display: block; width: 100%; max-width: 300px; height: auto; padding: 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-card); image-rendering: pixelated; }
.qr-short-url { margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.qr-short-url:empty { display: none; }
.qr-preview-panel .form-actions { justify-content: center; margin: 0 0 16px; }
.qr-preview-panel .notice { margin: 16px 0 0; }

/* Reports */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { padding: 22px; }
.stat-value { font: 700 36px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 8px; color: var(--muted); font-size: 14px; }
.report-details { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px 20px; margin: 22px 0 0; font-size: 14px; line-height: 1.6; }
.report-details dt { color: var(--muted); font-weight: 600; }
.report-details dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.chart-card { margin-bottom: 24px; }
.segmented { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.segment { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; cursor: pointer; }
.segment:hover { color: var(--ink); }
.segment[aria-pressed="true"] { color: var(--brand-strong); background: #fff; box-shadow: var(--shadow-xs), 0 0 0 1px var(--line); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin: -6px 0 12px; color: var(--muted); font-size: 13px; }
.legend-swatch { display: inline-block; width: 18px; height: 4px; margin-right: 8px; border-radius: 4px; vertical-align: middle; background: var(--brand); }
.legend-swatch.nonbot { height: 0; border-top: 2px dashed var(--violet); border-radius: 0; background: none; }
.chart-wrap { position: relative; min-height: 120px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #ececf4; stroke-width: 1; }
.chart-axis { fill: var(--muted); stroke: none; font: 500 11px var(--font-sans); }
.chart-line { stroke: var(--brand); stroke-width: 2.5; }
.chart-line-secondary { stroke: var(--violet); stroke-width: 2; stroke-dasharray: 5 5; }
.chart-point { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.chart-footnote { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.chart-table { margin-top: 14px; }
.chart-table summary { color: var(--brand-strong); font-size: 14px; font-weight: 600; cursor: pointer; }
.chart-table .table-wrap { max-height: 320px; margin-top: 12px; overflow-y: auto; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-form { display: grid; gap: 16px; }
.settings-form label { display: grid; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.settings-form select { max-width: 460px; }
.settings-preview { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); background: var(--surface-2); font-size: 14px; }
.settings-details { grid-template-columns: 180px minmax(0, 1fr); }
.settings-details + .field-help { margin-top: 20px; }
.insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; align-items: start; }
.insight-wide { grid-column: 1 / -1; }
.insight-card .panel-heading { flex-wrap: wrap; }
.insight-body { min-height: 96px; }
.insight-empty { margin: 0; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); background: var(--surface-2); font-size: 14px; line-height: 1.6; }
.insight-table td { vertical-align: middle; }
.insight-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.insight-label { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.insight-detail { color: var(--muted); font-size: 12px; }
.country-code { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-2); font: 600 11px/1.5 var(--font-sans); letter-spacing: .04em; }
.insight-share { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.insight-percent { min-width: 44px; font-variant-numeric: tabular-nums; text-align: right; }
.insight-bar { display: block; width: 72px; height: 6px; overflow: hidden; border-radius: 999px; background: #ececf5; }
.insight-bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7a74ff, #5454e8); }
.insight-meters .meter { grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) minmax(84px, auto); font-size: 14px; }
.insights-grid > .chart-footnote { margin: 0; }
.faq-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; margin-top: 24px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: radial-gradient(500px 240px at 0% 0%, rgba(122, 115, 255, .12), transparent 70%), #fff; box-shadow: var(--shadow-card); }
.faq-intro h2 { margin-bottom: 10px; font-size: 26px; }
.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-size: 22px; font-weight: 500; line-height: 1; transition: transform .2s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0; padding: 0 18px 18px; color: var(--muted); font-size: 14px; line-height: 1.65; }
#report-index, #integration-report-section { margin-bottom: 24px; }

/* Integrations */
.integration-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding: 32px; border: 1px solid var(--line);
  border-radius: var(--radius-xl); background: radial-gradient(520px 240px at 100% 0%, rgba(122, 115, 255, .16), transparent 70%), #fff; box-shadow: var(--shadow-card);
}
.integration-banner h2 { max-width: 560px; margin-bottom: 10px; font-size: 26px; }
.integration-banner .detail-description { max-width: 620px; }
.provider-strip { display: grid; grid-template-columns: repeat(2, 56px); gap: 12px; flex: none; }
.provider-tile {
  width: 56px; height: 56px; display: grid; place-items: center; flex: none; border-radius: 16px; color: #fff;
  background: linear-gradient(140deg, #7a74ff, #5454e8); font: 700 20px/1 var(--font-display); box-shadow: 0 10px 20px -12px rgba(18, 18, 43, .55);
}
.provider-tile.small { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; box-shadow: none; }
.provider-tile[data-provider="zoho-backstage"] { background: linear-gradient(140deg, #e8584e, #b42a26); }
.provider-tile[data-provider="sessionize"] { background: linear-gradient(140deg, #1fa776, #0f7a52); }
.provider-tile[data-provider="wordpress"] { background: linear-gradient(140deg, #2b7bb0, #19557f); }
.provider-tile[data-provider="instantly"] { background: linear-gradient(140deg, #6d68ff, #4636cf); }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.integration-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.integration-head { display: flex; align-items: center; gap: 14px; }
.integration-head h3 { font-size: 18px; }
.integration-head .chip { margin-left: auto; }
.integration-metrics {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; margin: 0; padding: 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-2); font-size: 14px;
}
.integration-metrics dt { color: var(--ink-2); }
.integration-metrics dd { margin: 0; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.integration-card details summary { color: var(--brand-strong); font-size: 14px; font-weight: 600; cursor: pointer; }
.integration-card details[open] summary { margin-bottom: 10px; }
.integration-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.login-main { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); }
.login-main .brand { padding: 0 0 48px; }
.login-card { width: 100%; max-width: 440px; }
.login-card h1 { margin-bottom: 12px; font-size: clamp(30px, 3vw, 40px); }
.login-card .subheading { margin: 0 0 28px; }
.login-form { display: grid; gap: 18px; }
.password-field { position: relative; display: grid; gap: 8px; }
.password-field > label { display: block; }
.password-field input { padding-right: 76px; }
.password-toggle {
  position: absolute; right: 6px; bottom: 5px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--brand-strong);
  background: transparent; font-size: 13px; font-weight: 600; cursor: pointer;
}
.password-toggle:hover { background: var(--brand-soft); }
.login-form .button-primary { width: 100%; min-height: 48px; font-size: 15px; }
.login-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0; color: var(--muted); font-size: 13px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.sso-button { width: 100%; min-height: 48px; justify-content: flex-start; gap: 12px; padding: 0 16px; }
.sso-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 2px; }
.sso-mark span { width: 8px; height: 8px; }
.sso-mark span:nth-child(1) { background: #f25022; }
.sso-mark span:nth-child(2) { background: #7fba00; }
.sso-mark span:nth-child(3) { background: #00a4ef; }
.sso-mark span:nth-child(4) { background: #ffb900; }
.sso-status { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-footer { margin-top: 40px; color: var(--muted); font-size: 13px; }
.login-aside {
  position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; margin: 16px;
  padding: clamp(32px, 4.6vw, 64px); overflow: hidden; border-radius: 28px; color: #fff;
  background: radial-gradient(700px 360px at 90% -10%, rgba(173, 154, 255, .65), transparent 68%), radial-gradient(520px 320px at 0% 110%, rgba(236, 72, 153, .28), transparent 70%), linear-gradient(140deg, #1d1a52 0%, #33289a 52%, #5a46d8 100%);
}
.login-aside::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 80% at 100% 0%, #000 0%, transparent 62%); mask-image: radial-gradient(120% 80% at 100% 0%, #000 0%, transparent 62%);
}
.login-aside-inner { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 560px; }
.login-aside h2 { color: #fff; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.1; letter-spacing: -.035em; }
.login-aside .accent { color: #d9d4ff; background: linear-gradient(92deg, #cfc9ff, #f2ccff); -webkit-background-clip: text; background-clip: text; }
.login-aside-lead { margin: 0; color: #dedbff; font-size: 16px; line-height: 1.65; }
.login-aside .eyebrow { margin: 0; color: #cfc9ff; }

.login-preview {
  margin: 0; padding: 16px 18px 18px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)); box-shadow: 0 24px 60px -30px rgba(8, 6, 40, .8);
  backdrop-filter: blur(10px);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.preview-dots { display: flex; gap: 6px; }
.preview-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.preview-tag {
  padding: 3px 9px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 999px; color: #e7e4ff;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.preview-flow { display: grid; gap: 6px; }
.preview-step { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: rgba(13, 10, 52, .38); }
.preview-label { color: #bdb7f5; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.preview-short, .preview-dest { font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace; }
.preview-short { color: #fff; font-size: 16px; overflow-wrap: anywhere; }
.preview-short b { color: #f2ccff; font-weight: 600; }
.preview-dest { color: #e3e0ff; font-size: 13px; line-height: 1.55; }
.preview-utm { color: #9ff0c9; }
.preview-fragment { display: inline-block; padding: 0 6px; margin-left: 2px; border-radius: 6px; color: #1d1a52; background: #f2ccff; font-weight: 600; white-space: nowrap; }
.preview-arrow { display: grid; place-items: center; width: 26px; height: 26px; margin-left: 14px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .16); }
.preview-arrow svg { width: 15px; height: 15px; }
.preview-report { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14); }
.preview-bars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.preview-bars li { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 12px; color: #e3e0ff; font-size: 13px; }
.preview-bars i { display: block; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #a99cff, #f2ccff); transform-origin: left; animation: preview-bar-grow .9s cubic-bezier(.2, .8, .2, 1) both; }
.preview-bars li:nth-child(1) i { width: 86%; }
.preview-bars li:nth-child(2) i { width: 58%; animation-delay: .08s; }
.preview-bars li:nth-child(3) i { width: 34%; animation-delay: .16s; }
@keyframes preview-bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.login-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.login-points li {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px; background: rgba(255, 255, 255, .07);
}
.login-points strong { margin-top: 4px; color: #fff; font-size: 14px; line-height: 1.3; }
.login-points .point-text { color: #d6d3ff; font-size: 13px; line-height: 1.5; }
.point-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 10px; color: #fff;
  background: linear-gradient(140deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .1)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.point-icon svg { width: 18px; height: 18px; }

.login-integrations { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: #bdb7f5; font-size: 13px; }
.login-integrations ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.login-integrations li { padding: 5px 11px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; color: #f1efff; background: rgba(255, 255, 255, .06); font-weight: 500; }

.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 32px 4px 4px; color: var(--muted); font-size: 13px; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid, .campaigns-layout, .split-layout, .qr-layout, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .feature-card { position: static; }
  .link-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 961px) and (max-width: 1200px) {
  .login-points { grid-template-columns: minmax(0, 1fr); }
  .login-points li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
  .login-points .point-icon { grid-row: span 2; }
  .login-points strong { margin-top: 0; }
}
@media (max-width: 960px) {
  .sidebar {
    position: sticky; inset: 0 auto auto 0; width: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px;
    overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0 8px 0 0; font-size: 18px; }
  .sidebar-nav { display: flex; gap: 4px; }
  .nav-label, .sidebar-card { display: none; }
  .nav-item { min-height: 38px; margin: 0; white-space: nowrap; }
  .main-content { margin-left: 0; }
  .topbar { position: static; flex-wrap: wrap; padding: 12px 20px; }
  .global-search { order: 3; max-width: none; flex-basis: 100%; }
  .breadcrumbs { flex: 1; }
  .page-content { padding: 28px 20px 24px; }
  .page-hero { align-items: stretch; flex-direction: column; }
  .organization-picker { width: 100%; }
  .stats-grid, .integration-grid, .faq-panel, .insights-grid { grid-template-columns: minmax(0, 1fr); }
  .integration-banner, .cta-band { align-items: flex-start; flex-direction: column; }
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-aside { order: 2; }
  .selection-bar { top: 64px; }
}
@media (max-width: 640px) {
  .kpi-grid, .form-grid, .link-toolbar, .qr-form { grid-template-columns: minmax(0, 1fr); }
  .panel, .faq-panel, .integration-banner { padding: 20px; }
  .cta-band { padding: 28px 22px; }
  .environment-pill, .user-name, .global-search kbd { display: none; }
  .report-details { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .report-details dd { margin-bottom: 10px; }
  .creation-actions { bottom: 8px; }
  .panel-heading { flex-wrap: wrap; }
  .referral-retarget { grid-template-columns: minmax(0, 1fr); }
  .insight-bar { display: none; }
  .insight-table th, .insight-table td { padding-right: 10px; padding-left: 10px; }
  .login-main { padding: 32px 20px; }
  .login-aside { margin: 0 12px 12px; padding: 28px 20px; }
  .login-points { grid-template-columns: minmax(0, 1fr); }
  .login-points li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
  .login-points .point-icon { grid-row: span 2; }
  .login-points strong { margin-top: 0; }
  .login-preview { padding: 14px; }
  .preview-bars li { grid-template-columns: 72px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.integration-breakdowns { display: grid; gap: 10px; }
.integration-breakdowns details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.integration-breakdowns summary { color: var(--brand-strong); font-size: 14px; font-weight: 600; cursor: pointer; }
.integration-breakdowns .table-wrap { margin-top: 10px; }
