/* 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: #5a5364; --text-3: #6a6474;
  --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: #a0640a; --amber-soft: #fcf3e2;
  --shadow-sm: 0 1px 2px rgba(26, 21, 35, .05), 0 1px 3px -1px rgba(26, 21, 35, .04);
  --shadow-md: 0 8px 24px -6px rgba(26, 21, 35, .1), 0 2px 5px -1px rgba(26, 21, 35, .05);
  /* Cards sit a hair above the page: a crisp contact line and a short soft fall-off, no glow. */
  --shadow-card: 0 1px 2px rgba(26, 21, 35, .06), 0 8px 20px -12px rgba(26, 21, 35, .16);
  --radius: 14px; --radius-sm: 8px; --ease: cubic-bezier(.2, .7, .2, 1);
  /* Surfaces: a soft violet-grey page so white cards stand out, a lighter sidebar and a frosted top bar framing it.
     Text greys are a shade deeper so they keep (and beat) their old contrast on the tinted page. */
  --page: #f1eff6; --sidebar: #f9f8fc; --sidebar-hover: #eeecf4; --bar-glass: rgba(251, 250, 253, .72); --card-border: #e3dfea; --th: #f8f6fb;
  /* Page texture: SCS violet-ink dots, quiet enough to vanish behind text. */
  --dot: rgba(80, 50, 140, .3);
}
/* Tokens added with dark mode; these light values are the original look. */
:root {
  --on-accent: #fff; --on-red: #fff; --inverse-fg: #fff;
  --tip-bg: #1a1523; --tip-fg: #fff; --tip-muted: #d9d4e2; --tip-line: transparent;
  --skeleton: #efedf3; --shimmer: rgba(255, 255, 255, .7); --scrim: rgba(26, 21, 35, .34);
  --brand-ink: #000; --brand-filter: none; --disabled: #b3adbb; --notice-ink: #4b2a86; --nav-ring: rgba(104, 0, 252, .07);
  --login-glow: rgba(236, 228, 251, .85); --google-btn: #120e19; --google-btn-hover: #2a2333; --google-btn-ink: #fff;
  --info-line: #e0d4f7; --info-bg: #f1ecfb; --info-ink: #3d2a66; --error-line: #f3cdd4; --error-ink: #8f1f33;
  --glass-strong: rgba(255, 255, 255, .86); --appbar-glass: rgba(247, 246, 249, .94); --tabbar-glass: rgba(255, 255, 255, .95);
  --mock: #fff; --mock-2: #faf8ff;
  --warn-line: #f1dcae; --warn-wash: linear-gradient(180deg, #fffaf0, #fdf4e3); --ok-line: #cdebdc; --ok-wash: linear-gradient(180deg, #f5fcf8, #e9f6ef); --banner-ico: #fff;
  --tone-0-bg: #f3edff; --tone-0-fg: #5a00dc; --tone-1-bg: #e5f3fb; --tone-1-fg: #0b6a99; --tone-2-bg: #e7f5ee; --tone-2-fg: #17875c;
  --tone-3-bg: #fcf3e2; --tone-3-fg: #92580a; --tone-4-bg: #fcebee; --tone-4-fg: #b22d45; --tone-5-bg: #eef0f3; --tone-5-fg: #4b5563;
  --shared-bg: #f4effd; --shared-fg: #7a4ad6;
  --ico-hyros-bg: #f1eefe; --ico-hyros: #5b3fd6; --ico-typeform-bg: #f2f2f2; --ico-typeform: #262627; --ico-ga4-bg: #fff4e5; --ico-ga4: #c26401;
  --ico-funnel-bg: #eef4ff; --ico-funnel: #2f5bd3; --ico-db-bg: #f4f3f6; --ico-db: #8a8494;
  /* One color per kind of number (as in Odin): visits teal, applications blue, booked calls violet, show-ups amber,
     money and sales green, ad spend grey. The daily chart uses the same: calls violet bars, revenue green line. */
  --m-visits: #0e7f8c; --m-leads: #2b7fc4; --m-calls: #7350d9; --m-show: #a87400; --m-money: #17875c; --m-sales: #1f8f5f; --m-spend: #77736b;
  --chart-grid: #efedf2; --chart-base: #e2dee7; --chart-bar: #e3d6ff; --chart-bar-active: #b692ff; --chart-line: #17875c; --chart-hover: rgba(26, 21, 35, .12);
}
/* Dark is the default: Odin's warm near-blacks and greys with the SCS violet as the only accent (no orange).
   Light applies when the viewer picks it (<html data-theme="light">, saved per browser by web/theme-state.js). */
:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a18; --surface-2: #20201e; --border: #2c2b28; --border-strong: #3d3c37;
  --text: #ecebe5; --text-2: #b8b6ae; --text-3: #9c9a92;
  --accent: #a98bff; --accent-hover: #bba3ff; --accent-soft: #221d30; --accent-mid: #7d63d9; --accent-faint: #352b52;
  --green: #7ccf8a; --green-soft: #17251a; --red: #ff6b5e; --red-soft: #2b1816; --amber: #e8b64c; --amber-soft: #2a2213;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 10px 28px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .35);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3);
  --page: #121211; --sidebar: #0f0f0e; --sidebar-hover: #1f1f1d; --bar-glass: rgba(18, 18, 17, .82); --card-border: #2c2b28; --th: #1f1f1d;
  --dot: rgba(236, 235, 229, .07);
  --on-accent: #121211; --on-red: #121211; --inverse-fg: #121211;
  --tip-bg: #2a2a27; --tip-fg: #ecebe5; --tip-muted: #9c9a92; --tip-line: #3d3c37;
  --skeleton: #232321; --shimmer: rgba(255, 255, 255, .05); --scrim: rgba(0, 0, 0, .6);
  --brand-ink: #ecebe5; --brand-filter: invert(.93); --disabled: #55534d; --notice-ink: #cdbcff; --nav-ring: rgba(169, 139, 255, .16);
  --login-glow: rgba(169, 139, 255, .08); --google-btn: #ecebe5; --google-btn-hover: #ffffff; --google-btn-ink: #121211;
  --info-line: #3a3054; --info-bg: #1f1b2b; --info-ink: #cdbcff; --error-line: #5a2b27; --error-ink: #ff8f85;
  --glass-strong: rgba(18, 18, 17, .86); --appbar-glass: rgba(18, 18, 17, .94); --tabbar-glass: rgba(15, 15, 14, .95);
  --mock: #1f1f1d; --mock-2: #1a1a18;
  --warn-line: #4a3b1c; --warn-wash: #211c12; --ok-line: #24402e; --ok-wash: #132019; --banner-ico: #262624;
  --tone-0-bg: #241d35; --tone-0-fg: #c4a8ff; --tone-1-bg: #14243a; --tone-1-fg: #7cc0ef; --tone-2-bg: #15261b; --tone-2-fg: #7ccf8a;
  --tone-3-bg: #2a2213; --tone-3-fg: #e8b64c; --tone-4-bg: #2b1816; --tone-4-fg: #ff8f85; --tone-5-bg: #262624; --tone-5-fg: #b8b6ae;
  --shared-bg: #241d35; --shared-fg: #c4a8ff;
  --ico-hyros-bg: #241d35; --ico-hyros: #b39dff; --ico-typeform-bg: #262624; --ico-typeform: #ecebe5; --ico-ga4-bg: #2a2014; --ico-ga4: #f0a04b;
  --ico-funnel-bg: #17223a; --ico-funnel: #7ca4f2; --ico-db-bg: #262624; --ico-db: #9c9a92;
  --m-visits: #4fb8c4; --m-leads: #5eaee8; --m-calls: #a38cf4; --m-show: #e8b64c; --m-money: #5fd296; --m-sales: #4fc78a; --m-spend: #8d8a82;
  --chart-grid: #232321; --chart-base: #3d3c37; --chart-bar: #4b3f7a; --chart-bar-active: #a38cf4; --chart-line: #5fd296; --chart-hover: rgba(236, 235, 229, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scrollbar-gutter: stable; scrollbar-color: var(--border-strong) transparent; }
