:root {
  --bg: #ecebf5;
  --surface: #faf9ff;
  --surface-2: #f2f0f8;
  --sidebar: #252347;
  --sidebar-2: #393664;
  --text: #202039;
  --muted: #656176;
  --line: #d8d4e6;
  --violet: #5b55da;
  --coral: #e76c72;
  --gold: #f8d37a;
  --green: #2f8c68;
  --danger: #be4662;
  --shadow: 0 14px 34px rgba(53, 48, 91, .07);
  --radius: 22px;
  --data: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'PingFang HK', 'Noto Sans TC', sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 300px; background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:active:not(:disabled) { transform: translateY(1px); }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 30%, transparent); outline-offset: 2px; }

.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: 244px;
  display: flex; flex-direction: column; padding: 28px 20px 20px;
  color: #f8f5ff; background: var(--sidebar); border-radius: 0 26px 26px 0;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; font-weight: 700; text-decoration: none; }
.brand em { color: #aaa5ff; font-style: normal; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; background: var(--gold); color: var(--sidebar); font: 700 11px/1 var(--data); }
.side-section { min-height: 0; margin-top: 35px; }
.side-label { margin: 0 10px 10px; color: #918daa; font: 500 10px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; }
.side-search { position: relative; display: block; }
.side-search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: #918daa; }
.side-search input { width: 100%; height: 40px; padding: 0 10px 0 34px; border: 1px solid #46426f; border-radius: 10px; background: #302d55; color: white; font-size: 13px; }
.side-search input::placeholder { color: #918daa; }
.project-list { display: grid; gap: 5px; max-height: min(38vh, 330px); margin-top: 10px; overflow: auto; scrollbar-width: thin; }
.project-item { display: flex; align-items: center; gap: 9px; min-width: 0; width: 100%; min-height: 44px; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent; color: #aaa6c2; text-align: left; }
.project-item:hover, .project-item.active { background: var(--sidebar-2); color: white; }
.project-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.project-item.active .project-dot { background: var(--gold); box-shadow: 0 0 12px rgba(248, 211, 122, .65); }
.project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.side-nav { display: grid; gap: 5px; margin-top: 28px; }
.side-nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 11px; border: 0; border-radius: 10px; background: transparent; color: #aaa6c2; font-weight: 600; text-align: left; }
.side-nav-item svg { width: 17px; height: 17px; }
.side-nav-item:hover, .side-nav-item.active { color: white; background: var(--sidebar-2); }
.nav-count { display: grid; place-items: center; min-width: 22px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.09); font: 500 10px/1 var(--data); }
.logout { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; margin-top: auto; padding: 8px; border: 1px solid #46426f; border-radius: 13px; background: transparent; color: #c4c0d4; }
.logout .avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--sidebar); font: 700 10px/1 var(--data); }
.logout svg { width: 16px; height: 16px; margin-left: auto; }

.workspace { min-width: 0; min-height: 100dvh; margin-left: 244px; padding: 28px clamp(22px, 3vw, 48px) 50px; }
.workspace-inner { width: 100%; max-width: 1440px; margin: 0 auto; }
.mobile-brand { display: none; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.funnel-picker-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.funnel-picker-wrap > label { color: var(--muted); font: 500 10px/1 var(--data); letter-spacing: .1em; text-transform: uppercase; }
#funnel-select { width: min(390px, 42vw); max-width: 100%; min-height: 42px; padding: 0 34px 0 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font-weight: 600; text-overflow: ellipsis; }
.live-status { display: inline-flex; align-items: center; gap: 6px; color: var(--coral); font: 600 9px/1 var(--data); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.live-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.live-status.closed { color: var(--green); }
.live-status.baseline { color: var(--muted); }
.live-status.collecting { color: var(--green); }
.top-actions { display: flex; gap: 9px; }
.primary-action, .secondary-action, .text-action, .danger-text, .danger-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 15px; border-radius: 11px; font-weight: 700; }
.danger-action { border: 1px solid var(--line); background: var(--surface); color: var(--danger); }
.danger-action:hover { border-color: var(--danger); background: var(--danger); color: #fff; }
.danger-action svg { width: 16px; height: 16px; }
.primary-action { border: 1px solid var(--violet); background: var(--violet); color: white; }
.primary-action:hover { background: #4e49c9; }
.secondary-action { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.secondary-action:hover { border-color: var(--violet); color: var(--violet); }
.primary-action svg, .secondary-action svg { width: 16px; height: 16px; }
.text-action, .danger-text { border: 0; background: transparent; color: var(--muted); }
.danger-text { color: var(--danger); margin-right: auto; }

.view-switcher {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  width: min(760px, 100%); margin-top: 26px; padding: 4px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface-2);
}
.view-switcher button {
  display: grid; align-content: center; gap: 3px; min-height: 56px; padding: 9px 16px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); text-align: left; transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.view-switcher button:hover { color: var(--text); }
.view-switcher button.active { background: var(--surface); color: var(--violet); box-shadow: 0 2px 8px rgba(53,48,91,.1); }
.view-switcher span { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.view-switcher small { font-size: 10px; line-height: 1.3; }
.view-switcher .mobile-archive-tab { display: none; }

.page-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; margin-top: 34px; }
.page-kicker { margin: 0 0 8px !important; color: var(--violet) !important; font: 600 10px/1 var(--data) !important; letter-spacing: .12em; text-transform: uppercase; }
.page-intro h1 { max-width: 760px; margin: 0; font-size: clamp(34px, 3vw, 46px); line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.page-intro p { max-width: 680px; margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.date-controls { display: flex; gap: 7px; max-width: 100%; }
.date-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.date-controls button:hover { border-color: var(--violet); color: var(--text); }
.date-controls button[aria-pressed="true"] { border-color: var(--sidebar); background: var(--sidebar); color: white; }
.date-controls svg { width: 14px; height: 14px; }
.custom-date-panel { display: flex; align-items: end; gap: 10px; width: fit-content; max-width: 100%; margin: 14px 0 0 auto; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.custom-date-panel label { color: var(--muted); font-size: 11px; font-weight: 600; }
.custom-date-panel input { display: block; min-height: 40px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); }
.date-arrow { align-self: center; margin-top: 18px; color: var(--muted); }
.date-apply { min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--violet); color: white; font-weight: 700; }

#overview-view, #funnel-view, #archive-view { margin-top: 26px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; display: flex; min-width: 0; min-height: 124px; padding: 19px 20px 20px; overflow: hidden; contain: paint; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); flex-direction: column; justify-content: space-between; }
.kpi::after { content: ''; position: absolute; right: -25px; bottom: -28px; width: 82px; height: 82px; border-radius: 50%; background: linear-gradient(135deg, transparent, var(--surface-2)); }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.kpi-value { position: relative; z-index: 1; margin-top: 14px; font: 500 clamp(30px, 3vw, 40px)/1 var(--data); font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.kpi:last-child .kpi-value { color: var(--coral); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .8fr); gap: 12px; margin-top: 12px; align-items: start; }
.panel { min-width: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 20px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.025em; text-wrap: balance; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font: 400 10px/1.5 var(--data); overflow-wrap: anywhere; }
.status-badge { flex: none; padding: 6px 9px; border-radius: 999px; background: #fde8e9; color: #bb4f5a; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.status-badge.winner { background: color-mix(in srgb, var(--gold) 55%, white); color: #6c5412; }
.status-badge.closed { background: #e3f1eb; color: #2f7259; }
.status-badge.collecting { background: #e3f1eb; color: #2f7259; }

.variant-head, .variant-row { display: grid; grid-template-columns: 40px minmax(120px, 1fr) 96px 78px 78px 78px; gap: 8px; align-items: center; }
.variant-head { padding: 12px 20px 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.variant-row { min-height: 62px; margin: 0 20px; border-top: 1px solid var(--line); font-size: 12px; }
.variant-key { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); font: 700 11px/1 var(--data); }
.variant-row.winner .variant-key { background: var(--gold); color: var(--sidebar); }
.variant-name { min-width: 0; }
.variant-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.variant-name small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font: 400 9px/1.3 var(--data); text-overflow: ellipsis; white-space: nowrap; }
.open-lp-slot { display: flex; justify-content: center; min-width: 0; }
.open-lp { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--violet); font-size: 10px; font-weight: 600; line-height: 1.4; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.open-lp:hover { border-color: var(--violet); background: var(--violet); color: #fff; }
.open-lp:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.data-number { font-family: var(--data); font-size: 11px; }
.rate-number { color: var(--violet); font-weight: 500; }
.winner-word { color: var(--coral); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.experiment-note { margin: 12px 20px 0; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.experiment-note strong { color: var(--text); }
.panel-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 20px 19px; }
.panel-actions button { min-height: 40px; padding: 0 13px; border-radius: 10px; font-weight: 700; }
.end-test { border: 1px solid var(--violet); background: var(--violet); color: white; }
.add-test-version, .traffic-allocation-action { border: 1px solid var(--line); background: transparent; color: var(--violet); }
.add-test-version:hover, .traffic-allocation-action:hover { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 6%, transparent); }
.delete-variation { margin-right: auto; border: 1px solid transparent; background: transparent; color: var(--danger); }
.delete-variation:hover { border-color: var(--danger); }
.baseline-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 20px; }
.baseline-summary > div { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.baseline-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: #e3f1eb; color: var(--green); font: 600 16px/1 var(--data); }
.baseline-summary strong { display: block; }
.baseline-summary p { max-width: 470px; margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.baseline-summary button { flex: none; min-height: 40px; padding: 0 13px; border: 1px solid var(--violet); border-radius: 10px; background: transparent; color: var(--violet); font-weight: 700; }
.single-version-status { display: grid; grid-template-columns: 102px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 24px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, color-mix(in srgb, #e3f1eb 58%, var(--surface)), var(--surface) 54%); }
.allocation-orbit { position: relative; display: grid; place-content: center; width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--green) 0 100%); color: var(--text); text-align: center; }
.allocation-orbit::before { content: ''; position: absolute; inset: 7px; border-radius: inherit; background: var(--surface); }
.allocation-orbit span, .allocation-orbit small { position: relative; z-index: 1; }
.allocation-orbit span { font: 500 21px/1 var(--data); letter-spacing: -.06em; }
.allocation-orbit small { margin-top: 5px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.single-version-kicker { margin: 0 0 5px !important; color: var(--green) !important; font: 600 9px/1 var(--data) !important; letter-spacing: .1em; text-transform: uppercase; }
.single-version-copy h3 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.03em; }
.single-version-copy > p:last-child { max-width: 540px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.start-test-button { min-height: 44px; padding: 0 15px; border: 1px solid var(--violet); border-radius: 11px; background: var(--violet); color: white; font-weight: 700; white-space: nowrap; }
.start-test-button:hover { background: #4e49c9; }
.single-row .variant-key { background: var(--gold); color: var(--sidebar); }
.weight-number { color: var(--green); font-weight: 600; }
.single-version-name b { overflow: visible; text-overflow: clip; }
.single-version-name small { font-size: 10px; }
.traffic-list { padding: 6px 20px 14px; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 11px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.source-row:last-child { border-bottom: 0; }
.source-row > span:nth-child(n+2) { font: 400 10px/1 var(--data); }
.source-rate { color: var(--muted); }
.source-bar { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.source-bar i { display: block; height: 100%; border-radius: inherit; background: var(--violet); }
.daily-strip { display: flex; align-items: end; gap: 4px; height: 74px; padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.daily-strip i { flex: 1; min-width: 2px; border-radius: 4px 4px 1px 1px; background: color-mix(in srgb, var(--violet) 64%, var(--surface-2)); }
.data-warning { margin-top: 12px; padding: 13px 15px; border: 1px solid #efd1d7; border-radius: 13px; background: #fff3f5; color: #8f4254; font-size: 12px; }
.empty-state { padding: 70px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 16px; background: var(--surface-2); color: var(--violet); font: 600 20px/1 var(--data); }
.empty-state h2 { margin: 0; font-size: 20px; }
.empty-state p { max-width: 420px; margin: 8px auto 0; color: var(--muted); }
.loading-card { height: 300px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), #f0eef7, var(--surface)); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

.archive-stack { display: grid; gap: 12px; }
.archive-card { padding: 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.archive-card-head { display: flex; justify-content: space-between; gap: 12px; }
.archive-card h2 { margin: 0; font-size: 18px; }
.archive-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.archive-variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 16px; }
.archive-variant { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.archive-variant.winner { border-color: #e4c45f; background: #fff8da; }
.archive-variant-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.archive-variant b { font-family: var(--data); }
.archive-variant small { display: block; margin-top: 7px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.archive-numbers { display: flex; gap: 12px; margin-top: 11px; font: 400 10px/1 var(--data); }

.modal { width: min(860px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 28px 80px rgba(32, 29, 66, .28); }
.modal::backdrop { background: rgba(24, 22, 49, .58); backdrop-filter: blur(5px); }
.modal-head { display: flex; justify-content: space-between; gap: 18px; padding: 24px 26px 20px; border-bottom: 1px solid var(--line); }
.modal-kicker { margin: 0 0 6px !important; color: var(--violet) !important; font: 600 9px/1 var(--data) !important; letter-spacing: .12em; text-transform: uppercase; }
.modal-head h2, .success-view h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.modal-head p, .success-view > p { margin: 5px 0 0; color: var(--muted); }
.modal-close { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 25px; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 21px 26px 25px; }
.field-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.field { width: 100%; min-height: 46px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--text); font-size: 16px; }
.field:focus { border-color: var(--violet); outline: 3px solid color-mix(in srgb, var(--violet) 14%, transparent); }
.batch-version-fields { display: grid; gap: 10px; }
.batch-version-field { display: grid; grid-template-columns: 34px minmax(140px, .48fr) minmax(260px, 1fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.batch-version-field .field { min-width: 0; margin-top: 0; background: var(--surface); }
.batch-version-copy { min-width: 0; }
.batch-version-copy b, .batch-version-copy small { display: block; }
.batch-version-copy b { font-size: 13px; }
.batch-version-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.traffic-editor { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.traffic-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.traffic-editor-head b, .traffic-editor-head span { display: block; }
.traffic-editor-head span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.traffic-editor-head button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--violet); font-size: 11px; font-weight: 700; white-space: nowrap; }
.traffic-editor-head button:hover { border-color: var(--violet); }
.traffic-total { display: flex; justify-content: space-between; gap: 14px; margin-top: 15px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font: 500 10px/1.3 var(--data); }
.traffic-total b { color: var(--violet); white-space: nowrap; }
.traffic-range-list { display: grid; gap: 2px; margin-top: 8px; }
.traffic-range-row { display: grid; grid-template-columns: 34px minmax(115px, .7fr) minmax(200px, 1.5fr) 44px; gap: 11px; align-items: center; min-height: 58px; border-bottom: 1px solid var(--line); }
.traffic-range-row:last-child { border-bottom: 0; }
.traffic-version-key { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--version-color, var(--violet)); color: var(--version-ink, #fff); font: 700 11px/1 var(--data); }
.traffic-version-name { min-width: 0; }
.traffic-version-name b, .traffic-version-name small { display: block; }
.traffic-version-name b { font-size: 12px; }
.traffic-version-name small { margin-top: 2px; overflow: hidden; color: var(--muted); font: 400 9px/1.3 var(--data); text-overflow: ellipsis; white-space: nowrap; }
.traffic-range { width: 100%; height: 22px; margin: 0; appearance: none; background: transparent; cursor: ew-resize; }
.traffic-range::-webkit-slider-runnable-track { height: 7px; border-radius: 99px; background: linear-gradient(90deg, var(--violet) 0 var(--range-value), var(--surface-2) var(--range-value) 100%); }
.traffic-range::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8px; appearance: none; border: 3px solid var(--surface); border-radius: 50%; background: var(--violet); box-shadow: 0 2px 8px rgba(37,35,71,.28); }
.traffic-range::-moz-range-track { height: 7px; border-radius: 99px; background: var(--surface-2); }
.traffic-range::-moz-range-progress { height: 7px; border-radius: 99px; background: var(--violet); }
.traffic-range::-moz-range-thumb { width: 17px; height: 17px; border: 3px solid var(--surface); border-radius: 50%; background: var(--violet); box-shadow: 0 2px 8px rgba(37,35,71,.28); }
.traffic-range-row output { color: var(--violet); font: 600 12px/1 var(--data); text-align: right; }
.traffic-note { margin: 12px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.traffic-modal .traffic-editor { margin-top: 0; }
.variant-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 19px; }
.variant-input-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.variant-input-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.variant-input-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.variant-input-title span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--violet); color: white; font: 700 11px/1 var(--data); }
.variant-input-card:first-child .variant-input-title span { background: var(--gold); color: var(--sidebar); }
.remove-variant { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 600; }
.add-variant { width: 100%; min-height: 44px; margin-top: 10px; border: 1px dashed #aaa5c5; border-radius: 13px; background: transparent; color: var(--violet); font-weight: 700; }
.allocation { margin-top: 23px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; }
.allocation-head b { display: block; }
.allocation-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.allocation-labels { display: flex; margin-top: 15px; font: 500 11px/1 var(--data); }
.allocation-labels span { min-width: 0; text-align: center; }
.allocation-bar { position: relative; display: flex; height: 18px; margin: 14px 3px 8px; border-radius: 99px; background: var(--surface-2); touch-action: none; }
.allocation-segment { min-width: 0; height: 100%; }
.allocation-segment:first-child { border-radius: 99px 0 0 99px; }
.allocation-segment:last-of-type { border-radius: 0 99px 99px 0; }
.allocation-handle { position: absolute; z-index: 2; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; border-radius: 50%; background: transparent; touch-action: none; cursor: ew-resize; }
.allocation-handle::before { content: ''; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: white; border: 2px solid var(--violet); box-shadow: 0 3px 10px rgba(37,35,71,.28); }
.allocation-handle::after { content: '↔'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--violet); font: 700 12px/1 var(--data); }
.allocation-handle:hover::before, .allocation-handle:focus-visible::before { transform: scale(1.08); box-shadow: 0 4px 14px rgba(37,35,71,.35); }
.test-split { margin-top: 20px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.test-split-head, .test-split-labels { display: flex; justify-content: space-between; gap: 12px; }
.test-split-head span { color: var(--muted); font: 500 11px/1 var(--data); }
.test-split input[type="range"] { width: 100%; margin: 23px 0 13px; accent-color: var(--violet); cursor: ew-resize; }
.test-split-labels { font-size: 12px; }
.test-split-labels b { color: var(--violet); font-family: var(--data); }
.form-error { min-height: 20px; margin-top: 13px; color: var(--danger); font-size: 13px; font-weight: 600; }
.modal-kicker.danger { color: var(--danger) !important; }
.danger-note { margin-bottom: 18px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent); border-radius: 11px; background: color-mix(in srgb, var(--danger) 7%, transparent); color: var(--danger); font-size: 12px; font-weight: 600; line-height: 1.5; }
.danger-submit { min-height: 44px; padding: 0 15px; border: 1px solid var(--danger); border-radius: 11px; background: var(--danger); color: #fff; font-weight: 700; }
.danger-submit:hover { background: #a63a53; }
.danger-submit:disabled { opacity: .55; }
.delete-variation-options { display: grid; gap: 8px; margin-bottom: 18px; }
.delete-variation-row { display: grid; grid-template-columns: auto 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.delete-variation-row:has(input:checked) { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.delete-variation-row input { width: 16px; height: 16px; accent-color: var(--danger); }
.delete-variation-meta { min-width: 0; font-size: 12px; }
.delete-variation-meta b { display: block; }
.delete-variation-meta small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font: 400 9px/1.3 var(--data); text-overflow: ellipsis; white-space: nowrap; }
.delete-variation-stat { color: var(--muted); font: 400 10px/1.3 var(--data); white-space: nowrap; }
.modal-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 26px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.success-view { padding: 42px 26px; text-align: center; }
.success-mark { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 17px; border-radius: 50%; background: #e4f3ec; color: var(--green); font-size: 28px; }
.success-view .field-label { max-width: 620px; margin: 25px auto 0; text-align: left; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.copy-field button { min-height: 46px; margin-top: 7px; padding: 0 16px; border: 1px solid var(--violet); border-radius: 11px; background: transparent; color: var(--violet); font-weight: 700; }
.copy-status { min-height: 20px; margin-top: 8px; color: var(--green); font-size: 12px; }
.winner-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.winner-option { position: relative; }
.winner-option input { position: absolute; opacity: 0; pointer-events: none; }
.winner-option label { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 66px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); cursor: pointer; }
.winner-option input:checked + label { border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 12%, transparent); }
.winner-option-key { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: white; font: 700 12px/1 var(--data); }
.winner-option-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.winner-option-rate { color: var(--violet); font: 500 11px/1 var(--data); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: calc(100% - 30px); padding: 11px 16px; border-radius: 11px; background: var(--sidebar); color: white; box-shadow: 0 12px 30px rgba(0,0,0,.2); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 22px; }
.login-card { width: 100%; max-width: 370px; padding: 30px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 25px; color: var(--text); }
.login-card .brand svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--gold); color: var(--sidebar); }
.login-card label { display: block; margin-bottom: 7px; color: var(--muted); font-weight: 600; }
.btn { width: 100%; min-height: 46px; margin-top: 14px; border: 0; border-radius: 11px; background: var(--violet); color: white; font-weight: 700; }
.error { display: flex; gap: 7px; align-items: center; min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.error svg { width: 15px; height: 15px; }

@media (max-width: 980px) {
  .sidebar { width: 214px; }
  .workspace { margin-left: 214px; padding-inline: 20px; }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding: calc(15px + env(safe-area-inset-top)) 14px calc(32px + env(safe-area-inset-bottom)); }
  .workspace-inner { max-width: none; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; height: 44px; margin: -15px -14px 16px; padding: 0 14px; background: var(--sidebar); color: white; font-weight: 600; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 9px; }
  .mobile-brand b { color: #aaa5ff; }
  .topline { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
  .funnel-picker-wrap { display: grid; gap: 7px; min-width: 0; }
  .funnel-picker-wrap > label { grid-column: 1/-1; }
  #funnel-select { width: 100%; max-width: none; min-width: 0; }
  .live-status { display: none; }
  .top-actions { flex: none; }
  .secondary-action, .danger-action { width: 44px; padding: 0; }
  .secondary-action span, .danger-action span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .primary-action { padding-inline: 12px; }
  #create-open span { display: none; }
  .view-switcher { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px; margin-top: 18px; }
  .view-switcher button { min-height: 52px; padding-inline: 11px; }
  .view-switcher span { font-size: 13px; line-height: 1.2; }
  .view-switcher .mobile-archive-tab { position: relative; display: grid; place-items: center; padding: 0; }
  .mobile-archive-tab svg { width: 17px; height: 17px; }
  .mobile-archive-tab i { position: absolute; top: 6px; right: 5px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--sidebar); color: white; font: normal 500 8px/1 var(--data); }
  .mobile-archive-tab.active i { background: var(--gold); color: var(--sidebar); }
  .page-intro { display: block; margin-top: 27px; }
  .page-intro h1 { max-width: 100%; font-size: 29px; line-height: 1.04; }
  .page-intro p { margin-top: 9px; font-size: 13px; line-height: 1.5; }
  .date-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 5px; width: 100%; margin-top: 17px; overflow: visible; padding: 2px 0 4px; }
  .date-controls::-webkit-scrollbar { display: none; }
  .date-controls button { min-width: 0; min-height: 44px; padding-inline: 7px; }
  .custom-date-panel { display: grid; grid-template-columns: 1fr 18px 1fr; width: 100%; margin-left: 0; }
  .custom-date-panel label { min-width: 0; }
  .custom-date-panel input { width: 100%; min-width: 0; padding-inline: 6px; font-size: 12px; }
  .date-apply { grid-column: 1/-1; }
  .kpi-grid { gap: 7px; }
  .kpi { min-height: 102px; padding: 14px 11px; border-radius: 17px; }
  .kpi-label { font-size: 9px; line-height: 1.25; }
  .kpi-value { margin-top: 11px; font-size: clamp(20px, 6.2vw, 25px); }
  .panel { border-radius: 18px; }
  .panel-head { padding: 17px 15px 14px; }
  .panel-head h2 { font-size: 17px; }
  .single-version-panel .panel-head > div { min-width: 0; }
  .single-version-panel .panel-head p { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .variant-head { display: none; }
  .variant-row { grid-template-columns: 34px minmax(0, 1fr) 48px 50px; gap: 6px; min-height: 0; padding: 12px 0; margin-inline: 14px; }
  .variant-row > :nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .variant-row > :nth-child(2) { grid-column: 2; grid-row: 1; }
  .variant-row > :nth-child(3) { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .variant-row > :nth-child(4) { grid-column: 3; grid-row: 1 / span 2; }
  .variant-row > :nth-child(5) { display: none; }
  .variant-row > :nth-child(6) { grid-column: 4; grid-row: 1 / span 2; }
  .variant-key { width: 28px; height: 28px; }
  .data-number { font-size: 9px; text-align: right; }
  .variant-name small { max-width: 100%; }
  .open-lp { padding: 6px 12px; }
  .single-version-name small { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .experiment-note { margin-inline: 14px; }
  .panel-actions { flex-wrap: wrap; padding: 13px 14px 16px; }
  .delete-variation { order: 1; width: 100%; margin-right: 0; }
  .traffic-allocation-action, .add-test-version, .end-test { flex: 1 1 130px; }
  .delete-variation-row { grid-template-columns: auto 26px minmax(0, 1fr); }
  .delete-variation-stat { grid-column: 2 / -1; }
  .traffic-list { padding-inline: 14px; }
  .baseline-summary { display: grid; padding: 18px 14px; }
  .baseline-summary button { width: 100%; }
  .single-version-status { grid-template-columns: 74px minmax(0, 1fr); gap: 14px; padding: 18px 15px; }
  .allocation-orbit { width: 72px; height: 72px; }
  .allocation-orbit span { font-size: 16px; }
  .single-version-copy h3 { font-size: 17px; }
  .single-version-copy > p:last-child { font-size: 11px; line-height: 1.5; }
  .start-test-button { grid-column: 1 / -1; width: 100%; min-height: 46px; }
  .archive-card { padding: 17px 15px; }
  .archive-card-head { align-items: flex-start; }
  .archive-card h2 { font-size: 17px; line-height: 1.3; }
  .modal { inset: auto 0 0; width: auto; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top) - 8px); margin: 0; border-width: 1px 0 0; border-radius: 22px 22px 0 0; }
  .modal-head { padding: 20px 16px 16px; }
  .modal-head h2 { font-size: 22px; }
  .modal-body { padding: 16px; }
  .variant-editor, .winner-options { grid-template-columns: 1fr; }
  .batch-version-field { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; }
  .batch-version-field .field { grid-column: 1 / -1; }
  .traffic-editor { padding: 14px 12px; }
  .traffic-editor-head { align-items: flex-start; }
  .traffic-editor-head span { max-width: 190px; }
  .traffic-total { display: grid; gap: 4px; }
  .traffic-range-row { grid-template-columns: 32px minmax(0, 1fr) 42px; gap: 8px; padding: 10px 0; }
  .traffic-range { grid-column: 2 / -1; width: 100%; }
  .traffic-range-row output { grid-column: 3; grid-row: 1; }
  .allocation { padding-inline: 12px; }
  .allocation-labels { font-size: 9px; }
  .allocation-bar { margin-top: 17px; }
  .modal-actions { padding-inline: 16px; }
  .danger-text { padding-inline: 5px; font-size: 12px; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-field button { width: 100%; }
}

@media (max-width: 360px) {
  .workspace { padding-inline: 10px; }
  .mobile-brand { margin-inline: -10px; }
  .kpi { padding-inline: 8px; }
  .kpi-label { font-size: 8px; }
  .kpi-value { font-size: 18px; }
  .custom-date-trigger svg { display: none; }
  .date-controls button { padding-inline: 5px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Step Conversion ---------- */
.funnel-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px; margin-bottom: 20px; }
.funnel-head p { margin: 0 0 6px; color: var(--violet); font: 600 9px/1 var(--data); letter-spacing: .12em; }
.funnel-head h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.03em; text-wrap: balance; }
.funnel-head small { display: block; margin-top: 6px; color: var(--muted); font: 400 10px/1.4 var(--data); }

.conversion-board { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.conversion-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--sidebar); color: white; }
.conversion-summary > div { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 18px; padding: 18px 20px; }
.conversion-summary > div + div { border-left: 1px solid rgba(255,255,255,.12); }
.conversion-summary small { grid-column: 1 / -1; margin-bottom: 7px; color: #aaa6c2; font: 500 8px/1 var(--data); letter-spacing: .1em; text-transform: uppercase; }
.conversion-summary strong { grid-row: 2 / 4; align-self: center; color: var(--gold); font: 600 28px/1 var(--data); font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.conversion-summary span { align-self: center; color: #d7d3e8; font-size: 11px; }

.conversion-ledger { position: relative; padding: 18px 20px 22px; }
.ledger-step {
  position: relative; z-index: 1; display: grid; grid-template-columns: 64px minmax(190px, 1.35fr) minmax(80px, .45fr) minmax(160px, .8fr) 90px;
  align-items: center; gap: 16px; min-height: 94px; padding: 12px 16px 12px 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); transition: border-color .2s ease, background .2s ease;
}
.ledger-step:hover { border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); background: var(--surface-2); }
.ledger-index { display: grid; place-items: center; align-content: center; align-self: stretch; border-right: 1px solid var(--line); color: var(--violet); }
.ledger-index small { font: 600 7px/1 var(--data); letter-spacing: .1em; }
.ledger-index strong { margin-top: 4px; font: 600 17px/1 var(--data); }
.ledger-page { min-width: 0; }
.ledger-title { display: flex; align-items: center; gap: 8px; }
.ledger-title h3 { margin: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.ledger-title span { padding: 3px 7px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 8px; font-weight: 700; }
.ledger-page p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font: 400 9px/1.4 var(--data); text-overflow: ellipsis; white-space: nowrap; }
.ledger-versions { display: flex; flex-wrap: wrap; gap: 4px; }
.ledger-progress { min-width: 0; }
.ledger-progress > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.ledger-progress > div strong { color: var(--violet); font: 600 10px/1 var(--data); }
.ledger-progress > i { display: block; height: 6px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.ledger-progress > i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--violet)); }
.ledger-total { display: grid; justify-items: end; }
.ledger-total strong { font: 600 26px/1 var(--data); letter-spacing: -.05em; }
.ledger-total span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.ledger-transition { position: relative; display: grid; grid-template-columns: 64px 1fr; align-items: center; min-height: 56px; }
.ledger-line { display: grid; height: 56px; place-items: center; grid-template-rows: 1fr auto 1fr; color: var(--violet); }
.ledger-line i { width: 1px; height: 100%; background: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.ledger-line b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--violet); color: white; font: 600 10px/1 var(--data); }
.ledger-transition > div { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ledger-transition strong { color: var(--violet); font: 600 14px/1 var(--data); }
.ledger-transition span { font-size: 10px; }
.ledger-transition small { padding: 3px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.ledger-transition.bad .ledger-line { color: var(--danger); }
.ledger-transition.bad .ledger-line b { background: var(--danger); }
.ledger-transition.bad strong { color: var(--danger); }
.ledger-transition.bad small { background: #fef2f2; color: var(--danger); font-weight: 700; }

.funnel-stack { display: flex; flex-direction: column; gap: 12px; }
.funnel-row { min-width: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 16px 20px; }
.funnel-row-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.funnel-row-head b { font-size: 16px; letter-spacing: -.01em; }
.funnel-index { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font: 600 11px/1 var(--data); }
.funnel-key { color: var(--muted); font: 400 10px/1.4 var(--data); overflow-wrap: anywhere; }

.funnel-bar-wrap { height: 10px; border-radius: 999px; background: var(--surface-2); margin: 12px 0 10px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--violet)); transition: width .3s ease; }

.funnel-row-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.funnel-total { font-weight: 700; }
.funnel-drop { color: var(--muted); }
.funnel-drop.bad { color: var(--danger); font-weight: 600; }
.funnel-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font: 400 10px/1.6 var(--data); color: var(--muted); }
@media (max-width: 1180px) {
  .ledger-step { grid-template-columns: 58px minmax(180px, 1fr) minmax(130px, .75fr) 80px; }
  .ledger-versions { display: none; }
}

@media (max-width: 760px) {
  .conversion-summary { grid-template-columns: 1fr; }
  .conversion-summary > div { padding: 17px 16px; }
  .conversion-summary > div + div { border-top: 1px solid rgba(255,255,255,.12); border-left: 0; }
  .conversion-ledger { padding: 12px; }
  .ledger-step { grid-template-columns: 50px minmax(0, 1fr) 58px; gap: 11px; min-height: 96px; padding-right: 11px; }
  .ledger-progress, .ledger-versions { display: none; }
  .ledger-page p { white-space: normal; overflow-wrap: anywhere; }
  .ledger-title h3 { font-size: 17px; }
  .ledger-total strong { font-size: 23px; }
  .ledger-transition { grid-template-columns: 48px 1fr; }
  .funnel-head { align-items: end; gap: 12px; margin-bottom: 18px; }
  .funnel-head h2 { font-size: 20px; }
  .funnel-head .primary-action { min-height: 44px; padding-inline: 13px; }
  .view-switcher small { display: none; }
}

/* ---------- Steps editor ---------- */
.steps-modal { max-width: 760px; width: calc(100vw - 32px); }
.steps-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .steps-editor { grid-template-columns: 1fr; } }
.steps-col h4 { margin: 0 0 10px; font: 800 9px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.step-item small { display: block; color: var(--muted); font: 400 10px/1.4 var(--data); margin: 6px 0; overflow-wrap: anywhere; }
.step-label { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 7px 9px; font: 500 14px/1.4 var(--ui); }
.step-actions { display: flex; gap: 6px; }
.step-actions button { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; color: var(--text); width: 30px; height: 27px; cursor: pointer; font-size: 12px; }
.step-actions button:disabled { opacity: .35; cursor: default; }
.step-pool { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; color: var(--text); cursor: pointer; font: inherit; }
.step-pool:hover { border-color: var(--violet); border-style: solid; }
.step-pool b { display: block; font: 500 13px/1.4 var(--ui); overflow-wrap: anywhere; }
.step-pool small { color: var(--muted); font: 400 10px/1.4 var(--data); }
.muted { color: var(--muted); font-size: 13px; }
