:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #1c2130;
  --text-2: #475467;
  --muted: #667085;
  --border: #e3e6eb;
  --grid: #eceef2;
  --accent: #4f46e5;
  --accent-text: #ffffff;
  --accent-soft: #eef0ff;
  --chart: #4f46e5;
  --good: #15803d;
  --good-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --idle: #667085;
  --idle-soft: #eef0f3;
  --danger: #c0362c;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141b;
    --surface: #1a1e27;
    --surface-2: #161a22;
    --text: #e6e8ee;
    --text-2: #c2c8d4;
    --muted: #9aa3b5;
    --border: #2b303c;
    --grid: #252a35;
    --accent: #7c74ff;
    --accent-text: #0f1117;
    --accent-soft: #252847;
    --chart: #7c74ff;
    --good: #4ade80;
    --good-soft: #14301f;
    --warn: #fbbf24;
    --warn-soft: #3a2c0d;
    --idle: #9aa3b5;
    --idle-soft: #252a35;
    --danger: #ff6b5e;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.3; margin: 0; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand picture, .brand img { display: block; height: 28px; width: auto; }
.brand-product { font-weight: 500; color: var(--muted); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.crumbs a { color: var(--text-2); }
.crumbs select { max-width: 260px; }
.crumbs .sep { opacity: .6; }

/* ------------------------------------------------------------------ layout */
.page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 0; }
.card-body { padding: 16px 20px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }

/* ------------------------------------------------------------------ controls */
select, button, input[type=text], input[type=email], input[type=number], input[type=search], input[type=password], .btn {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px;
}
input[type=text], input[type=email], input[type=number], input[type=search], input[type=password] { width: 100%; }
input:focus-visible, select:focus-visible, button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button, .btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { text-decoration: none; }
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); }
.btn-small { padding: 4px 10px; font-size: 13px; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.field small, .check small { color: var(--muted); font-size: 12.5px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); }
.check span { font-weight: 600; font-size: 13px; }
.check small { grid-column: 2; }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.segmented button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; color: var(--text-2); font-size: 13px; }
.segmented button[aria-pressed=true] { background: var(--accent-soft); color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; }
/* Desktop: every tab fits, so no scrollbar (small screens scroll the tabs sideways). */
@media (min-width: 900px) { .tabs { overflow: visible; flex-wrap: wrap; } }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-selected=true] { color: var(--text); border-color: var(--accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters .grow { flex: 1 1 220px; }
.filters .field-like { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.multi-pick { position: relative; }
.multi-pick summary { list-style: none; cursor: pointer; min-width: 180px; padding: 7px 30px 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; position: relative; }
.multi-pick summary::-webkit-details-marker { display: none; }
.multi-pick summary::after { content: '▾'; position: absolute; right: 10px; color: var(--muted); }
.multi-pick-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); padding: 6px; display: grid; gap: 2px; }
.multi-pick-menu label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; color: var(--text); font-size: 14px; cursor: pointer; }
.multi-pick-menu label:hover { background: var(--accent-soft); }
.multi-pick-menu small { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------------ status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-good { color: var(--good); background: var(--good-soft); }
.pill-warn { color: var(--warn); background: var(--warn-soft); }
.pill-idle { color: var(--idle); background: var(--idle-soft); }

/* ------------------------------------------------------------------ websites grid */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.site-card { display: grid; gap: 14px; padding: 18px 20px; color: inherit; transition: border-color .15s; }
.site-card:hover { border-color: var(--accent); text-decoration: none; }
.site-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.site-card h2 { font-size: 16px; }
.site-card .domain { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.site-card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.site-card .nums b { display: block; font-size: 18px; font-weight: 600; }
.site-card .nums span { font-size: 12px; color: var(--muted); }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state h2 { font-size: 18px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin: 0 auto 20px; max-width: 460px; }

/* ------------------------------------------------------------------ dialog */
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgb(15 17 23 / 45%); }
dialog form { display: grid; gap: 16px; padding: 22px; }
dialog h2 { font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-error { color: var(--danger); margin: 0; font-size: 13px; }

/* ------------------------------------------------------------------ KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 16px 20px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 600; line-height: 1.2; margin-top: 4px; }

/* ------------------------------------------------------------------ chart */
.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--chart); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hover { opacity: .8; }
.chart .hover-band { fill: var(--accent-soft); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; white-space: nowrap;
  box-shadow: 0 4px 12px rgb(16 24 40 / 12%); transform: translate(-50%, -100%);
}
.tooltip b { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ ranked lists (top pages...) */
.ranked { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.ranked li { position: relative; }
.ranked .row { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; border-radius: 6px; color: inherit; width: 100%; background: none; border: 0; text-align: left; font: inherit; }
.ranked button.row { cursor: pointer; }
.ranked button.row:hover { background: var(--surface-2); }
.ranked .meter { position: absolute; left: 0; top: 3px; bottom: 3px; border-radius: 4px; background: var(--accent-soft); z-index: 0; }
.ranked .name, .ranked .count { position: relative; z-index: 1; }
.ranked .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ranked .row { overflow: hidden; }
.ranked .count { font-variant-numeric: tabular-nums; color: var(--text-2); }
.list-empty { color: var(--muted); padding: 6px 8px; margin: 0; }

/* ------------------------------------------------------------------ sessions table */
.table-wrap { overflow-x: auto; }
table.sessions { width: 100%; border-collapse: collapse; }
.sessions th, .sessions td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sessions td.wrap { white-space: normal; min-width: 200px; max-width: 420px; overflow-wrap: anywhere; } /* long text (e.g. event descriptions) wraps instead of widening the table */
.sessions tr:last-child td { border-bottom: 0; }
.sessions th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.sessions th:first-child { border-top-left-radius: var(--radius); }
.sessions th:last-child { border-top-right-radius: var(--radius); }
.sessions td.num, .sessions th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sessions tbody tr { cursor: pointer; }
.sessions tbody tr:hover { background: var(--accent-soft); }
.sessions .url { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.sessions .ref { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.sessions .play { color: var(--accent); font-weight: 600; }
.sessions .play-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); font-size: 11px; }
.sessions .play-icon:hover { text-decoration: none; background: var(--accent); color: var(--accent-text); }
.live { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--good); background: var(--good-soft); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.table-empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }

/* ------------------------------------------------------------------ install & settings */
.install { max-width: 820px; }
.status-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.status-banner p { margin: 2px 0 0; color: var(--muted); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 14px; }
.steps li::marker { font-weight: 700; color: var(--muted); }
.snippet { position: relative; margin-top: 8px; }
.snippet pre { margin: 0; padding: 14px 16px; padding-right: 88px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; white-space: pre; }
.snippet button { position: absolute; top: 8px; right: 8px; }
.settings { max-width: 820px; }
.settings form { display: grid; gap: 18px; }
.form-actions { display: flex; align-items: center; gap: 12px; }
.saved { color: var(--good); font-size: 13px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .card-body { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.danger-zone p { margin: 2px 0 0; color: var(--muted); }
.id-box { display: flex; gap: 8px; align-items: center; }
.id-box code { padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; flex: 1; }

/* ------------------------------------------------------------------ replay page */
.replay-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.pages { padding: 16px; }
.pages ol { list-style: none; margin: 0 0 20px; padding: 0; }
.pages li button {
  display: block; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 4px; background: none;
}
.pages li button:hover { background: var(--accent-soft); }
.pages li button.active { background: var(--accent-soft); border-color: var(--accent); }
.pages .page-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages .page-meta { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.player-card { padding: 16px; min-height: 420px; }
.player-info { margin: 0 0 12px; overflow-wrap: anywhere; }
#player { display: flex; justify-content: center; }
#player .rr-player { box-shadow: none; border: 1px solid var(--border); }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .replay-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .crumbs .sep, .crumbs .hide-sm { display: none; }
  .page { padding: 20px 16px 48px; }
  .kpi .value { font-size: 22px; }
  .sessions th:nth-child(n+6), .sessions td:nth-child(n+6) { display: none; }
}

/* ------------------------------------------------------------------ user menu (top bar) */
.user-menu { margin-left: auto; position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--surface-2); }
.user-menu summary:focus-visible { outline: 2px solid var(--accent); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.huge { width: 72px; height: 72px; font-size: 24px; }
.avatar.tiny { width: 22px; height: 22px; font-size: 9.5px; }
.picture-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.picture-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.user-name { font-weight: 500; }
.user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgb(16 24 40 / 14%); display: grid;
}
.user-menu .menu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 13px; }
.user-menu .menu a, .user-menu .menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0;
  background: none; color: var(--text); font: inherit; cursor: pointer;
}
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 700px) { .user-name { display: none; } }