body { position: relative; z-index: 0; 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(--page); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
/* A fine dot grid behind every screen, strongest under the header and faded out toward the bottom. Cards are opaque, so it never sits under numbers. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--dot) 1.1px, transparent 1.4px); background-size: 20px 20px; background-position: 9px 9px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .7) 30%, transparent 75%); mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .7) 30%, transparent 75%); }
/* Text that sits straight on the page wears a soft page-coloured plate, so no dot ever lands between its letters or digits.
   The plate hugs the text (same wrapping, nothing moves) and fades out at its edge. */
.content > .page-head :is(h1, p), .content > :is(.section-title, .card-note, .footnote, .more-note, .ph-off, .ph-notes), .team-heading :is(h1, p), .hub-login-legal {
  width: fit-content; max-width: 100%; border-radius: 6px; background-color: var(--page); box-shadow: 0 0 4px 3px var(--page); }
::selection { background: var(--accent-faint); color: var(--text); }
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: transparent; }
.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: one centered card on the Hub background. */
.hub-login { display: grid; place-items: center; min-height: 100vh; padding: 48px 20px; background: radial-gradient(60% 45% at 50% 0%, var(--login-glow) 0%, transparent 70%); }
.hub-login-wrap { width: min(392px, 100%); }
.hub-login-card { display: grid; gap: 22px; padding: 36px 32px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgba(26, 21, 35, .04), 0 12px 32px rgba(26, 21, 35, .07); }
.hub-login-card .brand { padding: 0; }
.hub-login-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.hub-login-head p { margin: 6px 0 0; color: var(--text-2); }
.hub-google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 48px; border-radius: 10px; background: var(--google-btn); color: var(--google-btn-ink); font-size: 15px; font-weight: 600; transition: background .15s var(--ease); }
.hub-google-button:hover { background: var(--google-btn-hover); }
.hub-google-chip { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #fff; }
.hub-google-chip svg { width: 16px; height: 16px; }
.hub-login-msg { margin: 0; padding: 11px 13px; border: 1px solid; border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.hub-login-msg.is-info { border-color: var(--info-line); background: var(--info-bg); color: var(--info-ink); }
.hub-login-msg.is-error { border-color: var(--error-line); background: var(--red-soft); color: var(--error-ink); }
.hub-login-note { margin: 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
.hub-login-legal { margin: 18px auto 0; text-align: center; font-size: 12px; color: var(--text-3); }
@media (max-width: 480px) {
  .hub-login { place-items: start center; padding: 32px 16px; }
  .hub-login-card { padding: 28px 22px 22px; }
}

/* Team access: live membership data, one row per person with an inline editor. */
.team-page { background: var(--page); }
.team-shell { flex: 1; }
.team-shell:focus { outline: none; }
.team-app .topbar { background: var(--bar-glass); }
.team-sidebar-slot { display: contents; }
.team-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--border); background: var(--glass-strong); backdrop-filter: saturate(1.4) blur(10px); }
.team-brand { display: inline-flex; align-items: center; gap: 9px; font-family: Montserrat, Inter, sans-serif; font-size: 17px; font-weight: 800; }
.team-back { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 8px; border-radius: 99px; color: var(--text-2); font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.team-back:hover { background: var(--accent-soft); color: var(--accent); }
.team-back svg { width: 16px; height: 16px; }
.team-main { width: min(1180px, 100%); margin: 0 auto; padding: 40px 24px 80px; }
.team-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.team-eyebrow { margin: 0 0 6px !important; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent) !important; }
.team-heading h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.team-heading p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.team-stats { display: flex; gap: 8px; margin: 0; }
.team-stats div { min-width: 92px; padding: 10px 14px; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.team-stats dt { font-size: 12px; color: var(--text-3); }
.team-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.team-status-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 20px; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); }
.team-status-card.is-error { border-color: var(--error-line); background: var(--red-soft); color: var(--error-ink); }
.team-status-card .btn { margin-left: auto; }
.team-spinner { width: 16px; height: 16px; border: 2px solid var(--accent-faint); border-top-color: var(--accent); border-radius: 50%; animation: team-spin .8s linear infinite; }
@keyframes team-spin { to { transform: rotate(360deg); } }
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 24px; }
.team-column, .team-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.team-side { position: sticky; top: 88px; }
.team-app .team-main { padding-top: 32px; }
.team-card { border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.team-card-head { padding: 20px 24px 0; }
.team-card h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.team-card-head p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; }

