/* SCS Hub. Self-hosted fonts (SIL Open Font License, see /assets/fonts/OFL-*.txt). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/montserrat-800-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f7f6f9; --surface: #ffffff; --surface-2: #fbfafc; --border: #ebe8ef; --border-strong: #ddd8e4;
  --text: #1a1523; --text-2: #5f5869; --text-3: #6f6979;
  --accent: #6800fc; --accent-hover: #5a00dc; --accent-soft: #f3edff; --accent-mid: #b692ff; --accent-faint: #e3d6ff;
  --green: #17875c; --green-soft: #e7f5ee; --red: #c8364f; --red-soft: #fcebee; --amber: #a86a0c; --amber-soft: #fcf3e2;
  --shadow-sm: 0 1px 2px rgba(26, 21, 35, .04), 0 1px 1px rgba(26, 21, 35, .02);
  --shadow-md: 0 4px 16px rgba(26, 21, 35, .06), 0 1px 3px rgba(26, 21, 35, .04);
  --radius: 12px; --radius-sm: 8px; --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scrollbar-gutter: stable; }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num, table, .kpi-value { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.noscript { padding: 20px; }

/* Gate */
.gate-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #faf9fb, #f3effa); }
.gate-card { width: min(420px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); }
.gate-card h1 { margin: 22px 0 8px; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.gate-card > p { margin: 0; color: var(--text-2); }
.gate-card label { display: block; margin: 20px 0 6px; font-size: 13px; font-weight: 600; }
.gate-card input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.gate-card .btn { margin-top: 18px; }
.form-message { min-height: 20px; margin: 10px 0 0; color: var(--red); font-size: 13px; font-weight: 500; }
.gate-note { margin: 18px 0 0 !important; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3) !important; }

/* Google sign-in follows the approved split-panel Hub design. */
.hub-login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; background: var(--surface); }
.hub-login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 44px 56px; color: #fff;
  background: radial-gradient(900px 520px at 85% 110%, rgba(104, 0, 252, .55), transparent 60%), radial-gradient(700px 480px at -10% -10%, rgba(143, 77, 255, .22), transparent 55%), #120e19; }