/* ------------------------------------------------------------------ login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); padding: 28px; }
.login-card .brand { justify-content: center; margin-bottom: 20px; font-size: 17px; }
.login-card .brand img { height: 34px; }
.login-card h1 { font-size: 18px; text-align: center; margin-bottom: 20px; }
.login-card form { display: grid; gap: 14px; }
.login-card .btn-primary { justify-content: center; padding: 9px 12px; }
.login-switch { text-align: center; margin: 16px 0 0; }

/* ------------------------------------------------------------------ users */
.users td .sub { display: block; font-size: 12.5px; color: var(--muted); }
.users tbody tr { cursor: default; }
.users tbody tr:hover { background: none; }
.users td.actions { text-align: right; }
.role-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--idle-soft); color: var(--text-2); }
.role-badge.owner { background: var(--accent-soft); color: var(--accent); }
.site-picks { display: grid; gap: 6px; max-height: 180px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.site-picks label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.radio-row label { display: flex; gap: 6px; align-items: center; }
.role-help { font-size: 12.5px; color: var(--muted); margin: 0; }
.account { max-width: 560px; }
.account form { display: grid; gap: 16px; }

/* ------------------------------------------------------------------ notice bar */
.notice { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 10px 24px; background: var(--warn-soft); color: var(--text); font-size: 13.5px; border-bottom: 1px solid var(--border); text-align: center; }

/* ------------------------------------------------------------------ location */
.location { display: inline-flex; align-items: center; gap: 8px; }
.flag { width: 20px; height: 15px; border-radius: 2px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px rgb(0 0 0 / 8%); }
.flag-unknown { display: inline-block; background: var(--idle-soft); }
.ranked .name .flag { margin-right: 8px; vertical-align: -2px; }

/* ------------------------------------------------------------------ live */
.tab-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--good-soft); color: var(--good); font-size: 11.5px; font-weight: 700; text-align: center; }
.live-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.live-count { font-size: 32px; font-weight: 600; line-height: 1.1; }
.live-updated { margin-left: auto; font-size: 12.5px; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--idle); flex: none; }
.live-dot.on { background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on { animation: none; } }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.presence.active { color: var(--good); }
.presence.hidden, .presence.left { color: var(--idle); }
.still-here { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 12px; border-radius: 8px; background: var(--good-soft); font-size: 13.5px; }