/* Editor (invite + inline edit) */
.team-editor { display: grid; gap: 18px; padding: 20px 24px 22px; }
.team-editor fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.team-editor legend, .team-field > span:first-child { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 600; }
.team-field small { display: block; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.team-email { display: flex; align-items: center; max-width: 460px; height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.team-email:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-faint); }
.team-email input { flex: 1; min-width: 0; height: 100%; padding: 0 4px 0 14px; border: 0; background: none; outline: none; font-size: 15px; }
.team-email-domain { padding: 0 14px 0 2px; color: var(--text-3); font-size: 15px; white-space: nowrap; }
.team-email.has-domain .team-email-domain { display: none; }
.team-roles { display: grid; }
.team-roles legend { grid-column: 1 / -1; }
.team-roles:has(legend) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.team-role { position: relative; display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease); }
.team-role:hover { border-color: var(--accent-mid); }
.team-role input { margin: 3px 0 0; accent-color: var(--accent); }
.team-role strong, .team-role small { display: block; }
.team-role strong { font-size: 14px; }
.team-role small { margin-top: 1px; color: var(--text-2); font-size: 12.5px; }
.team-role:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.team-client-count { padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--text-3); font-size: 12px; font-weight: 500; }
.team-clients legend { width: 100%; }
.team-client-tools { display: flex; gap: 14px; margin-left: auto; }
.team-link { color: var(--accent); font-size: 12.5px; font-weight: 600; }
.team-link:hover { text-decoration: underline; }
.team-chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.team-chip { position: relative; display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer; user-select: none; font-weight: 500; transition: border-color .15s var(--ease), background .15s var(--ease); }
.team-chip:hover { border-color: var(--accent-mid); }
.team-chip input { position: absolute; opacity: 0; pointer-events: none; }
.team-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.team-chip > span:not(.team-chip-check):not(.team-client-logo) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-chip-check { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--border-strong); border-radius: 6px; color: var(--on-accent); transition: background .15s var(--ease), border-color .15s var(--ease); }
.team-chip-check svg { width: 12px; height: 12px; opacity: 0; }
.team-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.team-chip:has(input:checked) .team-chip-check { border-color: var(--accent); background: var(--accent); }
.team-chip:has(input:checked) .team-chip-check svg { opacity: 1; }
.team-client-logo { flex: none; width: 20px; height: 20px; border-radius: 5px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.team-client-initials { display: grid; place-items: center; background: var(--bg); color: var(--text-2); font-size: 9px; font-weight: 700; }
.team-admin-note { display: none; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--bg); color: var(--text-2); font-size: 13px; }
.team-editor:has(input[name="role"][value="admin"]:checked) .team-clients { display: none; }
.team-editor:has(input[name="role"][value="admin"]:checked) .team-admin-note { display: block; }
.team-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.team-actions p { flex: 1; min-width: 200px; margin: 0; color: var(--text-3); font-size: 12.5px; }
.team-actions-end { display: flex; gap: 8px; margin-left: auto; }
.team-actions .btn { height: 38px; padding: 0 16px; }
.btn.danger-quiet { border-color: transparent; box-shadow: none; color: var(--red); }
.btn.danger-quiet:hover:not(:disabled) { border-color: var(--error-line); background: var(--red-soft); }
.btn.danger-quiet[data-confirming="1"] { border-color: var(--red); background: var(--red); color: var(--on-red); }