.hub-login-brand::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, rgba(0,0,0,.6), transparent 70%); pointer-events: none; }
.hub-login-logo, .hub-login-copy, .hub-login-brand > small { position: relative; z-index: 1; }
.hub-login-logo .brand { padding: 0; color: #fff; }
.hub-login-logo .brand-icon { filter: brightness(0) invert(1); }
.hub-login-copy { max-width: 460px; margin: auto 0; }
.hub-login-eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #b9a6e8; }
.hub-login-copy h2 { margin: 14px 0 0; font-size: clamp(30px, 3.5vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.03em; }
.hub-login-copy h2 em { font-style: normal; color: #b692ff; }
.hub-login-copy > p:last-child { margin: 18px 0 0; font-size: 16px; line-height: 1.6; color: #cfc6de; }
.hub-login-brand > small { font-size: 12px; color: #a89eb8; }
.hub-login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.hub-login-card { width: min(400px, 100%); }
.hub-login-mark { width: 44px; height: 44px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 12px; background: #120e19; box-shadow: var(--shadow-md); }
.hub-login-mark img { filter: brightness(0) invert(1); }
.hub-login-card h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.hub-login-card > p:not(.hub-login-alert):not(.hub-login-note) { margin: 8px 0 26px; color: var(--text-2); }
.hub-google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); font-size: 15px; font-weight: 600; transition: box-shadow .15s var(--ease), border-color .15s var(--ease); }
.hub-google-button:hover { border-color: #c9c2d3; box-shadow: var(--shadow-md); }
.hub-google-button svg { width: 20px; height: 20px; }
.hub-login-note, .hub-login-alert { margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 13px; }
.hub-login-alert { margin: 0 0 18px; border-color: #f3cdd4; background: var(--red-soft); color: #8f1f33; }
.hub-login-card:has(.hub-login-alert) .hub-login-note { display: none; }
@media (max-width: 860px) {
  .hub-login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .hub-login-brand { padding: 28px 24px 30px; }
  .hub-login-copy { margin: 36px 0 0; }
  .hub-login-copy h2 { font-size: 30px; }
  .hub-login-copy > p:last-child, .hub-login-brand > small { display: none; }
  .hub-login-panel { place-items: start stretch; padding: 30px 24px 40px; }
  .hub-login-card { width: 100%; max-width: 440px; }
}

/* Team access uses live membership data with the approved Hub card layout. */
.team-shell { min-height: 100vh; }
.team-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(24px, 4vw, 56px); border-bottom: 1px solid var(--border); background: var(--surface); }
.team-brand { display: inline-flex; align-items: center; gap: 9px; font-family: Montserrat, Inter, sans-serif; font-size: 18px; font-weight: 800; }
.team-back { color: var(--accent); font-weight: 600; }
.team-main { width: min(1240px, 100%); margin: 0 auto; padding: 36px 24px 64px; }
.team-heading h1 { margin: 0; font-size: 27px; letter-spacing: -.025em; }
.team-heading p { margin: 4px 0 0; color: var(--text-2); }
#team-status { min-height: 20px; margin: 16px 0; color: var(--red); }
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 20px; }
#team-forms, .team-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.team-form-card, .team-info-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.team-form-card h2, .team-info-card h2 { margin: 0 0 14px; font-size: 17px; }
.team-form-card > p { margin: -8px 0 14px; color: var(--text-2); font-size: 13px; }
.team-member { padding: 18px 0; border-top: 1px solid var(--border); }
.team-member:first-of-type { padding-top: 0; border-top: 0; }
.team-member > label { display: inline-block; width: min(300px, 100%); margin: 6px 16px 10px 0; vertical-align: top; font-size: 13px; font-weight: 600; }
.team-member input[type=email], .team-member select { display: block; width: 100%; height: 42px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.team-member input[readonly] { background: var(--bg); color: var(--text-2); }
.team-clients { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.team-clients legend { padding: 0 5px; font-size: 13px; font-weight: 600; }
.team-clients label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.team-clients input { accent-color: var(--accent); }
.team-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.team-member small, .team-self small { color: var(--text-3); }
.team-self { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.team-self strong, .team-self small { display: block; overflow-wrap: anywhere; }
.team-self strong span { color: var(--text-3); font-weight: 400; }
.team-state { align-self: start; padding: 2px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 600; }
.team-policy-row { padding: 12px 0; border-top: 1px solid var(--border); }
.team-policy-row strong, .team-policy-row small, .team-role-card strong, .team-role-card small { display: block; }
.team-policy-row strong, .team-role-card strong { font-size: 13px; }
.team-policy-row small, .team-role-card small { margin-top: 3px; color: var(--text-2); font-size: 12px; }
.team-role-card { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
@media (max-width: 860px) { .team-grid { grid-template-columns: 1fr; } .team-side { order: -1; } }

/* Shell */
#hub-root.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.brand-link { display: block; border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 24px; color: #000; }
.brand-icon { height: 25px; width: auto; flex: none; display: block; }
.brand-text { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 19px; line-height: 1; letter-spacing: .005em; padding-top: 1px; }
.gate-card .brand { padding: 0; }
.nav-label { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.nav-link svg { width: 18px; height: 18px; flex: none; stroke: currentColor; }
a.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link.disabled { color: #b3adbb; cursor: default; }
.nav-link .soon { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--bg); border: 1px solid var(--border); padding: 1px 7px; border-radius: 99px; }
.nav-link .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #e0a100; box-shadow: 0 0 0 3px rgba(224, 161, 0, .16); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px 4px; border-top: 1px solid var(--border); }
.sidebar-foot small { color: var(--text-3); font-size: 12px; }
.link-btn { color: var(--accent); font-weight: 500; font-size: 13px; text-align: left; }
.link-btn:hover { text-decoration: underline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 32px; background: rgba(247, 246, 249, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.menu-btn { display: none; width: 34px; height: 34px; border-radius: 8px; place-items: center; color: var(--text-2); }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.crumbs ol { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-weight: 500; min-width: 0; }
.crumbs li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--border-strong); }
.crumbs .here { color: var(--text); overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); margin-right: 6px; border-radius: 99px; padding: 4px 10px 4px 8px; white-space: nowrap; transition: background .15s var(--ease); }
.live:hover { background: var(--surface); color: var(--text-2); }
.live-text { display: inline; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #22b07d; box-shadow: 0 0 0 3px rgba(34, 176, 125, .15); }
.live.warn i { background: #e0a100; box-shadow: 0 0 0 3px rgba(224, 161, 0, .18); }
.live.bad i { background: var(--red); box-shadow: 0 0 0 3px rgba(200, 54, 79, .16); }
.live.unknown i { background: var(--border-strong); box-shadow: none; }
.live b { font-weight: 600; color: var(--amber); }
.live.bad b { color: var(--red); }

.select-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 500; white-space: nowrap; transition: border-color .15s var(--ease); }
.select-btn:hover { border-color: var(--border-strong); }
.select-btn svg { width: 14px; height: 14px; stroke: var(--text-3); }
.client-dot { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; object-fit: cover; flex: none; }
.client-dot.all { background: var(--text); font-size: 9px; }
.client-dot.pad, .client-logo.pad { object-fit: contain; background: #fff; border: 1px solid var(--border); box-shadow: none; }
.client-dot.pad { padding: 2px; }
.initials { background: var(--c, #6b7280); color: #fff; }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 290px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 6px; text-align: left; font-weight: 500; }
.menu button:hover, .menu button:focus-visible { background: var(--bg); }
.menu button small { margin-left: auto; color: var(--accent); font-weight: 600; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

.segmented { display: flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); }
.segmented button { height: 28px; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); transition: background .15s var(--ease), color .15s var(--ease); }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--text); color: #fff; }

.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px 32px 64px; }
.content:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.page-head .spacer, .filter-bar .spacer { flex: 1; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--accent-faint); border-radius: 10px; background: var(--accent-soft); color: #4b2a86; font-size: 13.5px; }
.notice svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); font-weight: 500; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); white-space: nowrap; transition: border-color .15s var(--ease), background .15s var(--ease); }
.btn:hover:not(:disabled) { border-color: var(--border-strong); }
.btn svg { width: 15px; height: 15px; stroke: currentColor; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: .5; }
.btn.wide { width: 100%; height: 42px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.card-head .sub { color: var(--text-3); font-size: 13px; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-body { padding: 18px 20px 20px; }
.card-body.tight { padding-top: 6px; }
.card-note { margin: 0; color: var(--text-2); font-size: 13px; }
.footnote { margin: 14px 2px 0; color: var(--text-3); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.grid > *, .summary > * { min-width: 0; }
.kpis { grid-template-columns: repeat(5, 1fr); margin-bottom: 16px; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.kpis.two { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.kpi { padding: 18px 20px 16px; position: relative; overflow: hidden; min-height: 118px; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-value { margin-top: 8px; font-size: 28px; line-height: 1.1; font-weight: 650; letter-spacing: -.025em; min-height: 31px; }
.kpi-suffix { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 8px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; flex-wrap: wrap; row-gap: 4px; }
.kpi .spark { position: absolute; right: 16px; top: 50px; width: 72px; height: 26px; }
.foot-note { color: var(--text-3); }
.dash { color: var(--text-3); font-weight: 500; }
.muted-text { color: var(--text-3) !important; }

.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--green); background: var(--green-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }
.delta.flat { color: var(--text-2); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.delta svg { width: 10px; height: 10px; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.muted { color: var(--text-3); background: var(--bg); border: 1px solid var(--border); }
.tag.live { color: var(--green); background: var(--green-soft); }
.tag.live::before, .tag.warn::before, .tag.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.accent { color: var(--accent); background: var(--accent-soft); }
.tag.shared { color: #7a4ad6; background: #f4effd; }
.tag.warn { color: var(--amber); background: var(--amber-soft); }
.tag.bad { color: var(--red); background: var(--red-soft); }

.info { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--text-3); cursor: help; border-radius: 50%; }
.info svg { width: 14px; height: 14px; stroke: currentColor; }
.info:hover, .info.open { color: var(--text-2); }
.info .tip { position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); width: 250px; padding: 10px 12px; border-radius: 8px; background: var(--text); color: #f3f1f6; font-size: 12.5px; line-height: 1.45; font-weight: 400; text-align: left; letter-spacing: 0; white-space: normal; text-transform: none;
  transform: translateX(-50%) translateY(3px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s var(--ease), transform .15s var(--ease); box-shadow: var(--shadow-md); }
@media (hover: hover) { .info:hover .tip { opacity: 1; visibility: visible; transform: translateX(-50%); } }
.info:focus-visible .tip, .info.open .tip { opacity: 1; visibility: visible; transform: translateX(-50%); }
.info.dismissed .tip { opacity: 0 !important; visibility: hidden !important; }

.skeleton { position: relative; display: block; overflow: hidden; background: #efedf3; border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-value { height: 28px; width: 60%; max-width: 140px; }
.kpi-value .sk-value { display: inline-block; vertical-align: middle; }
.sk-line { height: 12px; width: 80%; margin-bottom: 10px; }
.sk-line.short { width: 50%; }
.sk-cell { display: inline-block; height: 12px; width: 44px; vertical-align: middle; }

/* All clients */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 28px; }
.summary > div { padding: 20px 22px; border-right: 1px solid var(--border); }
.summary > div:last-child { border-right: 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.section-title span { color: var(--text-3); font-weight: 400; font-size: 13px; }
.section-title.spaced { margin-top: 32px; }
.section-title.flush { margin: 0; }
.clients { grid-template-columns: repeat(3, 1fr); }
.client-card { display: flex; flex-direction: column; padding: 20px; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease); }
.client-card:hover, .client-card:focus-visible { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.client-top { display: flex; align-items: center; gap: 12px; }
.client-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(26, 21, 35, .06); font-weight: 700; font-size: 13px; }
.client-logo.pad { padding: 7px; }
.client-top h3 { margin: 0; font-size: 15px; font-weight: 600; }
.client-top small { color: var(--text-3); font-size: 12.5px; }
.client-top .tag { margin-left: auto; }
.client-chart { height: 64px; margin: 18px 0 16px; display: grid; }
.spark.wide { width: 100%; height: 64px; display: block; }
.chart-note { align-self: center; margin: 0; color: var(--text-3); font-size: 12.5px; text-align: center; border: 1px dashed var(--border); border-radius: 8px; padding: 18px 0; }
.chart-note:empty { border: 0; }
.client-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.client-metrics > div > span:first-child, .fstats > div > span:first-child { display: block; font-size: 12px; color: var(--text-3); }
.client-metrics strong { display: block; margin-top: 2px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.client-metrics .skeleton, .fstats .skeleton { height: 18px; width: 70%; margin-top: 4px; }
.mini-state { display: block; font-size: 11.5px; color: var(--text-3); }
.rate-note { display: block; color: var(--text-3); font-size: 11px; }
.client-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--text-3); }
.client-foot .go { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; opacity: 0; transform: translateX(-4px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
.client-card:hover .go, .client-card:focus-visible .go { opacity: 1; transform: none; }
.client-foot svg { width: 14px; height: 14px; stroke: currentColor; }
.muted-clients { grid-template-columns: repeat(4, 1fr); }
.mini-client { display: flex; align-items: center; gap: 12px; padding: 14px 16px; transition: border-color .15s var(--ease); }
.mini-client:hover, .mini-client:focus-visible { border-color: var(--border-strong); }
.mini-client .client-logo { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; }
.mini-client strong { display: block; font-weight: 600; font-size: 13.5px; }
.mini-client small { color: var(--text-3); font-size: 12.5px; }

/* Dashboard */
.dash-row { grid-template-columns: 2fr 1fr; margin-bottom: 16px; }
.legend { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c, var(--accent)); }
.bar-swatch { background: var(--accent-faint); }
.line-swatch { height: 3px; border-radius: 2px; vertical-align: 2px; background: var(--accent); }
.chart-wrap { position: relative; min-height: 240px; }
.chart-wrap svg.combo { width: 100%; height: auto; display: block; overflow: visible; }
.chart-wrap svg.combo:focus-visible { outline-offset: 6px; }
.chart-wrap svg.combo { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.chart-skeleton { height: 240px; width: 100%; }
.axis { font-size: 11px; fill: var(--text-3); font-family: inherit; }
.bar { transition: fill .12s var(--ease); }
.bar.active { fill: var(--accent-mid); }
.bar.partial { opacity: .5; }
.chart-tip { position: absolute; left: 0; top: 0; pointer-events: none; min-width: 170px; white-space: nowrap; z-index: 5; padding: 10px 12px; border-radius: 8px; background: var(--text); color: #fff; font-size: 12.5px; box-shadow: var(--shadow-md); opacity: 0; transition: opacity .12s var(--ease); transform: translate(-50%, -100%); }
.chart-tip.below { transform: translate(-50%, 0); }
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; margin-bottom: 4px; font-weight: 600; }
.chart-tip div { display: flex; justify-content: space-between; gap: 16px; color: #d9d4e2; }
.chart-tip div span:last-child { color: #fff; font-weight: 600; }
.chart-tip small { display: block; margin-top: 5px; color: #d9d4e2; font-size: 12px; }
.outcomes { display: flex; flex-direction: column; gap: 18px; }
.outcomes .kpi-value { margin: 0; }
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--bg); gap: 2px; }
.stack span { display: block; height: 100%; background: var(--c); }
.stack-legend { display: flex; flex-direction: column; gap: 10px; }
.stack-legend > div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.stack-legend i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c); }
.stack-legend .v { margin-left: auto; font-weight: 600; }
.stack-legend .p { width: 44px; text-align: right; color: var(--text-3); }
.stack-legend.rates > div { gap: 8px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 2px 0; width: 100%; }
.not-tracked { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 13px; }
.not-tracked strong { font-weight: 600; color: var(--text); }
.not-tracked .tag { margin-left: auto; }
.spaced-block { margin: 0 0 16px; }

table { width: 100%; border-collapse: collapse; }
th { padding: 10px 20px; font-size: 12px; font-weight: 500; color: var(--text-3); text-align: right; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
th:first-child, td:first-child, th.left, td.left { text-align: left; }
td { padding: 14px 20px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { transition: background .12s var(--ease); }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td .name { display: flex; align-items: center; gap: 12px; }
td .name strong { font-weight: 600; }
td .name a:hover strong, td .name a:focus-visible strong { color: var(--accent); }
td .name small { display: block; color: var(--text-3); font-size: 12.5px; }
.table-card { overflow: hidden; }
.table-card .card-head { padding-bottom: 16px; }
.table-scroll { position: relative; overflow-x: auto; }
.fn-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.fn-icon[data-color] { color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.fn-icon.muted { background: var(--bg); color: var(--text-3); }
.fn-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.rate { color: var(--text-3); font-size: 12.5px; margin-left: 6px; }
.mini-bar { display: inline-block; width: 64px; height: 6px; border-radius: 99px; background: var(--bg); vertical-align: middle; margin-left: 10px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.muted-cell { color: var(--text-3); }
.chev-cell { width: 40px; color: var(--text-3); }
.chev-cell svg { width: 16px; height: 16px; stroke: currentColor; vertical-align: middle; }

/* Funnel detail */
.flow-card { margin-bottom: 16px; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); }
.step { position: relative; padding: 20px 22px; }
.step + .step { border-left: 1px solid var(--border); }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; flex: none; }
.step h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.step .big { margin-top: 10px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; min-height: 31px; }
.step .bar { height: 6px; margin-top: 14px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.step .bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #8f4dff); }
.step .conv { margin-top: 10px; font-size: 12.5px; color: var(--text-3); min-height: 22px; }
.step .conv b { color: var(--text); font-weight: 600; }
.step-arrow { position: absolute; left: -12px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; z-index: 2; }
.step-arrow svg { width: 11px; height: 11px; stroke: var(--text-3); }
.split-row { display: grid; grid-template-columns: 180px 1fr 60px; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.split-row:last-child { border-bottom: 0; }
.split-row .label { min-width: 0; }
.split-row .label strong { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-row .label a:hover strong { color: var(--accent); }
.split-row .label small { color: var(--text-3); font-size: 12.5px; }
.split-bar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; gap: 2px; min-width: 24px; }
.split-bar > span { display: flex; align-items: center; justify-content: flex-start; padding: 0 9px; font-size: 12px; font-weight: 600; color: #fff; min-width: 0; white-space: nowrap; overflow: hidden; background: var(--c, var(--accent)); flex: 1 1 0; transition: filter .15s var(--ease); }
.split-bar > span.light { color: #3b2a5c; }
.split-bar > span:hover { filter: brightness(1.06); }
.split-bar .empty-bar { background: var(--bg); color: var(--text-3); font-weight: 500; }
.split-bar.big { height: 30px; margin-bottom: 18px; }
.split-row .total { text-align: right; font-weight: 600; }
.steps-card .card-head { padding-bottom: 12px; }
.order-status { font-size: 12.5px; color: var(--text-3); }
.order-status.saving { color: var(--accent); }
.order-status.saved { color: var(--green); }
.order-status.unsaved, .order-status.error, .order-status.conflict { color: var(--red); }
.order-note { padding: 0 20px 12px; font-size: 12.5px; color: var(--text-3); }
#funnel-step-order { margin: 0; padding: 0; list-style: none; }
.step-block { border-top: 1px solid var(--border); transition: background .15s var(--ease); }
.step-block.dragging { background: var(--accent-soft); }
.step-block.drag-target[data-drop-position="before"] { box-shadow: inset 0 2px 0 var(--accent); }
.step-block.drag-target[data-drop-position="after"] { box-shadow: inset 0 -2px 0 var(--accent); }
.step-line { display: flex; align-items: center; gap: 10px; padding: 12px 20px 4px; font-size: 13px; }
.step-line strong { font-weight: 600; }
.step-handle { display: grid; place-items: center; width: 24px; height: 28px; margin-left: -6px; border-radius: 6px; color: var(--text-3); cursor: grab; touch-action: none; }
.step-handle:hover { background: var(--bg); color: var(--text); }
.step-handle[aria-grabbed="true"] { background: var(--accent); color: #fff; cursor: grabbing; }
.step-handle svg { width: 14px; height: 14px; }
.pages-list { display: flex; flex-direction: column; }
.page-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px 14px 54px; }
.page-item + .page-item { border-top: 1px dashed var(--border); }
.thumb { width: 56px; height: 40px; border-radius: 6px; border: 1px solid var(--border); background: linear-gradient(180deg, #fff 0 34%, var(--accent-soft) 34% 100%); position: relative; overflow: hidden; flex: none; }
.thumb::before { content: ""; position: absolute; left: 8px; top: 6px; width: 24px; height: 3px; border-radius: 2px; background: var(--border-strong); }
.thumb::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 7px; height: 11px; border-radius: 3px; background: var(--accent-mid); }
.thumb.small { width: 44px; height: 32px; }
.thumb.small::after { bottom: 5px; height: 9px; left: 11px; right: 11px; }
.page-item .meta { min-width: 0; }
.page-item .meta strong { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.page-item .meta strong a:hover { color: var(--accent); }
.page-item .meta .ext, .page-item .meta small { display: block; color: var(--text-3); font-size: 12.5px; }
.ext:hover { color: var(--accent); text-decoration: underline; }
.page-item .stats { margin-left: auto; display: grid; grid-template-columns: repeat(3, 120px); gap: 12px; text-align: right; }
.page-item .stats span { display: block; font-size: 12px; color: var(--text-3); }
.page-item .stats strong { font-weight: 600; }
.page-item .stats .skeleton { display: inline-block; height: 16px; width: 48px; }
.traffic-split { margin-bottom: 16px; }
.traffic-split .card-head .ext { font-size: 12.5px; color: var(--text-3); }
.split-control { display: flex; flex-direction: column; gap: 10px; }
.split-inputs { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-2); }
.split-inputs output { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.traffic-split-comparison { margin: 0; font-size: 12.5px; color: var(--amber); }
.mini-title { margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.history-empty { margin: 0; color: var(--text-3); font-size: 12.5px; }
.history { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; }

/* Funnels list */
.funnel-cards { grid-template-columns: repeat(2, 1fr); margin-bottom: 28px; }
.fcard { padding: 20px; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease); display: block; }
.fcard:hover, .fcard:focus-visible { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.fcard-top { display: flex; align-items: center; gap: 12px; }
.fcard-name { min-width: 0; flex: 1; }
.fcard-name h3, .fcard-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fcard-top h3 { margin: 0; font-size: 15px; font-weight: 600; }
.fcard-top small { color: var(--text-3); font-size: 12.5px; }
.fcard-top .tag { margin-left: auto; flex: none; }
.fsteps { display: flex; align-items: center; gap: 6px; margin: 18px 0; flex-wrap: wrap; }
.fsteps span { padding: 4px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); font-weight: 500; }
.fsteps i { color: var(--border-strong); font-style: normal; }
.fstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.fstats strong { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.fstats .delta { margin-top: 4px; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; min-width: 240px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-3); box-shadow: var(--shadow-sm); }
.search.small { min-width: 200px; height: 32px; }
.search:focus-within { border-color: var(--accent-mid); }
.search svg { width: 15px; height: 15px; stroke: currentColor; flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; color: var(--text); }
.chips { display: flex; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.group-list { overflow: hidden; }
.group-row + .group-row { border-top: 1px solid var(--border); }
.group-row summary { display: flex; align-items: center; gap: 14px; padding: 13px 20px; cursor: pointer; list-style: none; }
.group-row summary::-webkit-details-marker { display: none; }
.group-row summary:hover { background: var(--surface-2); }
.group-row .group-name strong { display: block; font-weight: 600; }
.group-row .group-name small { display: block; color: var(--text-3); font-size: 12.5px; }
.group-row .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.group-row .chev { color: var(--text-3); display: grid; transition: transform .2s var(--ease); }
.group-row .chev svg { width: 16px; height: 16px; stroke: currentColor; }
.group-row[open] .chev { transform: rotate(180deg); }
.group-pages { margin: 0; padding: 0 20px 12px 66px; list-style: none; }
.group-pages li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); }
.group-pages a strong { display: block; font-weight: 500; }
.group-pages a:hover strong { color: var(--accent); }
.group-pages small { display: block; color: var(--text-3); font-size: 12.5px; }

/* Page detail */
.page-grid { grid-template-columns: 1.35fr 1fr; margin-bottom: 16px; align-items: start; }
.browser { border-radius: 10px; border: 1px solid var(--border); overflow: hidden; background: #fff; }
.browser-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.browser-bar .url { margin-left: 8px; flex: 1; min-width: 0; height: 24px; border-radius: 6px; background: #fff; border: 1px solid var(--border); font-size: 12px; color: var(--text-3); display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.browser-frame { position: relative; height: 420px; overflow: hidden; background: linear-gradient(180deg, #fff 0%, #faf8ff 100%); }
.browser-frame iframe { position: relative; z-index: 1; width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease); }
.browser-frame[data-frame-state="loaded"] iframe { opacity: 1; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; }
.preview-placeholder p { margin: 0; max-width: 300px; }
.preview-placeholder.failed p { color: var(--text-2); }
.preview-placeholder.failed strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 15px; font-weight: 600; }
.ph-page { display: grid; gap: 8px; width: 200px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.ph-page span { display: block; height: 6px; border-radius: 3px; background: var(--bg); }
.ph-page .ph-nav { width: 40%; background: var(--border); }
.ph-page .ph-title { height: 12px; width: 85%; margin-top: 4px; background: var(--accent-faint); }
.ph-page .short { width: 60%; }
.ph-page .ph-cta { justify-self: center; width: 50%; height: 18px; margin-top: 4px; border-radius: 5px; background: var(--accent-mid); }
.preview-placeholder.failed .ph-page { opacity: .6; }
.preview-toggle { display: none; }
.preview-fallback { display: grid; height: 100%; place-items: center; }
.preview-fallback .empty { padding: 32px 24px; }
.used-by { display: flex; flex-direction: column; gap: 10px; }
.used-by a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.used-by a:hover, .used-by a:focus-visible { border-color: var(--border-strong); background: var(--surface-2); }
.used-by strong { font-weight: 600; }
.used-by small { display: block; color: var(--text-3); font-size: 12.5px; }
.used-by .v { margin-left: auto; text-align: right; color: var(--text-3); }
.used-by .v strong { font-size: 16px; color: var(--text); }
.used-by .v svg { width: 16px; height: 16px; stroke: currentColor; }
.page-grid .card-note { margin-top: 12px; }

/* Empty, error and loading */
.empty { display: grid; justify-items: center; align-content: start; text-align: center; padding: 64px 24px; }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.empty .ico.muted { background: var(--bg); color: var(--text-3); }
.empty .ico svg { width: 26px; height: 26px; stroke: currentColor; }
.empty h2 { margin: 0; font-size: 18px; font-weight: 600; }
.empty p { margin: 8px 0 0; max-width: 420px; color: var(--text-2); }
.empty .row, .empty > .btn { margin-top: 18px; }
.err { padding: 24px; }
.err .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin: 0 0 10px; }
.err .ico svg { width: 18px; height: 18px; stroke: currentColor; }
.err strong { display: block; font-weight: 600; }
.err p { margin: 4px 0 12px; color: var(--text-2); font-size: 13px; }

/* Data health */
.banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid #f1dcae; background: linear-gradient(180deg, #fffaf0, #fdf4e3); }
.banner.ok { border-color: #cdebdc; background: linear-gradient(180deg, #f5fcf8, #e9f6ef); }
.banner .b-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--amber); box-shadow: var(--shadow-sm); flex: none; }
.banner .b-ico.ok { color: var(--green); }
.banner .b-ico svg { width: 18px; height: 18px; stroke: currentColor; }
.banner strong { display: block; font-weight: 600; }
.banner span { color: var(--text-2); font-size: 13.5px; }
.banner .btn { margin-left: auto; }
.health-group { margin-bottom: 16px; overflow: hidden; }
.health-group .card-head { padding-bottom: 14px; }
.src-head, .src { display: grid; grid-template-columns: minmax(220px, 1.4fr) 1fr 150px 130px 24px; align-items: center; gap: 16px; padding: 13px 20px; border-top: 1px solid var(--border); }
.src-head { padding-top: 8px; padding-bottom: 8px; background: var(--surface-2); font-size: 12px; color: var(--text-3); font-weight: 500; }
.src { width: 100%; text-align: left; }
.src .s-name { display: flex; align-items: center; gap: 12px; }
.src .s-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: none; }
.s-ico.hyros { background: #f1eefe; color: #5b3fd6; }
.s-ico.typeform { background: #f2f2f2; color: #262627; }
.s-ico.ga4 { background: #fff4e5; color: #c26401; }
.s-ico.funnel { background: #eef4ff; color: #2f5bd3; }
.s-ico.db { background: #f4f3f6; color: #8a8494; }
.src .s-name strong { display: block; font-weight: 600; font-size: 13.5px; }
.src .s-name small, .src .when small { display: block; color: var(--text-3); font-size: 12.5px; }
.src .when strong { display: block; font-weight: 500; }
.src .sched { color: var(--text-2); font-size: 13px; }
.src .chev { color: var(--text-3); display: grid; transition: transform .2s var(--ease); }
.src .chev svg { width: 16px; height: 16px; stroke: currentColor; }
.src.expandable { cursor: pointer; }
.src.expandable:hover { background: var(--surface-2); }
.src.open .chev { transform: rotate(180deg); }
.fix { margin: 0 20px 14px 62px; padding: 16px 18px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.fix h3 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.fix p { margin: 0 0 14px; color: var(--text-2); }
.fix ol { margin: 0 0 12px; padding-left: 20px; }
.fix ol li { margin-bottom: 4px; }
.fix .reference { margin: 0; font-size: 12px; color: var(--text-3); }
.fix code { font-size: 11.5px; padding: 1px 5px; border-radius: 4px; background: var(--bg); border: 1px solid var(--border); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .clients { grid-template-columns: repeat(2, 1fr); }
  .muted-clients { grid-template-columns: repeat(2, 1fr); }
  .dash-row, .page-grid { grid-template-columns: 1fr; }
  .page-item .stats { grid-template-columns: repeat(3, 100px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Date range picker */
.range-wrap { position: relative; }
.picker { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; display: grid; grid-template-columns: 170px 1fr; width: 660px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(26, 21, 35, .14), 0 2px 6px rgba(26, 21, 35, .05); animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.presets { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--border); }
.presets button { text-align: left; padding: 7px 10px; border-radius: 7px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.presets button:hover { background: var(--bg); color: var(--text); }
.presets button.on { background: var(--accent-soft); color: var(--accent); }
.cal-area { padding: 16px 18px 0; min-width: 0; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: -22px; position: relative; z-index: 1; }
.cal-nav button { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--text-2); }
.cal-nav button:hover:not(:disabled) { background: var(--bg); }
.cal-nav button:disabled { opacity: .35; }
.cal-nav svg { width: 14px; height: 14px; stroke: currentColor; }
.months { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.month h5 { margin: 4px 0 8px; text-align: center; font-size: 13px; font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.days .dow { font-size: 11px; color: var(--text-3); text-align: center; padding: 4px 0; font-weight: 500; }
.days button { height: 32px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); position: relative; }
.days button span { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto; border-radius: 8px; }
.days button:hover:not(:disabled) span { background: var(--bg); }
.days button.in { background: var(--accent-soft); }
.days button.start { background: linear-gradient(90deg, transparent 50%, var(--accent-soft) 50%); }
.days button.end { background: linear-gradient(90deg, var(--accent-soft) 50%, transparent 50%); }
.days button.start.end, .days button.start:last-child { background: none; }
.days button.start span, .days button.end span, .days button.start:hover span, .days button.end:hover span { background: var(--accent); color: #fff; font-weight: 600; }
.days button.today span { box-shadow: inset 0 0 0 1px var(--accent-mid); }
.days button:disabled { color: #cfcad6; }
.days .blank { height: 32px; }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 30px; height: 18px; margin: 0; }
.toggle i { width: 30px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s var(--ease); flex: none; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: transform .15s var(--ease); }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(12px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-note { color: var(--text-3); }
.picker-foot { display: flex; align-items: center; gap: 12px; margin: 14px -18px 0; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 0; }
.picker-foot .sel { font-size: 13px; }
.picker-foot .sel strong { font-weight: 600; }
.picker-foot .sel small { display: block; color: var(--text-3); font-size: 12px; }
.picker-foot .sel .picker-error { color: var(--red); }
.picker-foot .actions { margin-left: auto; display: flex; gap: 8px; }
.picker-foot .btn { height: 32px; }

/* Phone chrome, bottom sheets and stacked cards. Only phones show the app bar and tab bar; stacked cards are only rendered there. */
.appbar, .tabbar { display: none; }
.icon-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; color: var(--text-2); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; }
.icon-btn:disabled { opacity: .35; }
.client-logo.all { background: var(--text); font-size: 11px; }
.stack-list { margin: 0; padding: 0; list-style: none; }
.stack-card { display: block; padding: 14px 20px; border-top: 1px solid var(--border); }
.stack-card:active { background: var(--surface-2); }
.stack-top { display: flex; align-items: flex-start; gap: 8px; }
.stack-name { flex: 1; min-width: 0; }
.stack-name strong, .stack-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stack-name strong { font-weight: 600; }
.stack-name small { color: var(--text-3); font-size: 13px; }
.stack-chev { display: grid; color: var(--text-3); padding-top: 2px; }
.stack-chev svg { width: 16px; height: 16px; stroke: currentColor; }
.stack-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stack-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stack-stats > div > span:first-child { display: block; color: var(--text-3); font-size: 13px; }
.stack-stats strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.stack-stats .delta { margin-top: 3px; }
.stack-rate { display: block; color: var(--text-3); font-size: 13px; }

body.sheet-open { overflow: hidden; }
.sheet-layer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(26, 21, 35, .36); animation: fade-in .2s var(--ease); }
.sheet { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100dvh - 16px - env(safe-area-inset-top)); margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); border-radius: 18px 18px 0 0; background: var(--surface); box-shadow: 0 -12px 40px rgba(26, 21, 35, .18); animation: sheet-up .26s var(--ease); outline: none; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-grab { flex: none; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 99px; background: var(--border-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 2px 20px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.sheet-body { flex: 1; min-height: 0; padding: 4px 20px 16px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; align-items: center; gap: 12px; padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: var(--surface-2); }
.sheet-foot .sel { min-width: 0; font-size: 13px; }
.sheet-foot .sel strong { font-weight: 600; }
.sheet-foot .sel small { display: block; color: var(--text-3); font-size: 13px; }
.sheet-foot .sel .picker-error { color: var(--red); }
.sheet-foot .actions { display: flex; gap: 8px; margin-left: auto; }
.sheet-foot .btn { height: 44px; }
.sheet-foot [data-action="logout"] { margin-left: auto; }
.sheet-note { margin: 0; color: var(--text-3); font-size: 13px; }
.sheet-list { margin: 0 -8px; padding: 0; list-style: none; }
.sheet-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px; border-radius: 12px; text-align: left; }
.sheet-option:active { background: var(--bg); }
.sheet-option[aria-current="true"] { background: var(--accent-soft); }
.sheet-option .client-logo { width: 36px; height: 36px; border-radius: 9px; font-size: 12px; }
.sheet-option-text { min-width: 0; }
.sheet-option-text strong { display: block; font-weight: 600; }
.sheet-option-text small { display: block; color: var(--text-3); font-size: 13px; }
.sheet-check { display: grid; margin-left: auto; padding-right: 6px; color: var(--accent); }
.sheet-check svg { width: 18px; height: 18px; stroke: currentColor; }
.sheet-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 14px; }
.sheet-presets button { min-height: 44px; padding: 0 4px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); font-size: 13px; font-weight: 500; line-height: 1.2; }
.sheet-presets button.on { border-color: var(--accent-faint); background: var(--accent-soft); color: var(--accent); }
.sheet-month-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px 2px; }
.sheet-month-nav h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sheet .days button, .sheet .days .blank { height: 44px; }
.sheet .days button span { width: 38px; height: 38px; border-radius: 10px; font-size: 14px; }
.sheet .days .dow { font-size: 12px; }
.sheet .toggle { min-height: 44px; margin-top: 8px; font-size: 14px; }

/* Tablet: the sidebar becomes a drawer behind the menu button. */
@media (max-width: 1099px) {
  #hub-root.app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 272px; transform: translateX(-100%); visibility: hidden; transition: transform .2s var(--ease), visibility 0s linear .2s; }
  .sidebar.open { transform: none; visibility: visible; box-shadow: var(--shadow-md); transition: transform .2s var(--ease); }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(26, 21, 35, .3); }
  .menu-btn { display: grid; flex: none; width: 44px; height: 44px; margin-left: -10px; }
  .topbar { gap: 8px; padding: 0 24px; }
  .crumbs { flex: 1; min-width: 0; }
  .crumbs ol { overflow: hidden; }
  .crumbs li { min-width: 0; }
  .crumbs li:not(:last-child) { flex: none; }
  .crumbs .here { max-width: 100%; }
  .top-actions { flex: none; gap: 8px; }
  .live { margin-right: 0; padding: 4px 8px; }
  .live-text { display: none; }
  .content { padding: 24px 24px 56px; }
  .kpis.four, .summary { grid-template-columns: repeat(2, 1fr); }
  .summary > div:nth-child(2) { border-right: 0; }
  .summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .page-head { flex-wrap: wrap; }
  .src-head, .src { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 120px 110px 24px; }
  /* A closed tooltip takes no space, so it can never widen the page on narrower screens. */
  .info .tip { display: none; }
  .info:focus-visible .tip, .info.open .tip { display: block; }
}
@media (max-width: 1099px) and (hover: hover) { .info:hover .tip { display: block; } }

/* Phone: app bar, bottom tab bar, two-column KPIs and stacked cards. */
@media (max-width: 767px) {
  body { font-size: 15px; }
  #hub-root.app { display: block; }
  .sidebar, .topbar, .scrim { display: none; }
  .appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 2px; min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); border-bottom: 1px solid var(--border); background: rgba(247, 246, 249, .94); backdrop-filter: saturate(1.4) blur(12px); }
  .appbar-lead .brand-icon { height: 24px; width: auto; }
  .appbar-title { flex: 1; min-width: 0; padding: 0 4px; overflow: hidden; font-size: 16px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; text-overflow: ellipsis; }
  .appbar-actions { display: flex; flex: none; align-items: center; gap: 2px; }
  .appbar-client { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; }
  .appbar-client .client-dot { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; box-shadow: 0 0 0 1px var(--border); }
  .appbar-date { position: relative; display: flex; align-items: center; gap: 4px; height: 36px; margin: 0 4px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; white-space: nowrap; }
  .appbar-date::after { content: ""; position: absolute; inset: -4px -4px; }
  .appbar-date svg { width: 14px; height: 14px; stroke: var(--text-3); }
  .tabbar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 2px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: rgba(255, 255, 255, .95); backdrop-filter: saturate(1.4) blur(12px); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 54px; color: var(--text-3); font-size: 12px; font-weight: 500; }
  .tab.active { color: var(--accent); }
  .tab-icon { position: relative; display: grid; }
  .tab-icon svg { width: 22px; height: 22px; stroke: currentColor; }
  .tab-label { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .tab-dot { position: absolute; top: -2px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: #e0a100; box-shadow: 0 0 0 2px #fff; }
  .content { padding: 16px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }

  .tag, .delta { font-size: 13px; }
  small, .sub, .card-note, .footnote, .foot-note, .kpi-foot, .mini-state, .chart-note, .client-foot, .rate, .order-status, .order-note, .notice, .banner span { font-size: 13px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; overflow-wrap: anywhere; }
  .page-head p { font-size: 13px; }
  .page-head .spacer { display: none; }
  .btn { height: 44px; }
  .link-btn { min-height: 44px; }
  .grid { gap: 12px; }
  .card-head { padding: 16px 16px 0; }
  .card-head .right { width: 100%; margin-left: 0; }
  .card-body { padding: 14px 16px 16px; }
  .table-card .card-head { padding-bottom: 14px; }
  .stack-card { padding: 14px 16px; }
  .section-title.spaced { margin-top: 24px; }

  .kpis, .kpis.four, .kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { display: flex; flex-direction: column; min-height: 0; padding: 14px 14px 12px; }
  .kpi-label { font-size: 13px; }
  .kpi-value { margin-top: 6px; font-size: 22px; min-height: 26px; }
  .kpi-value .sk-value { height: 22px; }
  .kpi-suffix { margin-left: 4px; font-size: 13px; }
  .kpi .spark { position: static; order: 2; width: 100%; height: 22px; margin-top: 8px; }
  .kpi-foot { order: 3; margin-top: 8px; white-space: normal; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .summary > div { padding: 14px; border-right: 0; }
  .summary > div:nth-child(odd) { border-right: 1px solid var(--border); }
  .summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .clients, .funnel-cards, .muted-clients { grid-template-columns: 1fr; }
  .client-card, .fcard { padding: 16px; }
  .client-chart { height: 48px; margin: 12px 0; }
  .spark.wide { height: 48px; }
  .client-metrics { padding-top: 12px; }
  .client-metrics span { font-size: 13px; }
  .client-metrics strong { font-size: 15px; }
  .client-foot { margin-top: 12px; }
  .client-foot .go { display: none; }
  .mini-client { min-height: 56px; }

  .chart-wrap { min-height: 0; }
  .chart-skeleton { height: 180px; }
  .chart-wrap.compact .axis { font-size: 12px; }
  .chart-card .legend { width: 100%; }
  .chart-tip { min-width: 150px; }

  .search, .search.small { width: 100%; min-width: 0; height: 44px; }
  .search input { font-size: 16px; }
  .chips { width: 100%; }
  .chip { position: relative; flex: 1; height: 38px; }
  .chip::after { content: ""; position: absolute; inset: -3px 0; }
  .filter-bar .spacer { display: none; }
  .section-title.flush { width: 100%; }
  .fsteps { margin: 14px 0; }
  .fstats strong { font-size: 16px; }
  .group-row summary { min-height: 56px; padding: 12px 16px; gap: 12px; }
  .group-row .group-name { min-width: 0; }
  .group-pages { padding: 0 16px 12px; }
  .group-pages li { min-height: 52px; }
  .group-pages a { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 44px; }

  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { padding: 14px 16px; }
  .step + .step { border-left: 0; }
  .step:nth-child(even) { border-left: 1px solid var(--border); }
  .step:nth-child(n+3) { border-top: 1px solid var(--border); }
  .step-arrow { display: none; }
  .step .big { font-size: 22px; }
  .split-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .split-row .label { grid-column: 1 / -1; }
  .split-row .label a { position: relative; display: block; padding: 12px 0; margin: -12px 0; }
  .step-line { padding: 12px 16px 4px; }
  .step-handle { position: relative; }
  .step-handle::after { content: ""; position: absolute; inset: -8px -10px; }
  .order-note { padding: 0 16px 12px; }
  .page-item { flex-wrap: wrap; gap: 10px; padding: 10px 16px 14px; }
  .page-item + .page-item { border-top: 1px dashed var(--border); }
  .page-item .thumb { display: none; }
  .page-item .meta { flex: 1; min-width: 0; }
  .page-item .meta strong a, .page-item .meta .ext { display: block; min-width: 0; min-height: 44px; padding: 11px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .page-item .meta strong a { flex: 0 1 auto; }
  .page-item .meta .ext { margin-top: -14px; font-size: 13px; }
  .page-item .stats { width: 100%; margin-left: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: left; }
  .page-item .stats span { font-size: 13px; }

  .preview-toggle { display: inline-flex; width: 100%; }
  .preview-card.open .preview-toggle { margin-bottom: 12px; }
  .preview-card:not(.open) .browser { display: none; }
  .browser-frame { height: 360px; }
  .used-by a { min-height: 56px; }

  .banner { flex-wrap: wrap; padding: 14px 16px; }
  .banner > div:nth-child(2) { flex: 1; min-width: 0; }
  .banner .btn { width: 100%; margin-left: 0; }
  .health-group .card-head { padding-bottom: 12px; }
  .src-head { display: none; }
  .src { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name name chev" "when sched state"; gap: 8px 12px; padding: 12px 16px; }
  .src .s-name { grid-area: name; }
  .src .when { grid-area: when; min-width: 0; padding-left: 42px; }
  .src .sched { grid-area: sched; align-self: start; }
  .src .state { grid-area: state; align-self: start; }
  .src .chev { grid-area: chev; justify-self: end; }
  .src.expandable { min-height: 56px; }
  .fix { margin: 0 16px 14px; }

  .info::after { content: ""; position: absolute; inset: -14px; }
  .info .tip, .info:hover .tip, .info:focus-visible .tip, .info.open .tip { position: fixed; top: auto; right: max(12px, env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); z-index: 70; width: auto; padding: 12px 14px; font-size: 14px; transform: none; }
}