/* ------------------------------------------------------------------ tags, errors, page speed */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  font-size: 11.5px; line-height: 1.6; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.tag-url { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.tag-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: transparent; color: var(--danger); font-weight: 600; }
.tag-more { color: var(--muted); }
.sessions td.tags-cell { white-space: normal; width: 165px; min-width: 165px; }
.sessions td.loc { max-width: 170px; }
.sessions td.ip-cell { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.ip-link { border: 0; background: none; padding: 0; color: var(--text-2); font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: block; }
.ip-link:hover { color: var(--accent); text-decoration: underline; }
.sessions td.loc .location { max-width: 100%; }
.sessions td.loc .location-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sessions td.dev { white-space: normal; min-width: 130px; max-width: 170px; line-height: 1.35; }
.sessions td.tags-cell .tag { margin: 2px 4px 2px 0; }
.ua { font-size: 11.5px; word-break: break-all; }
.page-details { margin-top: 18px; display: grid; gap: 10px; }
.page-details h3 { margin: 6px 0 0; }
.page-details p { margin: 0; font-size: 13px; }
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vital { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.vital-name { font-size: 12px; color: var(--muted); }
.vital-value { font-size: 18px; font-weight: 600; }
.rating { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.rating::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rating-good { color: var(--good); }
.rating-warn { color: var(--warn); }
.rating-poor { color: var(--danger); }
.error-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.error-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.error-time { font-variant-numeric: tabular-nums; font-size: 12.5px; padding: 2px 8px; }
.error-message { color: var(--danger); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.error-source { font-size: 12px; overflow-wrap: anywhere; }
.error-list pre { margin: 6px 0 0; font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.error-list summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.excluded-ips { width: 100%; min-height: 90px; font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }

/* ------------------------------------------------------------------ star, team tags */
.star { border: 0; background: none; padding: 2px 4px; font-size: 19px; line-height: 1; color: var(--muted); cursor: pointer; }
.star:hover:not(:disabled) { color: #d4a106; }
.star.on { color: #e0a800; }
.star:disabled { cursor: default; opacity: 1; }
.star:disabled:not(.on) { visibility: hidden; }
.sessions td.actions-cell { white-space: nowrap; text-align: right; }
.sessions td.actions-cell .star { vertical-align: middle; margin-right: 2px; }
#star-slot .star { font-size: 24px; padding: 4px 6px; }
.tag-manual { background: var(--good-soft); border-color: transparent; color: var(--text); }
.tag-remove { border: 0; background: none; padding: 0 0 0 4px; margin: 0; font-size: 13px; line-height: 1; color: var(--muted); cursor: pointer; }
.tag-remove:hover { color: var(--danger); }
.tag .tag-remove { vertical-align: 0; }
.tag-form { display: flex; gap: 6px; margin-top: 10px; }
.tag-form input { flex: 1; min-width: 0; padding: 5px 10px; font-size: 13px; }

/* ------------------------------------------------------------------ heatmaps */
.hint { font-size: 13px; margin: 12px 4px 0; }
.page-wide { max-width: 1600px; }
.heat-controls .field { gap: 4px; }
.heat-controls .field > span { font-size: 12px; font-weight: 400; color: var(--muted); }
.heat-controls select { max-width: 100%; }
.heat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.heat-card { padding: 16px; min-height: 420px; overflow: hidden; }
.heat-stage { position: relative; margin: 0 auto; overflow: hidden; background: #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); }
.heat-frame { position: absolute; inset: 0; }
.heat-frame iframe { border: 0; display: block; background: #fff; pointer-events: none; }
.heat-frame .replayer-mouse, .heat-frame .replayer-mouse-tail { display: none; }
.heat-canvas { position: absolute; left: 0; top: 0; }
.heat-marks { position: absolute; inset: 0; pointer-events: none; }
.heat-mark { position: absolute; left: 0; right: 0; border-top: 2px solid #11141b; }
.heat-mark.dashed { border-top-style: dashed; }
.heat-mark span { position: absolute; right: 8px; top: 4px; background: #11141b; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.heat-highlight { position: absolute; border: 2px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 9999px rgb(17 20 27 / 25%); pointer-events: none; }
.heat-stage .tooltip { transform: translate(-50%, -100%); }
.heat-message { padding: 80px 24px; text-align: center; color: var(--muted); }
.heat-side { padding: 16px; position: sticky; top: 16px; }
.heat-side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 6px; }
.heat-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.heat-stat strong { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.heat-stat span { font-size: 12.5px; }
.heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; }
.heat-ramp { flex: 1; height: 8px; border-radius: 4px; }
.heat-note { font-size: 12.5px; margin: 14px 0 0; }
.heat-open { font-size: 16px; margin-left: 8px; vertical-align: 2px; }
@media (max-width: 1000px) { .heat-layout { grid-template-columns: 1fr; } .heat-side { position: static; } }
.heat-empty-note { margin: 16px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); font-size: 13px; }
.notice-box { padding: 12px 16px; margin-bottom: 16px; border-radius: 10px; background: var(--warn-soft); font-size: 13.5px; line-height: 1.55; }
.notice-box code { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ surveys */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head p { margin: 0; }
.row-link { margin-right: 14px; font-weight: 500; }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-inline { margin-top: 32px; text-align: right; }

.survey-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.survey-name input { font: inherit; font-size: 24px; font-weight: 600; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 2px 8px; margin-left: -9px; width: min(560px, 100%); }
.survey-name input:hover, .survey-name input:focus { border-color: var(--border); background: var(--surface); outline: none; }
.survey-name svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.stepper { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.stepper button { border: 0; background: none; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--text-2); font-size: 14px; }
.stepper button span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--idle-soft); color: var(--text-2); font-size: 12.5px; font-weight: 700; margin-right: 4px; }
.stepper button[aria-current=true] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.stepper button[aria-current=true] span, .stepper button.done span { background: var(--accent); color: var(--accent-text); }
.survey-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: start; }
.survey-actions { margin-top: 18px; }
.form-card { padding: 20px; }
.form-card .field > span, .q-body .field > span { font-size: 13px; }
.field input[type=text], .field textarea, .field select, .rule-row input, .rule-row select { width: 100%; }
.field textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.field.narrow { max-width: 320px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.radio-col { display: grid; gap: 6px; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; flex-wrap: wrap; }
.inline-check input[type=radio], .inline-check input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
input.num-input { width: 90px; }
.add-link { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 6px 2px; justify-self: start; }
.add-link.small { font-size: 13px; font-weight: 500; }
.icon-btn { width: 32px; height: 32px; justify-content: center; padding: 0; font-size: 18px; color: var(--muted); flex: none; }
.q-card { overflow: hidden; }
.q-card.open { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.q-head { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 14px 18px; text-align: left; border-radius: 0; }
.q-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--idle-soft); font-size: 12.5px; font-weight: 700; flex: none; }
.q-num.done { background: var(--good-soft); color: var(--good); }
.q-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.q-title small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.chev { color: var(--muted); }
.q-body { display: grid; gap: 14px; padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.q-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--border); margin: 0 -18px; padding: 0 18px; }
.q-tabs button { border: 0; background: none; border-radius: 0; padding: 10px 2px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.q-tabs button[aria-pressed=true] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.q-options { display: flex; gap: 20px; flex-wrap: wrap; }
.q-tools { display: flex; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.options-editor { display: grid; gap: 6px; }
.option-row { display: flex; align-items: center; gap: 8px; }
.option-mark { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; }
.option-mark.multi { border-radius: 4px; }
.logic-row { display: grid; grid-template-columns: 1fr minmax(200px, 280px); gap: 12px; align-items: center; font-size: 14px; }
.swatches { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); padding: 0; }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 2px var(--text); }
.swatch-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; margin-left: 6px; }
.swatch-custom input { width: 34px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.positions { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.position { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 8px; font-size: 13.5px; font-weight: 400; cursor: pointer; }
.position input { accent-color: var(--accent); margin: 0; }
.pos-pic { grid-column: 1 / -1; position: relative; height: 54px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.pos-pic i { position: absolute; width: 30px; height: 14px; border-radius: 3px; background: var(--text-2); }
.pos-pic.bottom-right i { right: 6px; bottom: 6px; } .pos-pic.bottom-left i { left: 6px; bottom: 6px; }
.pos-pic.top-right i { right: 6px; top: 6px; } .pos-pic.top-left i { left: 6px; top: 6px; }
.rules { display: grid; gap: 8px; }
.rule-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; }
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; color: var(--text); overflow-x: auto; }
.summary-list { font-size: 14px; }

.survey-preview { position: sticky; top: 16px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 500; }
.preview-head .segmented button { display: inline-grid; place-items: center; padding: 5px 8px; }
.preview-page { position: relative; height: 560px; margin: 0 auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; transition: width .2s; width: 100%; }
.preview-page.mobile { width: 320px; }
.pv-bar { height: 36px; border-bottom: 1px solid #eceef2; display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 0 14px; }
.pv-bar span { width: 18px; height: 3px; border-radius: 2px; background: #d9dde5; }
.pv-hero { height: 150px; margin: 16px; border-radius: 10px; background: #f3f5f9; }
.pv-row { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; margin: 16px; }
.pv-row div { height: 70px; border-radius: 10px; background: #f3f5f9; }
.pv-lines { display: grid; gap: 8px; margin: 16px; }
.pv-lines i { height: 10px; border-radius: 5px; background: #f3f5f9; }
.pv-lines i.short { width: 60%; }
.preview-note { font-size: 12.5px; margin: 8px 2px 0; }

.question-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.question-card h2 { font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.question-card .card-body { display: grid; gap: 10px; }
.question-card p.small { margin: 0; }
.rating-headline { display: flex; align-items: baseline; gap: 8px; }
.rating-headline strong { font-size: 28px; font-weight: 600; line-height: 1; }
.rating-headline .nps { margin-left: 18px; }
.text-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.text-answers li { border-left: 3px solid var(--accent-soft); padding-left: 10px; }
.text-answers p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.responses td.answers { white-space: normal; min-width: 260px; max-width: 460px; font-size: 13px; }
.responses td.answers div { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .survey-layout { grid-template-columns: 1fr; } .survey-preview { position: static; } }
@media (max-width: 640px) { .rule-row { grid-template-columns: 1fr auto; } .rule-row select { grid-column: 1 / -1; } .logic-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ A/B tests */
.test-edit { max-width: 980px; }
.card-title { font-size: 16px; margin: 0; }
.sub-title { font-size: 13px; margin: 6px 0 0; }
.rule-row.wide { grid-template-columns: 200px 1fr; }
.variations { display: grid; gap: 10px; }
.variation-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.variation-main { display: grid; gap: 6px; min-width: 0; }
.variation-main input { width: 100%; }
.variation-badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.variation-badge.control { background: var(--idle-soft); color: var(--text-2); }
.weight-field { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.weight-field input { width: 72px; }
.icon-btn-spacer { width: 32px; }
.variation-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.total { font-size: 13px; font-weight: 600; color: var(--good); }
.total.bad { color: var(--danger); }
.goal-row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.goal-head { display: grid; grid-template-columns: auto 1fr 220px auto; gap: 10px; align-items: center; }
.goal-head input { width: 100%; }
.snippet { display: flex; gap: 8px; align-items: flex-start; }
.snippet pre { flex: 1; margin: 0; white-space: pre-wrap; word-break: break-all; }
.verdict { margin-bottom: 16px; }
.verdict-box { padding: 14px 18px; border-radius: 12px; font-size: 14.5px; border: 1px solid var(--border); }
.verdict-box.good { background: var(--good-soft); border-color: transparent; }
.verdict-box.warn { background: var(--warn-soft); border-color: transparent; }
.verdict-box.idle { background: var(--surface); }
.results-table .variation-cell { display: grid; gap: 2px; max-width: 320px; white-space: normal; }
.results-table .variation-cell .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-table tbody tr { cursor: default; }
.results-table tr.winner { background: color-mix(in srgb, var(--good-soft) 60%, transparent); }
.results-table td.num .range { display: block; }
.results-table td.up { color: var(--good); font-weight: 600; }
.results-table td.down { color: var(--danger); font-weight: 600; }
.chance { display: flex; align-items: center; gap: 8px; min-width: 150px; font-variant-numeric: tabular-nums; }
.chance-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--idle-soft); overflow: hidden; }
.chance-bar i { display: block; height: 100%; background: var(--text-2); border-radius: 4px; }
.chance.good .chance-bar i { background: var(--good); }
.chance.bad .chance-bar i { background: var(--danger); }
.results-note { padding: 0 20px 16px; margin: 0; }
.danger-inline { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 720px) { .goal-head { grid-template-columns: 1fr auto; } .goal-head select { grid-column: 1 / -1; } .rule-row.wide { grid-template-columns: 1fr; } .variation-row { grid-template-columns: auto 1fr; } }

/* ------------------------------------------------------------------ installation */
.install-option { font-size: 14px; margin: 0 0 8px; }
.install-rules { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.install-alt { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; font-size: 13.5px; }
.install-alt summary { cursor: pointer; font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.check p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-2); }
.check-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 700; }
.check-ok .check-icon { background: var(--good-soft); color: var(--good); }
.check-warn .check-icon { background: var(--warn-soft); color: var(--warn); }
.check-info .check-icon, .check-wait .check-icon { background: var(--idle-soft); color: var(--text-2); }
.check-pages { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ------------------------------------------------------------------ events */
dialog.wide-dialog { width: min(640px, calc(100vw - 32px)); }
.dialog-body { display: grid; gap: 14px; padding: 22px; }
.dialog-body p { margin: 0; }
.dialog-body .snippet pre { white-space: pre-wrap; }
.recent-events h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0; }
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.recent-list li { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 10px; }
.type-title { font-size: 22px; margin: 8px 0 4px; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.type-card { display: grid; gap: 8px; padding: 22px; color: inherit; transition: border-color .15s; }
.type-card:hover { border-color: var(--accent); text-decoration: none; }
.type-card strong { font-size: 16px; }
.type-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); position: relative; }
.type-icon.visual::after { content: ""; position: absolute; inset: 12px 10px; border: 2px solid var(--accent); border-radius: 4px; box-shadow: inset 0 6px 0 var(--accent-soft), inset 0 8px 0 var(--accent); }
.type-icon.redirect::after { content: "→"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); font-size: 22px; font-weight: 700; }
.variant-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ visual A/B editor */
.ve-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ve-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ve-inline select { max-width: 280px; }
.ve-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ve-canvas { padding: 16px; min-height: 420px; overflow: hidden; }
.ve-hint { margin: 0 0 10px; }
.ve-frame iframe { pointer-events: auto; }
.ve-hover, .ve-selected { position: absolute; pointer-events: none; }
.ve-hover { outline: 2px dashed var(--accent); outline-offset: 1px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ve-hover span { position: absolute; left: -2px; top: -22px; background: var(--accent); color: var(--accent-text); font-size: 11.5px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.ve-selected { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.ve-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.ve-section { padding: 14px 16px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.ve-section:last-child { border-bottom: 0; }
.ve-actions { position: sticky; bottom: 0; z-index: 2; display: grid; gap: 8px; padding: 14px 16px; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); box-shadow: 0 -6px 12px -8px rgb(0 0 0 / 0.15); }
.ve-actions .btn, .ve-actions button { justify-content: center; text-align: center; width: 100%; }
.ve-actions .form-error { margin: 0; }
.ve-save-state { margin: 0; font-size: 13px; color: var(--muted); }
.ve-save-state.unsaved { color: var(--warn, #b45309); font-weight: 600; }
.ve-save-state.saved { color: var(--good); font-weight: 600; background: color-mix(in srgb, var(--good) 12%, transparent); padding: 8px 10px; border-radius: 8px; }
.ve-goal-on { margin: 0; color: var(--good); font-weight: 600; }
.ve-section h3 { font-size: 13px; margin: 0; }
.ve-section p { margin: 0; }
.ve-section textarea, .ve-section input[type=text] { width: 100%; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.ve-selected-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ve-selector { gap: 4px; }
.ve-tool summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.ve-tool[open] summary { margin-bottom: 4px; }
.ve-tool > button { justify-self: start; }
.ve-style-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; font-size: 12px; color: var(--muted); }
.ve-style-grid label { display: grid; gap: 4px; }
.ve-style-grid input[type=number] { width: 100%; }
.ve-color { display: inline-flex; align-items: center; gap: 6px; }
.ve-color input[type=color] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; }
.ve-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ve-changes li { display: flex; align-items: flex-start; gap: 6px; }
.ve-changes li.current .ve-change { border-color: var(--accent); }
.ve-change { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; white-space: normal; }
.ve-value { overflow-wrap: anywhere; color: var(--text-2); }
#css-box summary { cursor: pointer; font-weight: 600; font-size: 13px; }
#css-box button { justify-self: start; }
@media (max-width: 1100px) { .ve-layout { grid-template-columns: 1fr; } .ve-side { position: static; max-height: none; } }
.ve-catcher { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.ve-hover, .ve-selected { z-index: 2; }
.menu-version { font-size: 11.5px; padding: 8px 12px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.menu-version:empty { display: none; }
.has-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent); border-radius: 10px; }
.field-error-note { margin: -4px 0 0; }
#snippet { white-space: pre; overflow-x: auto; font-size: 12.5px; }

/* ------------------------------------------------------------------ live chat: settings tab */
.pill-bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.tab-count.hot { background: var(--danger); color: #fff; }
.inbox-bar { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.inbox-link { color: var(--text-2); font-weight: 500; padding: 6px 10px; border-radius: 8px; display: inline-flex; align-items: center; }
.inbox-link:hover, .inbox-link[aria-current=page] { background: var(--surface-2); color: var(--text); text-decoration: none; }
.inbox-bar + .user-menu { margin-left: 0; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-preview-card { position: sticky; top: 72px; }
.chat-preview { position: relative; height: 640px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--bg) 14px 28px); }
.switch-row, .agent-status { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch-row span, .agent-status span { display: grid; gap: 2px; }
.switch-row small, .agent-status small { color: var(--muted); font-size: 12.5px; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; margin: 1px 0 0; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .15s; }
input.switch:checked { background: var(--good); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:disabled { opacity: .5; cursor: default; }
.chat-state { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.chat-state.on { background: var(--good-soft); color: var(--good); }
.chat-state.off { background: var(--idle-soft); color: var(--text-2); }
.chat-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.chat-group legend { font-weight: 600; font-size: 13px; padding: 0 6px; color: var(--text-2); }
.chat-group textarea, .canned-form textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; resize: vertical; }
.chat-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.chat-row .grow { flex: 1 1 220px; }
.chat-group input[type=color] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

/* ------------------------------------------------------------------ live chat: Inbox */
.inbox-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 320px minmax(0, 1fr) 280px; }
.inbox.no-details, .panel-mode .inbox { grid-template-columns: 220px minmax(0, 1fr); }
.panel-mode .inbox-details { display: none; }
.inbox-nav { border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px; overflow-y: auto; display: grid; align-content: start; gap: 14px; }
.agent-status { padding: 10px; border-radius: 10px; background: var(--good-soft); }
.agent-status.away { background: var(--idle-soft); }
.chat-off-note { margin: 0; font-size: 12.5px; color: var(--warn); background: var(--warn-soft); padding: 8px 10px; border-radius: 8px; }
.views { display: grid; gap: 1px; }
.views h3 { margin: 12px 8px 4px; }
.views a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--text-2); }
.views a:hover { background: var(--surface-2); text-decoration: none; }
.views a[aria-current=true] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.views .count { font-size: 12px; color: var(--muted); font-weight: 600; }
.views .count.hot { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.list-tools { display: flex; gap: 8px; padding: 12px; flex-wrap: wrap; }
.list-tools input { flex: 1 1 160px; }
.list-tools select { flex: 1 1 100px; min-width: 0; }
.view-select { display: none; }
.conv-list { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; flex: 1; min-height: 0; }
.conv-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: grid; gap: 3px; border: 1px solid transparent; margin-bottom: 2px; }
.conv-item:hover { background: var(--surface); }
.conv-item.active { background: var(--surface); border-color: var(--accent); }
.conv-item.unread .conv-name, .conv-item.unread .conv-preview { font-weight: 700; color: var(--text); }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.conv-site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.unread-dot { margin-left: auto; background: var(--accent); color: var(--accent-text); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.list-empty { padding: 20px; text-align: center; }
.more-btn { margin: 0 12px 12px; justify-content: center; }
.inbox-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.conv-empty { margin: auto; text-align: center; padding: 24px; max-width: 360px; }
.conv { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.conv[hidden] { display: none; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.conv-title { flex: 1 1 200px; min-width: 0; }
.conv-title h2 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.conv-actions select { padding: 4px 8px; font-size: 13px; }
.back-btn { display: none; }
.conv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: grid; gap: 3px; max-width: min(640px, 80%); }
.bubble-row.visitor { align-self: flex-start; }
.bubble-row.agent { align-self: flex-end; justify-items: end; }
.bubble { padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--border); }
.bubble-row.visitor .bubble { border-bottom-left-radius: 4px; }
.bubble-row.agent .bubble { background: var(--accent); border-color: var(--accent); color: var(--accent-text); border-bottom-right-radius: 4px; }
.bubble-row.agent .bubble a { color: inherit; text-decoration: underline; }
.bubble-row.note .bubble { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.sys { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.sys.internal { font-style: italic; }
.peek { padding: 6px 20px 10px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.peek em { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: chat-blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes chat-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.composer { border-top: 1px solid var(--border); background: var(--surface); padding: 10px 16px 12px; display: grid; gap: 8px; }
.composer.note-mode { background: var(--warn-soft); }
.composer-tabs { justify-self: start; }
.composer-box { position: relative; }
.composer textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; resize: none; min-height: 64px; max-height: 240px; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.composer-foot .muted { margin-right: auto; }
.canned-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgb(16 24 40 / 14%); z-index: 5; max-height: 260px; overflow-y: auto; }
.canned-pop li { display: grid; gap: 1px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.canned-pop li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.canned-pop li.on, .canned-pop li:hover { background: var(--accent-soft); }
.inbox-details { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.detail-block { padding: 16px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.detail-block h3 { margin: 0; }
.visitor-head { display: flex; align-items: center; gap: 10px; }
.visitor-head strong { overflow-wrap: anywhere; }
.avatar.big { width: 40px; height: 40px; font-size: 14px; flex: none; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); margin-right: 6px; }
.status-dot.on { background: var(--good); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.tag-x { border: 0; background: none; padding: 0 0 0 6px; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.tag-x:hover { color: var(--danger); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.history li { display: grid; }
.panel-view { padding: 24px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.panel-view[hidden] { display: none; }
.panel-view .page-head { margin: 0; align-items: center; }
.panel-view .list-tools { padding: 0; }
.report-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; display: grid; gap: 4px; }
.tile-value { font-size: 24px; font-weight: 700; }
.report-table tbody tr { cursor: default; }
.canned-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.canned-list li.card { padding: 12px 16px; }
.canned-list p { margin: 6px 0 0; white-space: pre-wrap; color: var(--text-2); }
.canned-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.canned-actions { display: flex; gap: 6px; }
@media (max-width: 1250px) {
  .inbox { grid-template-columns: 200px 280px minmax(0, 1fr); }
  .inbox-details { display: none; }
}
@media (max-width: 900px) {
  .inbox, .panel-mode .inbox { grid-template-columns: 1fr; }
  .inbox-nav { display: none; }
  .show-conv .inbox-list { display: none; }
  body:not(.show-conv):not(.panel-mode) .inbox-main { display: none; }
  .back-btn { display: inline-flex; }
  .view-select { display: block; flex-basis: 100% !important; }
}

/* ------------------------------------------------------------------ email tickets */
.bubble-row.wide { max-width: min(760px, 92%); width: 100%; }
.bubble-row.auto .bubble { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.email-html { display: grid; gap: 4px; }
.email-frame { width: 100%; height: 120px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: block; }
.email-html .link-btn { justify-self: start; }
.email-full { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chips:empty { display: none; }
.file-chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); max-width: 280px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
a.file-chip:hover { border-color: var(--accent); text-decoration: none; }
.delivery { font-size: 12px; color: var(--good); }
.delivery.failed { color: var(--danger); }
.composer-to { margin: -2px 0 0; }
.attach-btn { cursor: pointer; justify-self: start; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check-inline input { accent-color: var(--accent); }
.group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.group-card { padding: 14px 16px; display: grid; gap: 10px; }
.group-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.forward-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.forward-row code { padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.setup-steps summary { cursor: pointer; }
.setup-steps ol { padding-left: 20px; display: grid; gap: 8px; }
#worker-code { max-height: 280px; overflow: auto; font-size: 12px; }
#group-dialog, #new-dialog { width: min(560px, calc(100vw - 32px)); }
#group-dialog textarea, #new-dialog textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; resize: vertical; }

/* ------------------------------------------------------------------ website settings: sections */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 72px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.settings-nav a:hover { background: var(--surface); text-decoration: none; }
.settings-nav a[aria-current=true] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.section-head p { margin: 4px 0 0; max-width: 720px; }
@media (max-width: 800px) {
  .settings-layout { grid-template-columns: 1fr; gap: 12px; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
}

.alerts-box { display: grid; gap: 4px; padding: 10px; border-radius: 10px; background: var(--warn-soft); font-size: 12.5px; }
.alerts-box.ok { background: var(--surface-2); }
.alerts-box strong { font-size: 13px; }
.alert-line:empty { display: none; }
.alerts-box .btn-small { justify-self: start; margin-top: 4px; }
.alerts-box .link-btn { justify-self: start; }
.routing-form { display: grid; gap: 14px; }
.sound-hint { margin: 0; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); cursor: pointer; }

.status-pill { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status-pill.on { background: var(--good-soft); color: var(--good); }
.status-pill.off { background: var(--idle-soft); color: var(--idle); }
.status-pill:hover { text-decoration: none; filter: brightness(0.97); }
@media (max-width: 700px) { .status-pill { font-size: 0; padding: 5px; } .status-pill::first-letter { font-size: 12px; } }
.live-actions { white-space: nowrap; text-align: right; }
.live-actions .btn-small { margin-right: 8px; }

/* ------------------------------------------------------------------ email template editor */
.et-page { display: flex; flex-direction: column; min-height: 100vh; }
.et-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.et-bar input.et-name { font-size: 15px; font-weight: 600; width: auto; flex: 0 1 360px; min-width: 200px; }
.et-spacer { flex: 1; }
.et { flex: 1; display: grid; grid-template-columns: minmax(420px, 1fr) 1fr; min-height: 0; }
.et-panel { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; max-height: 100vh; position: sticky; top: 0; align-self: start; }
.et-section { border-bottom: 1px solid var(--border); }
.et-section > summary { padding: 14px 18px; font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.et-section > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.et-section:not([open]) > summary::after { transform: rotate(-90deg); }
.et-fields { display: grid; gap: 14px; padding: 0 18px 18px; }
.et-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -6px; }
.tag-chip { border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 2px 9px; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); cursor: pointer; }
.tag-chip:hover { border-color: var(--accent); }
.et-groups { display: grid; gap: 12px; }
.et-group-site { display: grid; gap: 6px; }
.et-group-site .check span small { display: block; font-weight: 400; }
.et-canvas { padding: 28px 24px 40px; background: var(--bg); overflow: auto; }
.mail-window { max-width: 760px; margin: 0 auto; background: #fff; color: #1c2130; border-radius: 12px; box-shadow: 0 12px 32px rgb(16 24 40 / 14%), 0 0 0 1px rgb(16 24 40 / 8%); overflow: hidden; transition: max-width .2s; }
.mail-window.mobile { max-width: 390px; border-radius: 28px; }
.mail-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #f6f7f9; border-bottom: 1px solid #eaecf0; }
.mail-dots { display: flex; gap: 6px; }
.mail-dots i { width: 11px; height: 11px; border-radius: 50%; background: #d0d5dd; }
.mail-dots i:nth-child(1) { background: #f87171; } .mail-dots i:nth-child(2) { background: #fbbf24; } .mail-dots i:nth-child(3) { background: #34d399; }
.mail-head { padding: 18px 22px 14px; border-bottom: 1px solid #eaecf0; }
.mail-head h2 { font-size: 19px; margin: 0 0 14px; color: #1c2130; }
.mail-from { display: flex; gap: 12px; align-items: center; }
.mail-from .avatar { background: #eef0ff; color: #4f46e5; }
.mail-who { flex: 1; min-width: 0; color: #1c2130; overflow-wrap: anywhere; }
.mail-window .muted { color: #667085; }
.mail-time { align-self: flex-start; white-space: nowrap; }
.mail-window.mobile .mail-time { display: none; }
.et-frame { display: block; width: 100%; border: 0; min-height: 200px; }
.et-preview-as { text-align: center; margin-top: 14px; }
@media (max-width: 900px) {
  .et { grid-template-columns: 1fr; }
  .et-panel { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .et-canvas { padding: 16px; }
}
.template-row { display: flex; align-items: center; gap: 12px; }
.template-row .grow { flex: 1; min-width: 0; }
.et-code { display: grid; gap: 10px; padding: 14px 18px 18px; border-bottom: 1px solid var(--border); }
.et-html { width: 100%; min-height: 55vh; resize: vertical; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; overflow: auto; background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b; border-radius: 10px; padding: 12px 14px; }
.et-html:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.et-code-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.et-help { font-size: 12.5px; }
.et-help summary { cursor: pointer; font-weight: 600; }
.et-help dl { margin: 8px 0 0; display: grid; gap: 4px; }
.et-help dt { margin-top: 6px; }
.et-help dd { margin: 0; color: var(--muted); }
.et-help code { font-size: 11.5px; }

/* ------------------------------------------------------------------ screen sharing (Inbox) */
.screen-view { border-bottom: 1px solid var(--border); background: #0b0d12; display: flex; flex-direction: column; flex: none; }
.screen-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 13px; }
.screen-state { flex: 1 1 100%; color: var(--muted); }
.screen-state.live { color: #d92d20; font-weight: 600; }
.screen-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.screen-view video { display: block; width: 100%; max-height: 45vh; object-fit: contain; background: #0b0d12; }
.screen-view.big video { max-height: 72vh; }
.screen-stage { position: relative; overflow: hidden; }
.screen-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.screen-canvas.drawing { pointer-events: auto; cursor: crosshair; touch-action: none; }
.screen-ink { display: inline-flex; align-items: center; gap: 6px; }
.screen-ink [aria-pressed=true]#screen-draw { background: var(--accent-soft); border-color: var(--accent); }
.ink-colors { display: inline-flex; gap: 4px; }
.ink-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; box-shadow: 0 0 0 1px var(--border); }
.ink-color[aria-pressed=true] { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.screen-stage:fullscreen { display: flex; align-items: center; justify-content: center; background: #0b0d12; }
.screen-stage:fullscreen video { max-height: 100vh; height: 100vh; }
.screen-away { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--accent-soft); font-size: 13px; flex: none; }
.screen-popup { margin: 0; background: #0b0d12; }
.screen-popup .screen-view { min-height: 100vh; border: 0; }
.screen-popup .screen-view video { max-height: calc(100vh - 52px); height: calc(100vh - 52px); }
.screen-ink-note { margin: 0; padding: 6px 12px; font-size: 12.5px; background: var(--warn-soft); color: var(--text); border-bottom: 1px solid var(--border); }

/* ------------------------------------------------------------------ element picker (A/B goals) */
dialog.picker-dialog { width: min(1180px, calc(100vw - 32px)); height: calc(100vh - 48px); max-height: none; display: none; }
dialog.picker-dialog[open] { display: flex; flex-direction: column; }
.picker-dialog > * { flex: none; }
.picker-dialog > .picker-canvas { flex: 1 1 auto; min-height: 0; }
.picker-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.picker-head > div:first-child { flex: 1 1 260px; }
.picker-head h2 { margin: 0 0 2px; }
.picker-head p { margin: 0; }
.picker-head input { width: 260px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.picker-dialog .notice-box { margin: 12px 20px 0; }
.picker-canvas { overflow: auto; padding: 16px 20px; background: var(--surface-2); }
.picker-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border); }
.picker-picked { min-width: 0; overflow-wrap: anywhere; }
.picker-picked code { font-size: 12px; }
.goal-pick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.goal-selector summary { cursor: pointer; margin-bottom: 6px; }
.goal-selector input { width: 100%; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.goal-pick select { max-width: 420px; }
.report-filters { margin-bottom: 12px; }
.test-filter { margin-bottom: 12px; flex-wrap: wrap; }
.test-filter .muted { font-weight: 400; margin-left: 2px; }
#test-rows td.num .btn-small { margin-right: 10px; white-space: nowrap; }
#test-rows td.num { white-space: nowrap; }
.api-key-card { margin-top: 16px; }
.source-choice { display: grid; gap: 8px; }
.api-fields { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.bubble-meta .avatar { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.picture-row > div:last-child:not(.actions) { flex: 1 1 220px; min-width: 0; display: grid; gap: 6px; }

/* ------------------------------------------------------------------ marketing */
.mk-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.mk-nav { border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px; }
.mk-nav .views h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin: 14px 10px 4px; font-weight: 600; }
.mk-main { padding: 24px 28px 48px; min-width: 0; max-width: 1280px; }
.mk-main h1 { font-size: 22px; margin: 0 0 4px; }
.mk-main .section-head { align-items: flex-start; }
.mk-main .section-head p { max-width: 720px; }
@media (max-width: 800px) {
  .mk-layout { grid-template-columns: 1fr; }
  .mk-nav { border-right: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; }
  .mk-nav .views { display: flex; flex-wrap: wrap; gap: 4px; }
  .mk-nav .views h3 { display: none; }
  .mk-main { padding: 16px; }
}
.mk-ch { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); font-weight: 600; }
.mk-channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .mk-channels { grid-template-columns: 1fr; } }
.mk-channel { padding: 16px 20px; display: grid; gap: 6px; }
.mk-channel-head { display: flex; justify-content: space-between; align-items: center; }
.mk-channel-num { font-size: 26px; font-weight: 600; }
.mk-steps ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.mk-steps li.done a { color: var(--muted); text-decoration: line-through; }
.mk-steps li.done { color: var(--good); }
.mk-clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.mk-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
@media (max-width: 640px) { .mk-two, .mk-three { grid-template-columns: 1fr; } }
.mk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mk-row .field { flex: 1 1 200px; }
.mk-dialog.wide-dialog { width: min(820px, calc(100vw - 32px)); }
.mk-dialog .dialog-body { display: grid; gap: 14px; padding: 22px; max-height: calc(100vh - 80px); overflow-y: auto; }
.mk-dialog .dialog-body h2 { margin: 0; }
.mk-segment-dialog, .mk-user-dialog { width: min(980px, calc(100vw - 32px)) !important; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 3px 4px 3px 11px; font-size: 13px; }
.chip button { border: 0; background: none; color: var(--muted); padding: 0 6px; font-size: 15px; line-height: 1; cursor: pointer; }
.chip-add { font-size: 13px; padding: 4px 8px; border-radius: 999px; }
.mk-reach { margin: -4px 0 0; }
.mk-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mk-pick-card { display: grid; gap: 8px; justify-items: center; padding: 20px 12px; cursor: pointer; border: 1px solid var(--border); }
.mk-pick-card:hover { border-color: var(--accent); }
.mk-pick-icon { font-size: 28px; }
.mk-result { max-height: 220px; overflow: auto; margin: 0; }
.user-pick { position: relative; flex: 1 1 260px; }
.user-pick input { width: 100%; }
.user-pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgb(0 0 0 / 14%); padding: 4px; display: grid; }
.user-pick-list button { display: flex; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 7px; }
.user-pick-list button:hover { background: var(--accent-soft); }
.mk-help summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.mk-help ul, .mk-help ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.mk-help code, .mk-main code { overflow-wrap: anywhere; }
/* segments */
.mk-groups { display: grid; gap: 8px; }
.mk-group { padding: 12px 14px; display: grid; gap: 8px; background: var(--surface-2); }
.mk-group-head { display: flex; justify-content: space-between; align-items: center; }
.mk-or { text-align: center; font-weight: 700; font-size: 12px; color: var(--accent); letter-spacing: .08em; }
.mk-filter { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 12px; }
.mk-filter strong { min-width: 120px; }
.mk-filter select, .mk-filter input { font-size: 13px; padding: 5px 8px; }
.mk-row input.mk-small-input { width: 90px; }
.mk-filter input.mk-small-input { width: 130px; }
.mk-filter input[type=number] { width: 84px; }
.mk-filter input[type=text]:not(.mk-small-input), .mk-filter input[type=search] { width: 200px; }
.mk-add-filter { justify-self: start; font-size: 13px; }
.mk-count { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
/* users */
.mk-subs { display: inline-flex; gap: 4px; }
.mk-subs span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.mk-subs .on { background: var(--good-soft); }
.mk-subs .off { background: var(--surface-2); opacity: .55; filter: grayscale(1); }
.mk-subs .none { opacity: .18; filter: grayscale(1); }
.mk-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 12px; }
.mk-user { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 800px) { .mk-user { grid-template-columns: 1fr; } }
.mk-user > div:first-child { display: grid; gap: 12px; }
.mk-tags { display: grid; gap: 6px; }
.mk-tag-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 6px; }
.mk-sub-list { display: grid; gap: 6px; }
.mk-sub { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.mk-activity { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; max-height: 560px; overflow-y: auto; }
.mk-activity h3 { font-size: 13px; margin: 8px 0 6px; }
.mk-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
/* settings */
.mk-card { margin-bottom: 16px; }
.mk-card .card-body { display: grid; gap: 14px; }
.mk-install { border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.mk-install p { margin: 0; }
.mk-saved { font-size: 13px; }
/* template editor */
.mk-editor-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.mk-name { font-size: 18px; font-weight: 600; border: 1px solid transparent; background: none; padding: 6px 8px; border-radius: 8px; min-width: 260px; flex: 0 1 420px; }
.mk-name:hover, .mk-name:focus { border-color: var(--border); background: var(--surface); }
.mk-editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .mk-editor { grid-template-columns: 1fr; } }
.mk-preview-col { position: sticky; top: 16px; }
.mk-preview-head { display: flex; justify-content: space-between; align-items: baseline; }
.mk-code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; tab-size: 2; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mk-counter { text-align: right; }
.mk-dc td, .mk-dc th { font-size: 12.5px; }
.mk-feeds { display: grid; gap: 8px; }
.mk-push-preview { background: linear-gradient(160deg, #dfe6f5, #c9d3ea); border-radius: 14px; padding: 18px 14px; }
.mk-push-card { background: rgb(255 255 255 / 94%); color: #111; border-radius: 14px; padding: 12px; box-shadow: 0 4px 14px rgb(0 0 0 / 12%); display: grid; gap: 8px; }
.mk-push-top { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.35; }
.mk-push-top img, .mk-push-icon { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; display: grid; place-items: center; background: #eef0ff; font-size: 20px; }
.mk-push-image { width: 100%; border-radius: 10px; max-height: 200px; object-fit: cover; }
.mk-push-url { overflow-wrap: anywhere; }
.mk-sms-preview { background: var(--surface-2); border-radius: 14px; padding: 18px; min-height: 120px; }
.mk-sms-bubble { background: #e9e9eb; color: #111; border-radius: 18px 18px 18px 5px; padding: 10px 14px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.mk-email-preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.mk-email-head { padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mk-email-frame { width: 100%; height: 520px; border: 0; display: block; background: #fff; }
.mk-unsaved { color: var(--warn); font-weight: 600; }
/* journey builder */
.mk-journey { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .mk-journey { grid-template-columns: 1fr; } }
.mk-canvas { padding: 24px 16px 40px; overflow-x: auto; background: var(--surface-2); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 18px 18px; min-height: 480px; }
.mk-flow { display: flex; flex-direction: column; align-items: center; min-width: max-content; margin: 0 auto; }
.mk-node { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left; width: 280px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 6%); cursor: pointer; font: inherit; color: inherit; }
.mk-node:hover { border-color: var(--accent); }
.mk-node.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mk-node .small { line-height: 1.35; }
.mk-entry { border-width: 2px; }
.mk-node-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; font-size: 17px; }
.mk-node-count { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.mk-node-stats { color: var(--good); margin-top: 2px; }
.mk-line { position: relative; width: 2px; height: 44px; background: var(--border); display: grid; place-items: center; }
.mk-plus { position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--accent); font-weight: 700; padding: 0; display: grid; place-items: center; line-height: 1; opacity: .7; }
.mk-line:hover .mk-plus, .mk-plus:focus { opacity: 1; border-color: var(--accent); }
.mk-add-menu { position: absolute; z-index: 20; top: 34px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 16%); padding: 6px; display: grid; min-width: 200px; }
.mk-add-menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.mk-add-menu button:hover { background: var(--accent-soft); }
.mk-end { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 999px; padding: 3px 12px; }
.mk-branches { display: flex; gap: 28px; align-items: flex-start; border-top: 2px solid var(--border); padding-top: 0; margin-top: 0; position: relative; }
.mk-branch { display: flex; flex-direction: column; align-items: center; }
.mk-branch-label { font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin-top: -12px; white-space: nowrap; }
.mk-side { padding: 16px 18px; position: sticky; top: 16px; display: grid; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
.mk-side h2 { font-size: 16px; margin: 0; }
.mk-side h3 { font-size: 14px; margin: 8px 0 0; }
.mk-side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