/* People list */
.team-list { margin: 14px 0 0; padding: 0; list-style: none; }
.team-row-wrap, .team-self { border-top: 1px solid var(--border); }
.team-row { display: grid; grid-template-columns: 36px minmax(0, 1.3fr) 76px minmax(0, 1.6fr) auto; align-items: center; gap: 14px; padding: 14px 24px; }
summary.team-row { cursor: pointer; list-style: none; transition: background .15s var(--ease); }
summary.team-row::-webkit-details-marker { display: none; }
summary.team-row:hover { background: var(--surface-2); }
.team-member[open] { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.team-member[open] > summary.team-row { background: none; }
.team-member[open] .team-editor { padding-top: 4px; animation: pop .2s var(--ease); }
.team-member[open] .team-edit { color: var(--text-3); background: none; }
.team-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 13px; font-weight: 650; }
.tone-0 { background: var(--tone-0-bg); color: var(--tone-0-fg); } .tone-1 { background: var(--tone-1-bg); color: var(--tone-1-fg); } .tone-2 { background: var(--tone-2-bg); color: var(--tone-2-fg); }
.tone-3 { background: var(--tone-3-bg); color: var(--tone-3-fg); } .tone-4 { background: var(--tone-4-bg); color: var(--tone-4-fg); } .tone-5 { background: var(--tone-5-bg); color: var(--tone-5-fg); }
.team-who { min-width: 0; }
.team-who strong, .team-who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-who strong { font-size: 14px; font-weight: 600; }
.team-who small { color: var(--text-3); font-size: 12.5px; }
.team-role-badge { justify-self: start; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.role-admin { background: var(--text); color: var(--inverse-fg); }
.role-member { background: var(--bg); color: var(--text-2); box-shadow: 0 0 0 1px var(--border) inset; }
.team-scope { display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; }
.team-mini-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 4px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.team-mini-chip .team-client-logo { width: 18px; height: 18px; border-radius: 50%; }
.team-more { padding: 0 9px; color: var(--text-3); }
.team-scope-all { color: var(--text-2); font-size: 13px; font-weight: 500; }
.team-scope-none { color: var(--text-3); font-size: 13px; font-style: italic; }
.team-row-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.team-state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.team-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state-active { background: var(--green-soft); color: var(--green); }
.state-invited { background: var(--amber-soft); color: var(--amber); }
.state-removed { background: var(--bg); color: var(--text-3); }
.team-you, .team-edit { min-width: 58px; padding: 5px 10px; border-radius: 8px; text-align: center; font-size: 12.5px; font-weight: 600; }
.team-you { color: var(--text-3); }
.team-edit { color: var(--accent); background: var(--accent-soft); }
summary.team-row:hover .team-edit { background: var(--accent-faint); }
.team-removed { border-top: 1px solid var(--border); }
.team-removed > summary { display: flex; align-items: center; gap: 6px; padding: 14px 24px; color: var(--text-3); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.team-removed > summary::-webkit-details-marker { display: none; }
.team-removed > summary svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.team-removed[open] > summary svg { transform: rotate(180deg); }
.team-removed .team-list { margin: 0; }
.is-removed .team-avatar, .is-removed .team-who, .is-removed .team-role-badge { opacity: .55; }
.team-list > :last-child .team-member:not([open]) summary { border-radius: 0 0 16px 16px; }

/* Side */
.team-rules { padding: 20px; }
.team-rules h2 { margin-bottom: 6px; }
.team-rule { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.team-rule:first-of-type { border-top: 0; }
.team-rule strong, .team-rule small { display: block; }
.team-rule strong { font-size: 13px; }
.team-rule small { margin-top: 2px; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.team-rule .team-role-badge { flex: none; margin-top: 1px; }
.team-rule-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.team-rule-icon svg { width: 17px; height: 17px; }

/* Toast */
.team-toast { position: fixed; left: 50%; bottom: 28px; z-index: 70; max-width: min(520px, calc(100% - 32px)); padding: 12px 18px 12px 16px; border-radius: 12px; background: var(--tip-bg); color: var(--tip-fg); box-shadow: 0 12px 32px rgba(26, 21, 35, .22); font-weight: 500; transform: translateX(-50%); animation: team-toast-in .25s var(--ease); }
.team-toast::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: #4ade80; vertical-align: 1px; }
.team-toast.is-error::before { background: #fb7185; }
@keyframes team-toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 768px) { .team-topbar { display: none; } }
@media (max-width: 1279px) {
  .team-grid { grid-template-columns: 1fr; }
  .team-side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 960px) {
  .team-row { grid-template-columns: 36px minmax(0, 1fr) auto; row-gap: 8px; }
  .team-row > .team-role-badge { grid-column: 2; grid-row: 2; }
  .team-row > .team-scope { grid-column: 2 / -1; grid-row: 3; }
  .team-row > .team-row-end { grid-column: 3; grid-row: 1; }
}
@media (max-width: 560px) {
  .team-main { padding: 28px 16px 64px; }
  .team-heading h1 { font-size: 25px; }
  .team-stats { width: 100%; } .team-stats div { flex: 1; min-width: 0; }
  .team-side { grid-template-columns: 1fr; }
  .team-roles:has(legend) { grid-template-columns: 1fr; }
  .team-editor, .team-card-head { padding-left: 16px; padding-right: 16px; }
  .team-row { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { .team-toast, .team-member[open] .team-editor, .team-spinner { animation: none; } }

/* 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(--card-border); background: var(--sidebar); overflow-y: auto; }
.brand-link { display: block; border-radius: 8px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 24px; color: var(--brand-ink); }
.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; }
/* Links touch (no flex gap) so the pointer never drops onto bare sidebar between them and flips back to the arrow; a transparent 1px border keeps the old 2px visual spacing. */
.nav { display: flex; flex-direction: column; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-block: 1px solid transparent; background-clip: padding-box; 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(--sidebar-hover); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--nav-ring); }
.nav-link.disabled { color: var(--disabled); 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: var(--bar-glass); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--card-border); }
.update-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 0; pointer-events: none; }
.update-fill { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: update-fill 1.2s ease-out both; }
.update-label { position: absolute; right: 32px; top: 8px; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-faint); animation: update-label 1.8s ease both; }
@keyframes update-fill { from { transform: scaleX(0); opacity: 1; } 85% { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }
@keyframes update-label { from { opacity: 0; transform: translateY(-4px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .update-fill, .update-label { animation-duration: 0.01s; } }
/* After a settled sync, each changed number fades in once, all at the same moment. */
.settle-in { animation: settle-in .5s var(--ease) both; }
@keyframes settle-in { from { opacity: .25; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .settle-in { animation: none; } }
.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); color: var(--inverse-fg); 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: 12px; background: var(--surface); box-shadow: 0 18px 50px rgba(26, 21, 35, .12), 0 2px 6px rgba(26, 21, 35, .05); }
.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: var(--inverse-fg); box-shadow: 0 1px 2px rgba(26, 21, 35, .2); }

.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: var(--notice-ink); 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), box-shadow .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: var(--on-accent); box-shadow: 0 1px 2px rgba(104, 0, 252, .24), inset 0 1px 0 rgba(255, 255, 255, .14); }
.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(--card-border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.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; }
.check-line { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; }
.check-line strong { color: var(--text); }
.check-line.check-failed { color: var(--amber); }
.check-line.not-connected { color: var(--red); }
.check-line.check-failed strong, .check-line.not-connected strong { color: inherit; }
.check-code { color: var(--text-3); font-size: 11.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; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.website-funnels { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
/* A website's sections: space between cards, and the same columns in every table so the numbers line up. */
.site-sections { display: grid; gap: 16px; margin-top: 20px; }
.site-sections + .footnote { margin-top: 16px; }
.site-table { table-layout: fixed; width: 100%; min-width: 760px; }
.site-table .c-page { width: 34%; } .site-table .c-n { width: 11%; } .site-table .c-funnel { width: 22%; }
.website-funnels small { color: var(--text-3); font-size: 12.5px; }
.kpi { padding: 18px 20px 16px; position: relative; display: flex; flex-direction: column; 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-partial { color: var(--text-3); font-weight: 500; }
.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; }
/* A long status in a card head wraps inside the card instead of running past its edge. */
.card-head .tag, .kpi-foot .tag { white-space: normal; max-width: 100%; }
.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: var(--shared-fg); background: var(--shared-bg); }
.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(--tip-bg); color: var(--tip-fg); outline: 1px solid var(--tip-line); 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; }
/* Desktop: the note floats above the page (app.js showInfo), so card edges never clip it. */
@media (hover: hover) and (min-width: 768px) { .info .tip { display: none; } }
.info-pop { max-width: 260px; font-weight: 400; }

.skeleton { position: relative; display: block; overflow: hidden; background: var(--skeleton); border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--shimmer), 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 cards: the header rule runs edge to edge; the stats keep their exact width. */
.client-card > .client-metrics { margin-inline: -20px; padding-inline: 20px; }
/* Air between the client's name and the rule above its numbers. */
.client-top + .client-metrics { margin-top: 18px; }
.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: 8px; 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), box-shadow .2s var(--ease), transform .2s var(--ease); }
.mini-client:hover, .mini-client:focus-visible { border-color: var(--border-strong); }
@media (hover: hover) { .mini-client:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); } }
.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(--chart-bar); }
.line-swatch { height: 3px; border-radius: 2px; vertical-align: 2px; background: var(--chart-line); }
.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(--chart-bar-active); }
.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(--tip-bg); color: var(--tip-fg); outline: 1px solid var(--tip-line); 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: var(--tip-muted); }
.chart-tip div span:last-child { color: var(--tip-fg); font-weight: 600; }
.chart-tip small { display: block; margin-top: 5px; color: var(--tip-muted); 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(--th); 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-line .step-total { margin-left: auto; display: inline-flex; align-items: baseline; gap: 6px; color: var(--text-2); }
.step-line .step-total strong { color: inherit; }
.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: var(--on-accent); 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, var(--mock) 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); }
.traffic-split-winner { margin: 0; font-size: 13px; color: var(--green); }
.traffic-split-winner strong { font-weight: 600; }
.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); box-shadow: 0 0 0 3px var(--accent-soft); }
.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: var(--inverse-fg); }
.chip.removable { display: inline-flex; align-items: center; gap: 6px; }
.chip.removable svg { width: 12px; height: 12px; stroke: currentColor; }
.select-filter { position: relative; display: inline-flex; align-items: center; }
.select-filter select { appearance: none; height: 32px; padding: 0 30px 0 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; max-width: 220px; text-overflow: ellipsis; }
.select-filter select:hover { border-color: var(--border-strong); }
.select-filter:has(option:checked:not([value=""])) select { border-color: var(--text); color: var(--text); }
.select-filter svg { position: absolute; right: 10px; width: 14px; height: 14px; stroke: currentColor; color: var(--text-3); pointer-events: none; }
.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: var(--mock); }
.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: var(--mock); 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, var(--mock) 0%, var(--mock-2) 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: var(--mock); 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 var(--warn-line); background: var(--warn-wash); }
.banner.ok { border-color: var(--ok-line); background: var(--ok-wash); }
.banner .b-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--banner-ico); 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(--th); 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: var(--ico-hyros-bg); color: var(--ico-hyros); }
.s-ico.typeform { background: var(--ico-typeform-bg); color: var(--ico-typeform); }
.s-ico.ga4 { background: var(--ico-ga4-bg); color: var(--ico-ga4); }
.s-ico.funnel { background: var(--ico-funnel-bg); color: var(--ico-funnel); }
.s-ico.db { background: var(--ico-db-bg); color: var(--ico-db); }
.s-ico.logo { position: relative; background: #fff; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.s-logo { width: 20px; height: 20px; object-fit: contain; }
.s-logo.hyros, .s-logo.sell-up { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.s-ico.pair { width: 42px; background: none; box-shadow: none; overflow: visible; }
.s-ico.pair .s-logo { position: absolute; top: 3px; width: 24px; height: 24px; border-radius: 7px; background: #fff; padding: 3px; box-shadow: 0 0 0 1px var(--border), 0 0 0 3px var(--surface); }
.s-ico.pair .s-logo:first-child { left: 0; }
.s-ico.pair .s-logo:last-child { left: 16px; padding: 0; }
.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: var(--on-accent); font-weight: 600; }
.days button.today span { box-shadow: inset 0 0 0 1px var(--accent-mid); }
.days button:disabled { color: var(--disabled); }
.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); color: var(--inverse-fg); 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: var(--scrim); 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: var(--scrim); }
  .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: var(--appbar-glass); backdrop-filter: saturate(1.4) blur(12px); }
  .appbar-lead .brand-icon { height: 24px; width: auto; }
  .update-label { right: 12px; }
  .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: var(--tabbar-glass); 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 var(--surface); }
  .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, .kpis.three { 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-card > .client-metrics { margin-inline: -16px; padding-inline: 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; }
}

/* Combined Dashboard: five totals. Hairlines come from the 1px grid gap, so wrapping never leaves stray borders. */
.summary.overview-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border); overflow: hidden; }
.summary.overview-kpis > div { padding: 18px; border: 0; background: var(--surface); }
.overview-kpis .kpi-value { font-size: 24px; }
.overview-kpis .kpi-foot { white-space: normal; }
/* Each total keeps its day-by-day line at the bottom, level across the strip. */
.summary.overview-kpis > div { display: flex; flex-direction: column; }
.summary.overview-kpis > div > .trend { margin-top: auto; }
@media (max-width: 1099px) {
  .summary.overview-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .summary.overview-kpis > div { grid-column: span 2; }
  .summary.overview-kpis > div:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 767px) {
  .summary.overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary.overview-kpis > div, .summary.overview-kpis > div:nth-child(n+4) { grid-column: auto; padding: 14px; }
  .summary.overview-kpis > div:last-child { grid-column: span 2; }
}

/* Sortable cross-client tables. */
.card-head.wrap .right { row-gap: 8px; }
table.sortable th { padding: 0; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; width: 100%; justify-content: flex-end; padding: 10px 20px; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
th:first-child .sort-btn, th.left .sort-btn { justify-content: flex-start; }
table.sortable th:not(:has(.sort-btn)) { padding: 10px 20px; }
.sort-btn:hover, .sort-btn.on { color: var(--text); }
.sort-icon { display: inline-grid; width: 12px; height: 12px; opacity: 0; transition: transform .15s var(--ease), opacity .15s var(--ease); }
.sort-icon svg { width: 12px; height: 12px; stroke: currentColor; }
.sort-btn:hover .sort-icon { opacity: .5; }
.sort-icon.asc, .sort-icon.desc { opacity: 1; }
.sort-icon.asc { transform: rotate(180deg); }
.client-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 500; color: var(--text-2); }
.client-cell .client-dot { width: 20px; height: 20px; }
table.sortable td { padding: 12px 10px; }
table.sortable .sort-btn, table.sortable th:not(:has(.sort-btn)) { padding: 10px 10px; }
table.sortable td:first-child, table.sortable th:first-child .sort-btn { padding-left: 20px; }
table.sortable td .name > div:last-child { min-width: 0; max-width: 196px; }
table.sortable td .thumb { display: none; }
table.sortable td .name strong, table.sortable td .name small { display: block; overflow: hidden; text-overflow: ellipsis; }

/* More (phone tab; also reachable on desktop). */
.more-list { margin: 0 0 8px; padding: 0; list-style: none; overflow: hidden; }
.more-list li + li { border-top: 1px solid var(--border); }
.more-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 16px; text-align: left; color: var(--text); }
.more-row:hover { background: var(--surface-2); }
.more-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.more-icon svg { width: 18px; height: 18px; stroke: currentColor; }
.more-text { flex: 1; min-width: 0; }
.more-text strong, .more-text small { display: block; }
.more-text strong { font-weight: 600; }
.more-text small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-chev svg { width: 16px; height: 16px; stroke: var(--text-3); }
.more-row .soon { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; }
.more-note { color: var(--text-3); font-size: 13px; }
.sheet-group { padding: 14px 4px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }

/* Phone redesign (approved 2026-09-29): one header, no repeated titles, 44px targets, solid tab bar. */
@media (max-width: 767px) {
  .appbar { background: var(--page); }
  .appbar-client { display: inline-flex; width: auto; max-width: 148px; height: 44px; gap: 6px; padding: 0 10px 0 7px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); }
  .appbar-client .client-dot { width: 26px; height: 26px; border-radius: 7px; }
  .appbar-client-name { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
  .appbar-client svg { width: 14px; height: 14px; flex: none; stroke: var(--text-3); }
  .appbar-date { height: 44px; margin: 0 2px 0 4px; }
  .appbar-date::after { display: none; }
  .appbar-lead { width: 44px; height: 44px; display: grid; place-items: center; }
  .tabbar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); backdrop-filter: none; box-shadow: 0 -1px 0 var(--border); border-top: 0; }
  .tab-dot { background: var(--red); }
  /* The app bar already names the screen. */
  .page-head h1 { display: none; }
  .page-head:not(:has(p, .btn, .right, .actions, button)) { display: none; }
  .page-head p { margin: 0; color: var(--text-3); }
  .section-title { font-size: 14px; }
}

/* Phone building blocks (views/phone.js). */
.ph-compare { margin: 0; color: var(--text-3); font-size: 13px; }
.ph-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 12px 0 10px; overflow: hidden; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--border); box-shadow: var(--shadow-card); }
.ph-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; background: var(--surface); }
.ph-tile.wide { grid-column: 1 / -1; }
.ph-label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.ph-value-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ph-value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.ph-value .sk-value { display: inline-block; width: 72px; height: 22px; }
.ph-scope { color: var(--amber); font-size: 12px; font-weight: 500; }
.ph-reason { color: var(--text-3); font-size: 12px; }
.ph-off { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; color: var(--text-3); font-size: 13px; line-height: 1.4; }
.ph-off svg { flex: none; width: 16px; height: 16px; margin-top: 1px; stroke: currentColor; }
.ph-off strong { color: var(--text-2); font-weight: 600; }
.ph-list { margin: 0; padding: 0; list-style: none; overflow: hidden; }
.ph-list > li + li { border-top: 1px solid var(--border); }
.ph-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px 10px 14px; color: var(--text); }
.ph-row:active { background: var(--surface-2); }
.ph-row > .client-logo, .ph-row > .fn-icon { flex: none; width: 36px; height: 36px; }
.ph-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ph-row-main > strong { overflow: hidden; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ph-row-main > small { overflow: hidden; color: var(--text-3); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.ph-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; color: var(--text-3); font-size: 12px; }
.ph-row-trail { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 44px; text-align: right; }
.ph-row-trail strong { font-size: 17px; font-weight: 650; }
.ph-row-trail small { color: var(--text-3); font-size: 12px; }
.ph-chev { flex: none; display: grid; color: var(--text-3); }
.ph-chev svg { width: 16px; height: 16px; stroke: currentColor; }
.ph-group { margin-top: 16px; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.ph-group > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; font-weight: 600; cursor: pointer; list-style: none; }
.ph-group > summary::-webkit-details-marker { display: none; }
.ph-group > summary svg { width: 16px; height: 16px; margin-left: auto; stroke: var(--text-3); transition: transform .2s var(--ease); }
.ph-group[open] > summary svg { transform: rotate(180deg); }
.ph-group[open] > summary { border-bottom: 1px solid var(--border); }
.ph-count { padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--text-3); font-size: 12px; font-weight: 600; }

/* Phone list toolbar and Filter/Sort sheets. */
.ph-toolbar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 10; display: flex; flex-direction: column; gap: 8px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))) 12px; padding: 8px max(16px, env(safe-area-inset-left)) 10px; background: var(--page); }
.ph-toolbar .search { width: 100%; min-width: 0; height: 44px; }
.ph-toolbar .search input { font-size: 16px; }
.ph-toolbar-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.ph-tool { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 600; color: var(--text-2); }
.ph-tool svg { width: 16px; height: 16px; flex: none; stroke: currentColor; }
.ph-tool.on { border-color: var(--text); color: var(--text); }
.ph-tool-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ph-badge { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 12px; }
.ph-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ph-chips::-webkit-scrollbar { display: none; }
.ph-chips .chip { flex: none; height: 36px; }
.sheet-section { margin: 18px 4px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sheet-section:first-child { margin-top: 4px; }
.ph-notes { margin: 16px 0 0; padding: 0 0 0 18px; color: var(--text-3); font-size: 13px; }
.ph-notes li + li { margin-top: 4px; }
.ph-chart { padding: 14px 14px 10px; margin-top: 12px; }
.ph-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ph-chart-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.ph-seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border); }
.ph-seg button { min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ph-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.spaced-row { margin-top: 16px; }
.ph-row .fn-icon { display: grid; place-items: center; }

/* Team access: the invite column must never grow past its card (was 413px wide on a 390px phone). */
.team-editor { grid-template-columns: minmax(0, 1fr); }
.team-field, .team-email { min-width: 0; }
.team-summary, .team-editor-head, .team-sheet-close, .team-help { display: none; }

/* Phone detail screens, health and team (approved 2026-09-29). */
@media (max-width: 767px) {
  /* Funnel: steps read top to bottom with the drop-off between them. */
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow .step { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title big" "bar bar" "conv conv"; align-items: center; gap: 6px 12px; border-left: 0 !important; }
  .flow .step + .step { border-top: 1px solid var(--border); }
  .flow .step h3 { grid-area: title; margin: 0; }
  .flow .step .big { grid-area: big; margin: 0; }
  .flow .step .bar { grid-area: bar; margin: 0; }
  .flow .step .conv { grid-area: conv; margin: 0; }
  .ph-tags { margin: -6px 0 10px; }
  .page-head .btn { width: 100%; }
  .split-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin: 10px 0 4px; }
  .split-presets button { padding: 0 4px; }
  input[data-traffic-slider] { height: 44px; }
  input[data-traffic-slider]::-webkit-slider-thumb { width: 28px; height: 28px; }
  input[data-traffic-slider]::-moz-range-thumb { width: 28px; height: 28px; }
  .traffic-split [data-action="traffic-apply"], .traffic-split [data-action="traffic-reopen"], .traffic-split [data-action="traffic-declare"] { width: 100%; }
  .traffic-split .ext { display: inline-block; padding: 12px 0; }
  /* Reordering steps is a desk task. */
  .step-handle, .order-note { display: none; }

  /* Health: status first, problems next, clients folded. */
  .ph-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; }
  .ph-status > div:nth-child(2) { flex: 1; min-width: 0; }
  .ph-status strong, .ph-status span { display: block; }
  .ph-status span { color: var(--text-3); font-size: 13px; }
  .ph-status .btn { width: 100%; }
  .ph-status.bad .b-ico { color: var(--red); background: var(--red-soft); }
  .ph-status.warn .b-ico { color: var(--amber); background: var(--amber-soft); }
  .ph-attention { width: 100%; text-align: left; }
  .ph-attention .s-ico, .ph-src .s-ico { flex: none; }
  .ph-src { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; }
  .fix-where { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
  .fix-steps { padding-left: 20px; }
  .fix-steps li + li { margin-top: 6px; }

  /* Team: rows are plain; editing and inviting open full screen with Save in reach. */
  .team-app .team-topbar { display: flex; }
  .team-app .team-topbar .appbar-title { flex: 1; }
  .team-invite-open { height: 40px; margin-right: 6px; padding: 0 16px; }
  .team-heading, .team-stats { display: none; }
  .team-main { padding: 12px max(12px, env(safe-area-inset-left)) calc(96px + env(safe-area-inset-bottom)); }
  .team-card { box-shadow: var(--shadow-card); }
  .team-invite-card:not(.is-open) { display: none; }
  .team-invite-card.is-open, .team-member[open] > .team-editor { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow-y: auto; margin: 0; border: 0; border-radius: 0; padding: env(safe-area-inset-top) 0 0; background: var(--surface); }
  .team-invite-card.is-open .team-card-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
  .team-invite-card.is-open .team-card-head p { display: none; }
  .team-sheet-close { display: grid; place-items: center; width: 44px; height: 44px; }
  .team-sheet-close svg, .team-editor-head svg { width: 20px; height: 20px; }
  .team-invite-card.is-open .team-editor { flex: 1; }
  .team-member[open] > .team-editor { gap: 18px; padding: env(safe-area-inset-top) 16px 0; }
  .team-editor-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 0 -16px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .team-editor-head .icon-btn { display: grid; place-items: center; width: 44px; height: 44px; }
  .team-editor-head strong, .team-editor-head small { display: block; }
  .team-editor-head small { color: var(--text-3); }
  .team-editor .team-actions { position: sticky; bottom: 0; z-index: 2; margin: auto -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
  .team-invite-card.is-open .team-editor .team-actions { margin: auto -24px 0; }
  .team-actions p { display: none; }
  .team-actions .btn { height: 44px; }
  .team-actions-end { flex: 1; }
  .team-actions-end .btn { flex: 1; }
  .btn.danger-quiet { width: 100%; }
  .team-email-domain { padding-right: 12px; font-size: 14px; }
  .team-email input { font-size: 16px; }
  .team-roles:has(legend) { grid-template-columns: 1fr; }
  .team-link { display: inline-grid; place-items: center; min-height: 44px; padding: 0 4px; }
  .team-chip { height: 48px; }
  .team-row { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 0; min-height: 64px; padding: 10px 14px; }
  .team-row > .team-role-badge, .team-row > .team-scope { display: none; }
  .team-row > .team-row-end { grid-column: 3; grid-row: 1; }
  .team-summary { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; }
  .team-who small { display: none; }
  .team-row-end .team-state { display: none; }
  .team-edit, .team-you { min-width: 0; padding: 0; background: none; color: var(--text-3); }
  .team-edit { font-size: 0; }
  .team-edit::after { content: "›"; font-size: 22px; line-height: 1; }
  .team-removed > summary { min-height: 52px; }
  .team-side { display: block; }
  .team-help { display: block; border: 1px solid var(--card-border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
  .team-help > summary { display: flex; align-items: center; min-height: 52px; padding: 0 16px; font-weight: 600; cursor: pointer; }
  .team-side:has(#team-help:not([open])) .team-rules { display: none; }
  .team-side:has(#team-help[open]) .team-rules { margin-top: 12px; }
  .team-toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.team-sheet-open { overflow: hidden; }
  body.team-sheet-open .tabbar { display: none; }
}
@media (max-width: 767px) {
  .ph-seg button { min-height: 44px; }
  .ph-chips .chip { height: 44px; }
  .ph-toolbar .search input, .team-email input { height: 100%; }
  .sheet .toggle { min-height: 44px; }
  .team-invite-open { height: 44px; }
  .team-link { min-width: 44px; }
  .traffic-split .ext { min-height: 44px; }
}

/* Phone review fixes (2026-09-29). */
.team-invite-cancel { display: none; }
.ph-count.bad { background: var(--red-soft); color: var(--red); }
.inline-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 767px) {
  .appbar-client:not(:has(.client-dot)) { padding-left: 12px; }
  .appbar.has-back .appbar-client-name { display: none; }
  .appbar.has-back .appbar-client { padding: 0 8px 0 7px; }
  .ph-value-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .ph-row-main > small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ph-toolbar-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ph-partial-note { margin: 6px 0 0; color: var(--text-3); font-size: 12px; }
  .ph-off { margin-top: 12px; }
  .ph-status.bad { border-color: var(--red-soft); background: var(--red-soft); }
  .ph-status.warn { border-color: var(--amber-soft); background: var(--amber-soft); }
  /* Single logos and logo pairs take the same 42px so row text lines up. */
  .ph-attention > .s-ico, .ph-src > .s-ico { width: 30px; height: 30px; border-radius: 8px; flex: none; margin-right: 12px; }
  .ph-attention > .s-ico.pair, .ph-src > .s-ico.pair { width: 42px; margin-right: 0; }
  .sheet-foot:has(.sel) { flex-wrap: wrap; }
  .sheet-foot .sel { flex-basis: 100%; }
  .step-block.solo .step-line strong { display: none; }
  .page-item .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .sheet-foot > .btn, .sheet-foot .actions { flex: 1; }
  .sheet-foot .actions .btn { flex: 1; }
  .fix-where { margin-bottom: 4px; }
  .sheet-section { margin-left: 0; margin-right: 0; }
  .team-invite-cancel { display: inline-flex; }
  .team-actions .team-actions-end { display: flex; gap: 8px; width: 100%; }
  .team-help > summary { justify-content: space-between; list-style: none; }
  .team-help > summary::-webkit-details-marker { display: none; }
  .team-help > summary svg { width: 16px; height: 16px; stroke: var(--text-3); transition: transform .2s var(--ease); }
  .team-help[open] > summary svg { transform: rotate(180deg); }
  .team-invite-open { margin-top: 0; }
}

/* Client cards: one stat per row, label then value then change. */
.client-metrics.rows { display: flex; flex-direction: column; gap: 10px; }
.client-metrics.rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; align-items: center; column-gap: 10px; }
.client-metrics.rows > div > span:first-child { font-size: 13px; color: var(--text-2); }
.client-metrics.rows strong { margin-top: 0; font-size: 15px; text-align: right; }
.client-metrics.rows .delta { grid-column: 3; justify-self: end; }
.client-metrics.rows .mini-state { grid-column: 2 / -1; text-align: right; }
.client-metrics.rows .skeleton { margin-top: 0; width: 56px; }
.ph-client { align-items: flex-start; }
.ph-client > .client-logo { margin-top: 2px; }
.ph-client > .ph-chev { align-self: center; }
.ph-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.ph-kpis > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.ph-kpis small { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.ph-kpis strong { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }

/* Theme switch (sidebar foot; the phone has it under More). */
.theme-btn { display: flex; align-items: center; gap: 8px; width: calc(100% + 12px); height: 34px; margin: 0 -6px 4px; padding: 0 6px; border-radius: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.theme-btn:hover { background: var(--sidebar-hover); color: var(--text); }
.theme-btn svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.brand-icon { filter: var(--brand-filter); }

/* Daily chart in theme colors: booked calls violet bars, revenue collected green line. */
.combo .grid-line { stroke: var(--chart-grid); }
.combo .grid-line.base { stroke: var(--chart-base); }
.combo .bar:not(.active) { fill: var(--chart-bar); }
.combo .rev-line, .combo .partial-line { stroke: var(--chart-line); }
.combo .rev-point { fill: var(--chart-line); }
.combo .rev-stop { stop-color: var(--chart-line); }
.combo .hover-line { stroke: var(--chart-hover); stroke-opacity: 1; }
.combo .hover-dot, .combo .partial-dot { fill: var(--surface); stroke: var(--chart-line); }

/* Metric tiles (Odin): each kind of number has its color, a dot by its name and a day-by-day line; money in is green. */
.t-visits { --tone: var(--m-visits); } .t-leads { --tone: var(--m-leads); } .t-calls { --tone: var(--m-calls); } .t-show { --tone: var(--m-show); }
.t-money { --tone: var(--m-money); } .t-sales { --tone: var(--m-sales); } .t-spend { --tone: var(--m-spend); }
.tone-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--text-3)); }
.t-money > .kpi-value, .ph-tile.t-money .ph-value { color: var(--m-money); }
/* Logos are drawn for white: transparent ones get a white plate in both themes (initials keep their brand color). */
img.client-logo, img.client-dot { background: #fff; }
.kpi-foot:has(+ .trend) { margin-bottom: 12px; }
.kpi > .trend, .ph-tile > .trend { margin-top: auto; }
.trend { position: relative; height: 32px; color: var(--tone, var(--accent)); cursor: crosshair; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.trend svg { display: block; width: 100%; height: 100%; overflow: visible; }
.trend-area { fill: currentColor; opacity: .12; }
.trend-stroke { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend-stroke.partial { stroke-dasharray: 3 3; opacity: .65; }
.trend-dot { position: absolute; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; opacity: 0; }
.trend-tip { position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: 3; display: grid; gap: 1px; padding: 5px 9px; border-radius: 7px; background: var(--tip-bg); color: var(--tip-fg); outline: 1px solid var(--tip-line); box-shadow: var(--shadow-md); font-size: 12px; line-height: 1.35; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateX(-50%); transition: opacity .12s var(--ease); }
.trend-tip small { color: var(--tip-muted); font-size: 11.5px; }
.trend-tip strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.trend[data-active] .trend-dot, .trend[data-active] .trend-tip { opacity: 1; }
.ph-tile > .trend { height: 26px; margin-top: 8px; }

/* Client picker at the top of the sidebar, like Odin's: company and person on the button; the menu adds each client's data status. */
.side-client { margin-bottom: 4px; }
.side-client .nav-label { margin-top: 0; }
.side-client-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; transition: border-color .15s var(--ease); }
.side-client-btn:hover, .side-client.open .side-client-btn { border-color: var(--border-strong); }
.side-client-btn .client-dot { width: 28px; height: 28px; border-radius: 7px; font-size: 10px; }
.pick-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.pick-text strong { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-text small { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-chev { display: grid; place-items: center; flex: none; color: var(--text-3); }
.pick-chev svg { width: 14px; height: 14px; stroke: currentColor; }
/* While the menu is open it may reach past the sidebar's edge, like Odin's. */
.sidebar.picking { overflow: visible; z-index: 25; }
.side-client-menu { left: 0; right: auto; width: 292px; min-width: 0; padding: 4px; border-radius: 10px; box-shadow: var(--shadow-md); }
.side-client-list { max-height: min(440px, calc(100vh - 230px)); overflow-y: auto; }
.side-client-menu button { gap: 10px; min-height: 40px; padding: 4px 10px; font-weight: 400; }
.side-client-menu .client-dot { width: 20px; height: 20px; border-radius: 5px; font-size: 8px; }
.side-client-menu .pick-text strong { font-weight: 500; }
.side-client-menu .pick-text small { margin-left: 0; font-size: 11px; font-weight: 400; color: var(--text-3); }
.side-client-menu hr { margin: 4px 0; }
.pick-status { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.pick-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pick-status.live { color: var(--green); }
.pick-status.warn { color: var(--amber); }
.pick-check { display: grid; place-items: center; flex: none; width: 14px; color: var(--accent); }
.pick-check svg { width: 14px; height: 14px; stroke: currentColor; }
.menu-label { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.sheet-option .pick-status { margin-left: auto; }

/* What a change badge compares against (app.js showChange): a floating note above the badge. */
.change-tip { position: fixed; left: 0; top: 0; z-index: 80; display: grid; gap: 2px; max-width: 290px; padding: 8px 11px; border-radius: 8px; background: var(--tip-bg); color: var(--tip-fg); outline: 1px solid var(--tip-line); box-shadow: var(--shadow-md); font-size: 12.5px; line-height: 1.4; pointer-events: none; }
.change-tip strong { font-weight: 600; }
.change-tip small { color: var(--tip-muted); font-size: 12px; }
.change-tip span { font-variant-numeric: tabular-nums; }
.sheet-option .pick-status + .sheet-check { margin-left: 10px; }

/* Dashboard -> Report (report-ui.js), like Odin's: Summary or Full, the image as its own preview, then downloads. */
.page-head .report-btn { flex: none; }
.report-btn svg { width: 16px; height: 16px; stroke: currentColor; }
body.report-open { overflow: hidden; }
.report-layer { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.report-scrim { position: absolute; inset: 0; background: var(--scrim); }
.report-modal { position: relative; display: flex; flex-direction: column; gap: 14px; width: min(920px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 18px 20px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); outline: none; }
.report-head { display: flex; align-items: center; justify-content: space-between; }
.report-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.report-head .icon-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.report-tabs { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.report-tabs button { height: 30px; padding: 0 16px; border-radius: 6px; font-weight: 500; color: var(--text-2); }
.report-tabs button:hover { color: var(--text); }
.report-tabs button.on { background: var(--text); color: var(--inverse-fg); }
.report-preview { position: relative; min-height: 220px; border: 1px solid var(--border); border-radius: 10px; background: #141413; overflow: hidden; }
.report-preview canvas { display: none; width: 100%; height: auto; }
.report-preview.ready canvas { display: block; }
.report-preview.ready .report-wait { display: none; }
.report-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #9c9a92; font-size: 13px; }
.report-note { margin: 0; color: var(--text-3); font-size: 12.5px; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.report-actions .btn { height: 40px; }
.report-actions .btn:disabled { opacity: .5; cursor: default; }
@media (max-width: 560px) {
  .report-layer { padding: 0; place-items: end stretch; }
  .report-modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .report-actions { grid-template-columns: 1fr; }
  .page-head .report-btn span { display: none; }
  .page-head .report-btn { width: 40px; padding: 0; }
}
.report-preview.ready { min-height: 0; }

/* Loading screen: the app's outline while Hub opens (web/index.html, gateView "opening"). */
#hub-root.booting { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.boot-side { display: flex; flex-direction: column; gap: 12px; padding: 22px 14px 16px; border-right: 1px solid var(--card-border); background: var(--sidebar); }
.boot-side .brand { margin: 0 6px 14px; }
.boot-pick { height: 46px; margin-bottom: 8px; border-radius: 10px; }
.boot-nav { height: 22px; width: 70%; margin-left: 6px; }
.boot-main { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1000px; margin: 0 auto; padding: 96px 32px 32px; outline: none; }
.boot-title { height: 28px; width: 180px; }
.boot-sub { height: 14px; width: 240px; margin-bottom: 18px; }
.boot-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; }
.boot-tiles .skeleton { height: 150px; border-radius: 0; }
.boot-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.boot-cards .skeleton { height: 200px; border-radius: 12px; }
@media (max-width: 1099px) { #hub-root.booting { grid-template-columns: minmax(0, 1fr); } .boot-side { display: none; } }
@media (max-width: 767px) {
  .boot-main { padding: 72px 16px 24px; }
  .boot-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .boot-tiles .skeleton { height: 110px; border-radius: 12px; }
  .boot-cards { grid-template-columns: minmax(0, 1fr); }
}

/* Ultrawide and 4K at 100%: the page uses more of the screen (client cards stay three across, nine clients fill 3 × 3). */
@media (min-width: 2200px) {
  .content { max-width: 1680px; }
}

/* Team access inside the Hub shell: the content area already gives the page its width and padding. */
.content .team-main { width: 100%; margin: 0; padding: 0; }
.team-phone-invite { display: none; }
@media (max-width: 767px) {
  .team-phone-invite { display: flex; justify-content: flex-end; margin-bottom: 12px; }
}
/* Two cards in a row never touch (block margins collapse, so screens that already space them don't change). */
.content > .card + .card, .content > .card + .ph-group, .content > .ph-group + .card { margin-top: 12px; }
