/* Shared styles. Colors and fonts come from brand.css (the one place to recolor). */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease !important; }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 16px; }
a { color: var(--link); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.label { color: var(--label); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.muted { color: var(--label); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ───── Top bar ───── */
.topbar {
  background: var(--topbar-bg); color: #fff; height: 60px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
}
.brand { font-family: var(--font-head); font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand span { color: #9cc9e3; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.chip { background: rgba(255,255,255,.1); padding: 6px 14px; border-radius: 999px; font-size: 13px; }

/* ───── Buttons ───── */
.btn {
  background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: 9px;
  padding: 9px 16px; font: 600 13.5px 'Inter', sans-serif; cursor: pointer;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.btn:hover { background: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--tint-1); border-color: var(--accent); }
.btn.light { background: rgba(255,255,255,.12); color: #fff; }
.btn.light:hover { background: rgba(255,255,255,.22); }
.btn.small { padding: 7px 12px; font-size: 13px; }

/* ───── Surfaces ───── */
.card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head .sub { color: var(--label); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid > *, .card, .client-hero > * { min-width: 0; }
img, video { max-width: 100%; }
.card { overflow-wrap: break-word; }
td, th { overflow-wrap: normal; }

/* KPI tiles: one primary, quieter secondary */
.kpis { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 20px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--card); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.kpi .value { font: 800 34px 'Plus Jakarta Sans', sans-serif; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.kpi .note { color: var(--label); font-size: 12.5px; margin-top: 6px; }
.kpi.primary { background: var(--primary-bg); color: #fff; }
.kpi.primary .label, .kpi.primary .note { color: #9cc9e3; }
.kpi.primary .value { font-size: 44px; }
.kpi.quiet { box-shadow: none; background: var(--quiet-bg); }
.kpi.quiet .value { font-size: 26px; }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 9px;
  font: 14.5px 'Inter', sans-serif; color: var(--text); background: var(--input-bg); transition: border-color var(--ease), box-shadow var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,184,.16); }
textarea { resize: vertical; min-height: 96px; }
.search { position: relative; }
.search input { padding-left: 36px; background: var(--tint-1); border-color: transparent; }
.search input:focus { background: var(--input-bg); border-color: var(--accent); }
.search::before { content: ''; position: absolute; left: 13px; top: 50%; width: 11px; height: 11px; border: 1.6px solid var(--label); border-radius: 50%; transform: translateY(-62%); }
.search::after { content: ''; position: absolute; left: 23px; top: 50%; width: 6px; height: 1.6px; background: var(--label); transform: translateY(5px) rotate(45deg); }
.msg { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 14px; }
.msg.err { background: var(--danger-bg); color: var(--danger); }
.msg.info { background: var(--tint-2); color: var(--text); }

/* ───── Tables ───── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--label); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em;
  padding: 12px 16px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; position: sticky; top: 0; background: var(--card);
}
th.sortable { cursor: pointer; user-select: none; transition: color var(--ease); }
th.sortable:hover { color: var(--text); }
th.sortable.sorted::after { content: ' ↓'; } th.sortable.sorted.asc::after { content: ' ↑'; }
td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background var(--ease); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--tint-1); }
td.r, th.r { text-align: right; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .t { font-weight: 600; }
.who .s { color: var(--label); font-size: 12.5px; }

/* Status: tonal blues only */
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--tint-2); color: var(--link); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--tint-2); color: var(--link); }
.badge.bad { background: transparent; color: var(--label); box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge.warn { background: var(--tint-1); color: var(--label); box-shadow: inset 0 0 0 1px var(--line); }
.badge.plain::before { display: none; }

/* Tabs */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line-strong); margin: 4px 0 24px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab { background: none; border: 0; padding: 12px 2px; font: 600 14px 'Inter', sans-serif; color: var(--label); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color var(--ease), border-color var(--ease); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* ───── Content ───── */
.posts { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--card); transition: border-color var(--ease), transform var(--ease); }
.post:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.post .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.post .plat { font-size: 12px; font-weight: 600; color: var(--label); text-transform: capitalize; }
.post .caption { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post .when { color: var(--label); font-size: 12.5px; margin-top: auto; }
.post img { width: 100%; border-radius: var(--radius-sm); max-height: 160px; object-fit: cover; }
.group-label { margin: 22px 0 10px; }
.group-label:first-child { margin-top: 0; }

/* ───── Call rows + player ───── */
.call { padding: 18px 0; border-bottom: 1px solid var(--line); }
.call:last-child { border-bottom: 0; padding-bottom: 0; } .call:first-child { padding-top: 0; }
.call-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.call-main .t { font-weight: 600; }
.call-main .s { color: var(--label); font-size: 13px; }
.call-meta { display: flex; align-items: center; gap: 14px; color: var(--label); font-size: 13px; }
.player { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 14px; background: var(--tint-1); border-radius: 10px; }
.player .pp { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; flex: none; transition: background var(--ease); }
.player .pp:hover { background: var(--accent-dark); }
.player .pp svg { width: 12px; height: 12px; fill: currentColor; }
.player .time { font-size: 12px; color: var(--label); min-width: 78px; text-align: center; font-variant-numeric: tabular-nums; }
.player input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; padding: 0; border: 0; border-radius: 4px; background: var(--line-strong); flex: 1; box-shadow: none; }
.player input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--text); border: 0; cursor: pointer; }
.player input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--text); border: 0; cursor: pointer; }
.player .spd { border: 0; background: transparent; color: var(--label); font: 600 12px 'Inter', sans-serif; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.player .spd:hover { background: var(--tint-2); color: var(--text); }
.player.idle { justify-content: space-between; }
details.transcript { margin-top: 10px; }
details.transcript summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 13px; }
details.transcript div { white-space: pre-wrap; font-size: 13.5px; margin-top: 8px; padding: 14px 16px; background: var(--tint-1); border-radius: 10px; }

/* ───── Empty + loading ───── */
.empty { text-align: center; padding: 44px 16px; color: var(--label); }
.empty .t { color: var(--text); font: 700 16px 'Plus Jakarta Sans', sans-serif; margin-bottom: 4px; }
.empty .s { font-size: 13.5px; max-width: 380px; margin: 0 auto; }
.skel { background: linear-gradient(90deg, var(--tint-2) 25%, var(--tint-1) 50%, var(--tint-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row { height: 46px; margin-bottom: 10px; } .skel-kpi { height: 96px; border-radius: var(--radius); }

/* ───── Dashboard shell ───── */
.side-label { margin: 20px 10px 8px; }
.nav-item, .client-item { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: background var(--ease); }
.nav-item:hover, .client-item:hover { background: var(--tint-1); }
.nav-item.active, .client-item.active { background: var(--tint-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--tint-2); color: var(--link); display: grid; place-items: center; font: 700 12px 'Plus Jakarta Sans', sans-serif; flex: none; }
.client-item.active .avatar { background: var(--accent); color: #fff; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.navy { background: var(--navy); color: #fff; }
.client-item .name, .nav-item .name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.client-item .meta { font-size: 12px; color: var(--label); }
.main { padding: 36px 40px 64px; max-width: 1240px; width: 100%; min-width: 0; box-sizing: border-box; }
.page-head { margin-bottom: 24px; }
.page-head .sub { color: var(--label); margin-top: 2px; }
.client-hero { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.client-hero .id { display: flex; gap: 18px; align-items: center; min-width: 0; }
.client-hero .kind { color: var(--label); margin-top: 2px; }
.client-hero .links { margin-top: 6px; font-size: 13.5px; display: flex; gap: 6px 16px; flex-wrap: wrap; }
.health { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.health .h { display: inline-flex; align-items: center; gap: 8px; background: var(--chip-bg); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; color: var(--text); }
.health .h i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.health .h.off i { background: var(--line-strong); } .health .h.off { color: var(--label); }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.attn li:last-child { border-bottom: 0; padding-bottom: 0; } .attn li:first-child { padding-top: 0; }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.note-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.note-item:last-child { border-bottom: 0; padding-bottom: 0; } .note-item:first-child { padding-top: 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(30,58,74,.5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade 160ms ease-out; }
.modal { background: var(--card); border-radius: 16px; padding: 28px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px -20px rgba(30,58,74,.5); animation: rise 200ms cubic-bezier(.2,.7,.2,1); }
.modal .sec { margin: 6px 0 12px; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ───── Auth + portal ───── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-logo .brand { color: var(--text); font-size: 24px; }
.page { max-width: 1120px; margin: 0 auto; padding: 40px 28px 72px; }
.hero { margin-bottom: 28px; }
.hero h1 { margin-bottom: 4px; }
.fade-in { animation: fade 240ms ease-out; }

/* ───── Responsive ───── */
@media (max-width: 960px) {
  .kpis, .kpis.four, .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi.primary { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .main { padding: 24px 16px 48px; }
  .topbar { padding: 0 16px; }
  .page { padding: 28px 16px 56px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .kpis, .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px 18px; } .kpi .value { font-size: 26px; } .kpi.primary .value { font-size: 36px; }
  .topbar .chip { display: none; } .brand { font-size: 15px; }
  h1 { font-size: 25px; }
  /* tables become stacked cards */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 4px 0; text-align: left !important; }
  table.stack td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 110px; color: var(--label); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
  .card { padding: 18px; }
}
/* ───── Post detail drawer ───── */
.post { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.post:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(30,58,74,.45); z-index: 60; display: flex; justify-content: flex-end; animation: fade 160ms ease-out; }
.drawer { background: var(--card); width: min(500px, 100%); height: 100%; overflow-y: auto; box-shadow: -20px 0 50px -20px rgba(30,58,74,.45); animation: slide 220ms cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; }
.drawer header { padding: 22px 26px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; position: sticky; top: 0; background: var(--card); z-index: 1; }
.drawer header h2 { font-size: 19px; line-height: 1.3; }
.drawer .x { border: 0; background: var(--tint-2); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; flex: none; transition: background var(--ease); }
.drawer .x:hover { background: var(--line-strong); }
.drawer .body { padding: 22px 26px 36px; display: grid; gap: 22px; }
.drawer .sec .label { margin-bottom: 8px; }
.drawer .media { width: 100%; border-radius: var(--radius); background: var(--tint-2); max-height: 320px; object-fit: cover; display: block; }
.drawer .no-media { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--label); font-size: 13px; }
.drawer .full-caption { white-space: pre-wrap; overflow-wrap: anywhere; }
.drawer .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer .tag { background: var(--tint-2); color: var(--link); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; text-transform: capitalize; }
.drawer .na { color: var(--label); font-size: 13.5px; }
/* media viewer */
.post img { aspect-ratio: 4 / 3; max-height: none; background: var(--tint-2); }
.vid { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy); }
.vid video { width: 100%; max-height: 420px; display: block; background: var(--navy); }
.vid-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--navy); cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 24px rgba(30,58,74,.35); transition: transform var(--ease), background var(--ease); }
.vid-play:hover { transform: scale(1.06); background: #fff; }
.vid-play svg { width: 22px; height: 22px; fill: currentColor; margin-left: 3px; }
.car { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--tint-2); outline-offset: 2px; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.car-track::-webkit-scrollbar { display: none; }
.car-track img { flex: none; width: 100%; max-height: 420px; object-fit: contain; scroll-snap-align: center; background: var(--tint-2); }
.car-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--navy); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(30,58,74,.25); transition: opacity var(--ease); }
.car-nav.prev { left: 10px; } .car-nav.next { right: 10px; } .car-nav:disabled { opacity: 0; pointer-events: none; }
.car-count { position: absolute; top: 10px; right: 10px; background: rgba(30,58,74,.75); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.car-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.car-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer; box-shadow: 0 0 0 1px rgba(30,58,74,.2); }
.car-dots i.on { background: var(--accent); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@media (max-width: 800px) { .drawer { width: 100%; animation: rise 200ms cubic-bezier(.2,.7,.2,1); } .drawer header { padding: 16px 18px; } .drawer .body { padding: 18px 18px 32px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───── Leads: list + detail panel ───── */
.lm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }
.lm.open { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 18px; }
.lm-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lead-row { background: var(--card); border: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 10px; padding: 12px 16px; cursor: pointer; transition: background var(--ease), border-color var(--ease), box-shadow var(--ease); }
.lead-row:hover { background: var(--tint-1); border-color: var(--line-strong); border-left-color: var(--line-strong); }
.lead-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lead-row.sel { background: var(--tint-2); border-color: var(--accent); border-left-color: var(--accent); }
.lr-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lr-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-contact, .lr-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; color: var(--text); margin-top: 3px; min-width: 0; }
.lr-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lr-meta { color: var(--label); font-size: 12.5px; }
.lstat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.lstat::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-new { background: var(--tint-2); color: var(--link); }
.st-contacted { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1px var(--accent); }
.st-booked { background: var(--accent); color: #fff; }
.st-won { background: var(--navy); color: #fff; }
html[data-theme="dark"] .st-won { background: #2c6a8d; }
.st-lost { background: transparent; color: var(--label); box-shadow: inset 0 0 0 1px var(--line-strong); }
.lm-detail { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; background: var(--tint-1); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; min-width: 0; }
.lm-detail.lm-in { animation: lmslide 220ms cubic-bezier(.2,.7,.2,1); }
@keyframes lmslide { from { opacity: 0; transform: translateX(28px); } }
.ld-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ld-head h3 { font-size: 19px; overflow-wrap: anywhere; }
.ld-sub { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.ld-head .x { border: 0; background: var(--card); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; flex: none; box-shadow: 0 0 0 1px var(--line); }
.ld-head .x:hover { background: var(--tint-2); }
.ld-list { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px 14px; font-size: 14px; }
.ld-list dt { color: var(--label); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; padding-top: 3px; }
.ld-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ld-text { white-space: pre-wrap; }
.ld-notes { min-height: 110px; }
.ld-save { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.ld-extra { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.ld-extra .label { margin-bottom: 12px; }
@media (max-width: 767px) {
  .lm.open { grid-template-columns: minmax(0, 1fr); }
  .lm-detail { position: fixed; inset: 0; z-index: 80; max-height: none; border-radius: 0; border: 0; background: var(--card); padding: 18px 18px 40px; }
  .lm-detail.lm-in { animation-name: lmup; }
  .ld-list { grid-template-columns: 90px minmax(0, 1fr); }
}
@keyframes lmup { from { opacity: 0; transform: translateY(24px); } }

.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .kpis.three { grid-template-columns: minmax(0, 1fr); } }

/* Single calendar range picker (Ads tab) */
.rp { position: relative; display: inline-block; margin: 0 0 16px; }
.rp-display { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; padding: 9px 14px; border-radius: var(--radius-sm); background: var(--card); color: var(--text); border: 1px solid var(--line-strong); font: 600 14px 'Inter', sans-serif; box-shadow: var(--shadow); }
.rp-display:hover { border-color: var(--accent); }
.rp-display:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-display svg { color: var(--label); flex: none; }
.rp-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; width: 304px; max-width: calc(100vw - 32px); box-sizing: border-box; background: var(--card); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 18px 44px -14px rgba(0,0,0,.35); padding: 14px; }
.rp-pop[hidden] { display: none; }
.rp-sel { font: 700 15px 'Plus Jakarta Sans', 'Inter', sans-serif; text-align: center; padding: 2px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.rp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.rp-arrow { all: unset; box-sizing: border-box; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; font-size: 20px; line-height: 1; color: var(--text); }
.rp-arrow:hover:not(:disabled), .rp-arrow:focus-visible { background: var(--tint-2); outline: none; }
.rp-arrow:disabled { opacity: .3; cursor: default; }
.rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.rp-wd { text-align: center; font: 600 11px 'Inter', sans-serif; color: var(--label); padding: 4px 0 6px; }
.rp-day { all: unset; box-sizing: border-box; height: 36px; display: grid; place-items: center; cursor: pointer; font: 500 13.5px 'Inter', sans-serif; color: var(--text); border-radius: 0; position: relative; }
.rp-day:hover:not(:disabled):not(.start):not(.end) { background: var(--tint-2); border-radius: 8px; }
.rp-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.rp-day:disabled { opacity: .3; cursor: default; }
.rp-day.today { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.rp-day.in { background: var(--tint-2); }
.rp-day.start, .rp-day.end { background: var(--accent); color: #fff; font-weight: 700; }
.rp-day.start { border-radius: 8px 0 0 8px; }
.rp-day.end { border-radius: 0 8px 8px 0; }
.rp-day.solo { border-radius: 8px; }
.rp-day.start.end { border-radius: 8px; }
.rp.inline { margin: 0; }
.rp-clear { all: unset; box-sizing: border-box; display: block; width: 100%; text-align: center; margin-top: 10px; padding: 9px; border-radius: 8px; cursor: pointer; font: 600 13px 'Inter', sans-serif; color: var(--link); border-top: 1px solid var(--line); }
.rp-clear:hover, .rp-clear:focus-visible { background: var(--tint-2); outline: none; }

/* Organic tab */
.kpi .value.na { font: 600 15px 'Inter', sans-serif; color: var(--label); letter-spacing: 0; margin-top: 12px; line-height: 1.3; }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 1000px) { .four-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .four-cols { grid-template-columns: minmax(0, 1fr); } }
.org-bars { display: grid; gap: 10px; margin-top: 8px; }
.org-bar .ob-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 4px; }
.org-bar .ob-top span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ob-track { height: 8px; border-radius: 99px; background: var(--tint-2); overflow: hidden; }
.ob-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.tip { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; border: 1px solid var(--label); color: var(--label); font: 700 10px 'Inter', sans-serif; cursor: help; text-transform: none; vertical-align: 1px; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; z-index: 70; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: 240px; padding: 10px 12px; border-radius: 8px; background: var(--navy); color: #fff; font: 500 12.5px/1.4 'Inter', sans-serif; text-transform: none; letter-spacing: 0; text-align: left; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); }
.tip:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font: 500 12px 'Inter', sans-serif; color: var(--label); text-align: center; }
.kpis.five .kpi .value { font-size: 26px; }
.kpis.five .kpi .label { min-height: 2.6em; }

/* Ads tab drill-down: the ads inside a campaign */
.adx-row { cursor: pointer; }
.adx-row:hover { background: var(--tint-1); }
.adx-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.adx-arrow { display: inline-block; width: 1em; color: var(--label); }
.adx-detail > td { background: var(--tint-1); padding: 14px 16px !important; }
.adx-head { margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adx-ad { display: flex; gap: 14px; padding: 14px; margin-bottom: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.adx-thumb { flex: none; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--tint-2); display: grid; place-items: center; }
.adx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.adx-nothumb { font: 500 11px 'Inter', sans-serif; color: var(--label); text-align: center; padding: 4px; }
.adx-main { min-width: 0; flex: 1; }
.adx-top { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 2px; }
.adx-reason { font-size: 13px; color: var(--danger); margin: 2px 0; }
.adx-creative { display: grid; gap: 4px; margin: 8px 0; font-size: 13.5px; }
.adx-creative .label { display: inline; margin-right: 4px; }
.adx-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.adx-na { color: var(--label); font-style: italic; }
.adx-nodel { margin: 8px 0; color: var(--label); font-size: 13.5px; }
.adx-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px 14px; margin-top: 8px; }
.adx-m .label { font-size: 10.5px; }
.adx-v { font: 700 15px 'Plus Jakarta Sans', 'Inter', sans-serif; margin-top: 2px; }
.adx-bdwrap { margin-top: 10px; }
.adx-bd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 10px; }
@media (max-width: 800px) { .adx-bd-grid { grid-template-columns: minmax(0, 1fr); } .adx-ad { flex-direction: column; } }
.adx-bdrow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; border-top: 1px solid var(--line); }

/* ───── Leads tab (team view only): source buttons, compact table, colored chips, pager ───── */
.tl-main { min-width: 0; }
.tl-srcs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.tl-src { appearance: none; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; font: 600 13px 'Inter', sans-serif; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.tl-src .n { font-weight: 700; color: var(--label); }
.tl-src:hover { background: var(--tint-1); }
.tl-src:focus-visible, .tl-h:focus-visible, .tl-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl-src[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tl-src[aria-pressed="true"] .n { color: #fff; }
.tl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tl { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14px; }
.tl th { text-align: left; padding: 10px 14px; background: var(--tint-1); white-space: nowrap; }
.tl-h { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--label); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tl-h:hover { color: var(--text); }
.tl-arrow { font-size: 9px; min-width: 9px; }
.tl td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tl-date { white-space: nowrap; color: var(--label); }
.tl-name { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row { cursor: pointer; }
.tl-row:hover { background: var(--tint-1); }
.tl-row.sel { background: var(--tint-2); }
.tl-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.tl-pgbtns { display: inline-flex; gap: 10px; align-items: center; }
.tl-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tl-src-meta { background: rgba(74, 144, 184, .18); color: #1f6a96; }
.tl-src-sheet { background: rgba(46, 160, 110, .18); color: #1c7a4f; }
.tl-src-callrail { background: rgba(235, 140, 40, .2); color: #a35a05; }
.tl-src-chat { background: rgba(130, 90, 200, .18); color: #6a43b0; }
.tl-src-manual { background: rgba(120, 130, 140, .2); color: #55616b; }
.tl-st-new { background: rgba(90, 120, 150, .18); color: #3f5d7a; }
.tl-st-contacted { background: rgba(230, 170, 30, .22); color: #8a6200; }
.tl-st-booked { background: rgba(30, 170, 160, .2); color: #0d746c; }
.tl-st-won { background: #1f9d63; color: #fff; }
.tl-st-lost { background: rgba(215, 80, 80, .16); color: #b03a3a; }
html[data-theme="dark"] .tl-src-meta { color: #8cc4e6; }
html[data-theme="dark"] .tl-src-sheet { color: #7fd1a8; }
html[data-theme="dark"] .tl-src-callrail { color: #f2b36a; }
html[data-theme="dark"] .tl-src-chat { color: #c1a6ee; }
html[data-theme="dark"] .tl-src-manual { color: #b4bec6; }
html[data-theme="dark"] .tl-st-new { color: #a9c3dc; }
html[data-theme="dark"] .tl-st-contacted { color: #f0c866; }
html[data-theme="dark"] .tl-st-booked { color: #7fd8d0; }
html[data-theme="dark"] .tl-st-lost { color: #f19a9a; }
@media (max-width: 560px) { .tl-name { max-width: 140px; } .tl-pager { justify-content: center; } }

/* Client top posts by reach: one compact row per post (rank, small thumbnail, caption and date, reach). Lives here because the portal loads styles.css only. */
.rk { display: grid; grid-template-columns: 28px 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.rk:first-of-type { border-top: 0; }
.rk-n { width: 26px; height: 26px; border-radius: 50%; background: var(--tint-2); color: var(--text); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.rk-img { width: 56px; height: 56px; max-width: 56px; max-height: 56px; border-radius: 10px; object-fit: cover; background: var(--tint-2); display: block; overflow: hidden; }
.rk-ph { display: grid; place-items: center; color: var(--label); }
.rk-main { min-width: 0; }
.rk-cap { font-size: 14px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.rk-date { font-size: 12px; color: var(--label); margin-top: 2px; }
.rk-reach { text-align: right; white-space: nowrap; font-size: 13px; color: var(--label); }
.rk-reach b { display: block; font-size: 16px; color: var(--text); }
@media (max-width: 600px) {
  .rk { grid-template-columns: 26px 48px minmax(0, 1fr); gap: 10px; }
  .rk-img { width: 48px; height: 48px; max-width: 48px; max-height: 48px; }
  .rk-reach { grid-column: 3; text-align: left; }
  .rk-reach b { display: inline; margin-right: 4px; }
}

/* Client portal content calendar. Same markup as the team calendar with every class prefixed pcal / pcs, so team CSS (shell.css) can never touch it. */
.pseg { display: inline-flex; background: var(--tint-1); border-radius: 9px; padding: 3px; gap: 2px; }
.pseg button { border: 0; background: transparent; color: var(--label); font: 600 12.5px 'Inter', sans-serif; padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.pseg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.pcal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pcal-title { font: 700 17px 'Plus Jakarta Sans', sans-serif; min-width: 150px; text-align: center; }
.pcal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); gap: 1px; }
.pcal-wd { background: var(--tint-1); color: var(--label); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: center; padding: 8px 0; }
.pcal-day { all: unset; box-sizing: border-box; background: var(--card); min-height: 92px; padding: 6px 7px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pcal-day:hover { background: var(--tint-1); }
.pcal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pcal-day.dim { background: var(--tint-1); }
.pcal-day.dim .pcal-n { color: var(--label); opacity: .6; }
.pcal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.pcal-n { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.pcal-day.today .pcal-n { background: var(--accent); color: #fff; }
.pcal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pcal-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcal-more { font-size: 11px; color: var(--link); font-weight: 600; }
.pcs-draft { background: #7d93a5; color: #fff; }
.pcs-review { background: #c98a1b; color: #fff; }
.pcs-approved { background: #2f9a60; color: #fff; }
.pcs-published { background: var(--navy); color: #fff; }
html[data-theme="dark"] .pcs-published { background: #2b5a76; }
.pcal .pi { display: block; flex: none; }
.pcal .pi-t { font-size: 10px; font-weight: 800; }
.pcal-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.pcal-detail { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.pcal-dh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pcal-ih { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pcal-plats { display: inline-flex; gap: 4px; }
.pcal-ab { display: inline-flex; align-items: center; gap: 5px; background: var(--tint-2); color: var(--text); border-radius: 8px; padding: 3px 8px 3px 6px; font-size: 12px; font-weight: 600; }
.pcal-ab .pi { color: var(--text); }
.pcal-st { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.pcal-cap { margin: 4px 0; font-size: 14px; overflow-wrap: anywhere; }
.pcal-img { float: left; width: 56px; height: 56px; max-width: 56px; max-height: 56px; object-fit: cover; border-radius: 10px; margin: 4px 12px 4px 0; background: var(--tint-2); }
.pcal-go { display: block; clear: both; padding-top: 2px; color: var(--link); font-weight: 600; }
button.pcal-item { display: block; width: calc(100% + 24px); box-sizing: border-box; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; color: inherit; cursor: pointer; border-radius: 0; padding: 10px 12px; margin: 0 -12px; }
button.pcal-item:first-of-type { border-top: 0; }
button.pcal-item:hover { background: var(--tint-1); }
button.pcal-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pcal { min-width: 0; max-width: 100%; }
@media (max-width: 700px) {
  .pcal-day { min-height: 58px; padding: 4px; }
  .pcal-chips { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .pcal-day .pcal-chip { font-size: 0; width: 8px; height: 8px; min-height: 0; padding: 0; border-radius: 50%; }
  .pcal-day .pcal-chip svg, .pcal-day .pcal-chip .pi-t { display: none; }
  .pcal-more { font-size: 10px; }
  .pcal-title { min-width: 0; font-size: 15px; }
}

/* Ads section (Total, campaigns table and Platform filter, Meta and Google together). pga-* names are unique to this feature, and the portal gets them from this file only. */
.pga-wrap { min-width: 0; max-width: 100%; }
.pga { min-width: 0; max-width: 100%; }
.pga-na { color: var(--label); font-style: italic; font-weight: 500; font-size: .7em; }
.pga-note { line-height: 1.4; }
.pga-filter { margin: 0 0 14px; max-width: 100%; flex-wrap: wrap; }
tbody > tr[hidden] { display: none !important; }

/* Content list: every post in one place (team dashboard and client portal) */
.badge.info { background: var(--tint-1); color: var(--link); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cl-chip { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--label); cursor: pointer; }
.cl-chip.on { background: var(--link); border-color: var(--link); color: #fff; }
.cl-n { opacity: .75; font-weight: 600; margin-left: 4px; }
.cl-plat { font: inherit; font-size: 13px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--label); margin-left: auto; }
.cl-list { display: flex; flex-direction: column; gap: 8px; }
.cl-row { display: grid; grid-template-columns: 220px 1fr 120px; gap: 14px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.cl-row:hover, .cl-row:focus-visible { border-color: var(--line-strong); outline: none; }
.cl-top { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cl-rs { font-size: 11px; color: var(--label); }
.cl-pn { font-weight: 600; font-size: 13px; color: var(--label); }
.cl-cap { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.cl-when { text-align: right; font-size: 13px; }
@media (max-width: 640px) { .cl-row { grid-template-columns: 1fr; gap: 6px; } .cl-when { text-align: left; } select.cl-plat { margin-left: 0; } }
/* Content cards: the status label sits under the platforms, wraps inside the card, and never runs outside it */
.post.cl-card .top { flex-direction: column; align-items: flex-start; gap: 6px; }
.post.cl-card .badge { white-space: normal; max-width: 100%; text-align: left; }
.post.cl-card .plat { overflow-wrap: anywhere; }
.post.cl-card .cl-rs { color: var(--label); }

/* Wordmark (text, until a logo exists; see brand.js) */
.brand img { vertical-align: middle; }
.auth-logo .brand { display: block; margin: 0 auto 6px; font-size: 26px; letter-spacing: .01em; }
.badge.need { background: var(--accent); color: #fff; }
.cl-needs { color: var(--link); }
.upd { margin: 0 0 12px; font-size: 12px; color: var(--label); }

/* ───── Glass redesign ─────
   Same brand blues as above. The dark theme (now the default) becomes frosted glass over a slow, soft glow.
   Everything here is scoped to html[data-theme="dark"], except the motion helpers, which work in both themes. */
:root { --glass: rgba(15,31,45,.55); --glass-strong: rgba(15,31,45,.78); --glass-line: rgba(140,200,234,.14); --glow: rgba(74,144,184,.38); }
html[data-theme="dark"] body { background: #04070B; min-height: 100vh; }
html[data-theme="dark"] body::before { content: ''; position: fixed; top: -25%; right: -25%; bottom: -25%; left: -25%; z-index: -1; pointer-events: none; will-change: transform;
  background: radial-gradient(38% 34% at 18% 22%, rgba(74,144,184,.26), transparent 70%), radial-gradient(34% 30% at 82% 68%, rgba(30,58,74,.7), transparent 72%), radial-gradient(28% 26% at 62% 12%, rgba(27,74,102,.38), transparent 70%);
  animation: sp-drift 48s ease-in-out infinite alternate; }
@keyframes sp-drift { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(3%, 2.5%, 0) scale(1.08); } }
html[data-theme="dark"] .topbar { background: var(--glass-strong); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); border-bottom: 1px solid var(--glass-line); box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px -18px rgba(0,0,0,.9); }
html[data-theme="dark"] .card, html[data-theme="dark"] .kpi, html[data-theme="dark"] .ccard, html[data-theme="dark"] .pnav, html[data-theme="dark"] .sidebar, html[data-theme="dark"] .auth-card, html[data-theme="dark"] .pv-card, html[data-theme="dark"] .post {
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -18px rgba(0,0,0,.85);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
html[data-theme="dark"] .sidebar { border-width: 0 1px 0 0; border-radius: 0; box-shadow: none; }
html[data-theme="dark"] .kpi.primary { background: linear-gradient(135deg, rgba(27,74,102,.85), rgba(74,144,184,.38)); border-color: rgba(140,200,234,.35); box-shadow: 0 0 0 1px rgba(74,144,184,.2), 0 14px 40px -16px var(--glow); }
html[data-theme="dark"] .kpi.quiet { background: var(--quiet-bg); box-shadow: none; }
html[data-theme="dark"] .kpi .value { background: linear-gradient(180deg, #fff 30%, #BFDDF0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
html[data-theme="dark"] .kpi .value.na { background: none; -webkit-text-fill-color: var(--label); color: var(--label); }
html[data-theme="dark"] .modal, html[data-theme="dark"] .drawer, html[data-theme="dark"] .pop, html[data-theme="dark"] .pal { background: var(--glass-strong); border: 1px solid var(--glass-line); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); box-shadow: 0 30px 70px -24px rgba(0,0,0,.95), 0 0 0 1px rgba(74,144,184,.08); }
html[data-theme="dark"] .drawer header { background: transparent; border-bottom-color: var(--glass-line); }
html[data-theme="dark"] .modal-bg, html[data-theme="dark"] .drawer-bg, html[data-theme="dark"] .pal-bg { background: rgba(2,4,8,.62); }
html[data-theme="dark"] .btn { background: linear-gradient(180deg, #5aa0c6, var(--accent)); box-shadow: 0 6px 18px -8px var(--glow), 0 1px 0 rgba(255,255,255,.18) inset; }
html[data-theme="dark"] .btn:hover { background: linear-gradient(180deg, #67aad0, #4a90b8); box-shadow: 0 8px 24px -8px rgba(74,144,184,.7); }
html[data-theme="dark"] .btn.ghost { background: rgba(255,255,255,.03); box-shadow: none; border-color: var(--glass-line); }
html[data-theme="dark"] .btn.ghost:hover { background: rgba(74,144,184,.14); border-color: rgba(140,200,234,.4); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: rgba(10,22,33,.6); border-color: var(--glass-line); }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { border-color: rgba(140,200,234,.6); box-shadow: 0 0 0 3px rgba(74,144,184,.22); outline: 0; }
html[data-theme="dark"] tbody tr:hover { background: rgba(74,144,184,.08); }
html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: rgba(140,200,234,.1); }
html[data-theme="dark"] .badge { background: rgba(74,144,184,.16); box-shadow: inset 0 0 0 1px rgba(140,200,234,.18); }
html[data-theme="dark"] .badge.need { background: var(--accent); box-shadow: 0 0 14px -2px var(--glow); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2 { letter-spacing: -.02em; }
html[data-theme="dark"] .skel { background: linear-gradient(90deg, rgba(74,144,184,.07) 25%, rgba(140,200,234,.16) 50%, rgba(74,144,184,.07) 75%); background-size: 200% 100%; }
/* tabs and side navigation: a glowing active indicator */
html[data-theme="dark"] .tabs { border-bottom-color: var(--glass-line); }
.tab { position: relative; }
.tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: center; transition: transform 260ms cubic-bezier(.2,.7,.2,1); }
.tab.active { border-bottom-color: transparent; }
.tab.active::after { transform: scaleX(1); }
html[data-theme="dark"] .tab.active::after { background: linear-gradient(90deg, transparent, #8CC8EA, transparent); height: 3px; box-shadow: 0 0 14px 1px rgba(74,144,184,.9), 0 4px 18px rgba(74,144,184,.45); }
html[data-theme="dark"] .pnav button.on, html[data-theme="dark"] .tb-nav button.on, html[data-theme="dark"] .nav-item.active { background: linear-gradient(90deg, rgba(74,144,184,.26), rgba(74,144,184,.06)); box-shadow: inset 2px 0 0 #8CC8EA, 0 0 22px -8px var(--glow); color: #fff; }
/* soft hover lift (both themes; skipped on touch screens, where hover sticks) */
@media (hover: hover) {
  .kpi, .ccard, .post, .pv-card { transition: transform 220ms cubic-bezier(.2,.7,.2,1), box-shadow 220ms, border-color 220ms; }
  .kpi:hover, .ccard:hover, .post:hover { transform: translateY(-3px); }
  html[data-theme="dark"] .kpi:hover, html[data-theme="dark"] .ccard:hover, html[data-theme="dark"] .post:hover { border-color: rgba(140,200,234,.32); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px -16px rgba(0,0,0,.9), 0 0 28px -10px var(--glow); }
}
/* motion helpers: tab content slides in, charts draw in, numbers count up */
@keyframes sp-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sp-enter { animation: sp-in 320ms cubic-bezier(.2,.7,.2,1) both; }
@keyframes sp-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ob-fill { transform-origin: left center; animation: sp-draw 900ms cubic-bezier(.2,.7,.2,1) both; }
html[data-theme="dark"] .ob-fill { box-shadow: 0 0 12px -2px var(--glow); }
/* 375 px: nothing may push the page sideways, and tap targets stay large */
@media (max-width: 520px) {
  html[data-theme="dark"] .card, html[data-theme="dark"] .kpi, html[data-theme="dark"] .ccard, html[data-theme="dark"] .topbar, html[data-theme="dark"] .modal, html[data-theme="dark"] .drawer { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  html, body { overflow-x: hidden; }
  .crumbs .switch select { min-width: 0; }
  .tab { padding: 14px 4px; }
  .btn, .tb-nav button, .pnav button, .icon-btn { min-height: 44px; }
  .tabs { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] body::before { animation: none; }
  .sp-enter, .ob-fill { animation: none; }
  .kpi, .ccard, .post { transition: none; }
  .kpi:hover, .ccard:hover, .post:hover { transform: none; }
}
html[data-motion="reduced"] body::before, html[data-motion="reduced"] .sp-enter, html[data-motion="reduced"] .ob-fill { animation: none !important; }
html[data-theme="dark"] .cl-chip, html[data-theme="dark"] .cl-plat, html[data-theme="dark"] .cl-row { background: rgba(255,255,255,.04); border-color: var(--glass-line); color: var(--label); }
html[data-theme="dark"] .cl-row { color: var(--text); }
html[data-theme="dark"] .cl-chip:hover { border-color: rgba(140,200,234,.45); color: var(--text); }
html[data-theme="dark"] .cl-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 16px -4px var(--glow); }

/* ───── Glass redesign, light version ─────
   Same layout, spacing and motion as the dark glass. White and soft grey surfaces, the same brand blues. */
html[data-theme="light"] { --glass: rgba(255,255,255,.68); --glass-strong: rgba(255,255,255,.86); --glass-line: rgba(30,58,74,.10); --glow: rgba(74,144,184,.34); --topbar-bg: rgba(255,255,255,.8); --shadow: 0 1px 2px rgba(30,58,74,.05), 0 12px 30px -18px rgba(30,58,74,.3); --line: rgba(30,58,74,.09); --line-strong: rgba(30,58,74,.16); }
html[data-theme="light"] body { background: #EDF3F8; min-height: 100vh; }
html[data-theme="light"] body::before { content: ''; position: fixed; top: -25%; right: -25%; bottom: -25%; left: -25%; z-index: -1; pointer-events: none; will-change: transform;
  background: radial-gradient(38% 34% at 18% 20%, rgba(74,144,184,.2), transparent 70%), radial-gradient(34% 30% at 84% 70%, rgba(214,228,240,.95), transparent 72%), radial-gradient(28% 26% at 62% 10%, rgba(140,200,234,.22), transparent 70%);
  animation: sp-drift 48s ease-in-out infinite alternate; }
html[data-theme="light"] .topbar { background: var(--glass-strong); color: var(--text); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border-bottom: 1px solid var(--glass-line); box-shadow: 0 10px 30px -22px rgba(30,58,74,.45); }
html[data-theme="light"] .topbar :focus-visible { outline-color: var(--accent); }
html[data-theme="light"] .brand span { color: var(--link); }
html[data-theme="light"] .chip { background: rgba(30,58,74,.06); }
html[data-theme="light"] .btn.light { background: rgba(30,58,74,.07); color: var(--text); }
html[data-theme="light"] .btn.light:hover { background: rgba(30,58,74,.13); }
html[data-theme="light"] .icon-btn:hover, html[data-theme="light"] .me-btn:hover { background: rgba(30,58,74,.07); }
html[data-theme="light"] .tb-search { background: rgba(30,58,74,.05); color: var(--label); box-shadow: inset 0 0 0 1px var(--glass-line); }
html[data-theme="light"] .tb-search:hover { background: rgba(30,58,74,.09); }
html[data-theme="light"] kbd { background: rgba(30,58,74,.08); }
html[data-theme="light"] .tb-nav button { color: var(--label); }
html[data-theme="light"] .tb-nav button:hover { background: rgba(30,58,74,.06); color: var(--text); }
html[data-theme="light"] .tb-nav button.on { background: linear-gradient(90deg, rgba(74,144,184,.2), rgba(74,144,184,.05)); box-shadow: inset 2px 0 0 var(--accent), 0 0 22px -10px var(--glow); color: var(--text); }
html[data-theme="light"] .tb-nav button:focus-visible { outline-color: var(--accent); }
html[data-theme="light"] .card, html[data-theme="light"] .kpi, html[data-theme="light"] .ccard, html[data-theme="light"] .pnav, html[data-theme="light"] .sidebar, html[data-theme="light"] .auth-card, html[data-theme="light"] .pv-card, html[data-theme="light"] .post {
  background: var(--glass); border: 1px solid var(--glass-line); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, var(--shadow);
  backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); }
html[data-theme="light"] .sidebar { border-width: 0 1px 0 0; border-radius: 0; box-shadow: none; }
html[data-theme="light"] .kpi.primary { background: linear-gradient(135deg, #1E3A4A, #2F6585); border-color: rgba(30,58,74,.35); color: #fff; box-shadow: 0 14px 34px -16px rgba(30,58,74,.6); }
html[data-theme="light"] .kpi.primary .label, html[data-theme="light"] .kpi.primary .note { color: #C4E0F2; }
html[data-theme="light"] .kpi.quiet { background: var(--quiet-bg); box-shadow: none; }
html[data-theme="light"] .modal, html[data-theme="light"] .drawer, html[data-theme="light"] .pop, html[data-theme="light"] .pal { background: var(--glass-strong); border: 1px solid var(--glass-line); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 30px 70px -26px rgba(30,58,74,.5); }
html[data-theme="light"] .drawer header { background: transparent; border-bottom-color: var(--glass-line); }
html[data-theme="light"] .modal-bg, html[data-theme="light"] .drawer-bg, html[data-theme="light"] .pal-bg { background: rgba(30,58,74,.34); }
html[data-theme="light"] .btn { box-shadow: 0 6px 16px -8px var(--glow); }
html[data-theme="light"] .btn.ghost { background: rgba(255,255,255,.6); box-shadow: none; border-color: var(--line-strong); }
html[data-theme="light"] .btn.ghost:hover { background: rgba(74,144,184,.1); border-color: var(--accent); }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { background: rgba(255,255,255,.8); border-color: var(--line-strong); }
html[data-theme="light"] input:focus, html[data-theme="light"] select:focus, html[data-theme="light"] textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,184,.2); outline: 0; }
html[data-theme="light"] tbody tr:hover { background: rgba(74,144,184,.07); }
html[data-theme="light"] th, html[data-theme="light"] td { border-color: rgba(30,58,74,.08); }
html[data-theme="light"] .badge.need { box-shadow: 0 0 14px -3px var(--glow); }
html[data-theme="light"] .skel { background: linear-gradient(90deg, rgba(30,58,74,.06) 25%, rgba(74,144,184,.15) 50%, rgba(30,58,74,.06) 75%); background-size: 200% 100%; }
html[data-theme="light"] .tabs { border-bottom-color: var(--glass-line); }
html[data-theme="light"] .tab.active::after { background: linear-gradient(90deg, transparent, var(--accent), transparent); height: 3px; box-shadow: 0 0 12px 1px rgba(74,144,184,.55), 0 4px 16px rgba(74,144,184,.3); }
html[data-theme="light"] .pnav button.on, html[data-theme="light"] .nav-item.active { background: linear-gradient(90deg, rgba(74,144,184,.2), rgba(74,144,184,.04)); box-shadow: inset 2px 0 0 var(--accent), 0 0 22px -10px var(--glow); color: var(--text); }
html[data-theme="light"] .ob-fill { box-shadow: 0 0 10px -2px var(--glow); }
@media (hover: hover) {
  html[data-theme="light"] .kpi:hover, html[data-theme="light"] .ccard:hover, html[data-theme="light"] .post:hover { border-color: rgba(74,144,184,.45); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 38px -16px rgba(30,58,74,.35), 0 0 26px -12px var(--glow); }
}
@media (max-width: 520px) {
  html[data-theme="light"] .card, html[data-theme="light"] .kpi, html[data-theme="light"] .ccard, html[data-theme="light"] .topbar, html[data-theme="light"] .modal, html[data-theme="light"] .drawer { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}
@media (prefers-reduced-motion: reduce) { html[data-theme="light"] body::before { animation: none; } }
html[data-motion="reduced"][data-theme="light"] body::before { animation: none !important; }

/* Contrast pass: labels a little darker in light, small badges and buttons on the darker steel blue so white text stays readable */
html[data-theme="light"] { --label: #4A6B84; }
.notif-dot, .tb-nav .cnt, .me-av, .badge.need, .cl-chip.on { background: var(--accent-dark); color: #fff; }
.cl-n { opacity: .9; }
html[data-theme="dark"] .btn, html[data-theme="light"] .btn { background: linear-gradient(180deg, #4A90B8, #3a7aa0); }
html[data-theme="dark"] .btn:hover, html[data-theme="light"] .btn:hover { background: linear-gradient(180deg, #5299c0, #4286ae); }
html[data-theme="dark"] .btn.ghost, html[data-theme="light"] .btn.ghost, html[data-theme="dark"] .btn.light, html[data-theme="light"] .btn.light { background-image: none; }
html[data-theme="dark"] .cl-chip.on { background: var(--accent-dark); }
.tl-src[aria-pressed="true"] { background: var(--accent-dark); border-color: var(--accent-dark); }
html[data-theme="dark"] .btn.light { background: rgba(255,255,255,.12); }
html[data-theme] .notif-dot, html[data-theme] .tb-nav .cnt, html[data-theme] .me-av, html[data-theme] .badge.need, html[data-theme] .cl-chip.on, html[data-theme] .fchip.on, html[data-theme] .nav-item.active .ico-wrap, html[data-theme] .tl-src[aria-pressed="true"] { background: var(--accent-dark); color: #fff; }
html[data-theme="light"] { --link: #2F6585; }
.rp-all { all: unset; box-sizing: border-box; cursor: pointer; margin-left: 8px; padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--label); font: 600 13px 'Inter', sans-serif; vertical-align: top; }
.rp-all:hover { border-color: var(--accent); color: var(--text); }
.rp-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-all.on { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
@media (max-width: 520px) { .rp-all { min-height: 44px; } }
.pga-sf { width: auto; min-width: 0; font-size: 13px; padding: 5px 26px 5px 10px; border-radius: 10px; }
.pga-scope { line-height: 1.4; }

/* Batch 2: change vs the previous period, KPI target badges, hints, Needs attention */
:root { --up: #1E8A5A; --down: #C0392B; --up-bg: #E6F4EC; --down-bg: #FBEAE8; }
html[data-theme="dark"] { --up: #5CCB93; --down: #F08A80; --up-bg: rgba(92,203,147,.14); --down-bg: rgba(240,138,128,.14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --up: #5CCB93; --down: #F08A80; --up-bg: rgba(92,203,147,.14); --down-bg: rgba(240,138,128,.14); } }
.org-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.org-chg, .org-kpi { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font: 700 11.5px/1.4 'Inter', sans-serif; white-space: nowrap; cursor: default; }
.org-chg.up { color: var(--up); background: var(--up-bg); }
.org-chg.down { color: var(--down); background: var(--down-bg); }
.org-chg.na, .org-kpi.na { color: var(--label); background: var(--tint-1); box-shadow: inset 0 0 0 1px var(--line); }
.org-kpi.ok { color: var(--up); background: var(--up-bg); box-shadow: inset 0 0 0 1px currentColor; }
.org-kpi.bad { color: var(--down); background: var(--down-bg); box-shadow: inset 0 0 0 1px currentColor; }
.kpi.primary .org-chg, .kpi.primary .org-kpi { background: rgba(255,255,255,.92); }
.kpi.primary .org-chg.na, .kpi.primary .org-kpi.na { color: #5B7F9A; }
.ti { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 4px; border-radius: 50%; border: 1px solid currentColor; opacity: .75; font: 700 10px 'Inter', sans-serif; cursor: help; text-transform: none; vertical-align: 1px; }
.ti:hover::after, .ti:focus::after { content: attr(data-hint); position: absolute; z-index: 70; left: 0; top: calc(100% + 8px); width: 240px; max-width: 70vw; padding: 10px 12px; border-radius: 8px; background: var(--navy, #1E3A4A); color: #fff; font: 500 12.5px/1.4 'Inter', sans-serif; text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); }
.cl-chip svg, .cl-flag svg { vertical-align: -2px; }
.cl-chip.cl-attn { display: inline-flex; align-items: center; gap: 6px; }
.cl-flag { display: inline-flex; color: var(--down); margin-left: auto; margin-right: 6px; }

/* Review fixes: opaque tooltips, scroll hints, small spacing */
.ti { opacity: 1; border-color: color-mix(in srgb, currentColor 70%, transparent); } /* the dimming moved off the whole icon, so the tooltip it opens is fully opaque */
.ti:hover::after, .ti:focus::after { background: #1E3A4A; color: #fff; opacity: 1; }
#ads-body { margin-top: 12px; }
.sh-r:not(.sh-l) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.sh-l:not(.sh-r) { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); }
.sh-l.sh-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); }

/* ── Glance band: Month at a glance strip above the main content ── */
.glance-band { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 14px 0; margin: 14px 0 6px; }
.gb-tile { display: flex; flex-direction: column; gap: 6px; flex: 1 1 150px; min-width: 0; padding: 0 20px; border-right: 1px solid var(--line); }
.gb-tile:first-child { padding-left: 0; }
.gb-tile:last-child { border-right: none; padding-right: 0; }
.gb-label { font: 600 11px/1.2 'Inter', sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--label); }
.gb-value { font: 700 22px/1.2 'Plus Jakarta Sans', sans-serif; color: var(--text); display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.gb-chg { font: 600 11px/1 'Inter', sans-serif; padding: 3px 7px; border-radius: 10px; white-space: nowrap; }
.gb-chg.up { background: var(--up-bg, #E6F4EC); color: var(--up, #1E8A5A); }
.gb-chg.dn { background: var(--down-bg, #FBEAE8); color: var(--down, #C0392B); }
.gb-chg.flat { background: var(--tint-2); color: var(--label); }
.gb-unit { font: 600 13px/1 'Inter', sans-serif; color: var(--label); }
.gb-post-row { display: flex; align-items: center; gap: 8px; }
.gb-post-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.gb-post-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; width: 100%; }
body > .glance-band { max-width: 1224px; width: calc(100% - 56px); margin: 16px auto 0; } /* the client portal: lines up with its page content */
@media (max-width: 640px) {
  .glance-band, body > .glance-band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; padding: 14px 16px; }
  body > .glance-band { width: calc(100% - 32px); margin-top: 12px; }
  .gb-tile, .gb-tile:first-child, .gb-tile:last-child { padding: 0; border-right: none; flex: none; }
  .gb-value { font-size: 20px; }
}

@media (max-width: 640px) {
  .kpi, .table-wrap { position: relative; }
  .ti { position: static; }
  .ti:hover::after, .ti:focus::after { left: 12px; right: 12px; top: auto; width: auto; max-width: none; margin-top: 8px; } /* inside the card, under the label */
  table.stack td[data-label]::before { min-width: 140px; margin-right: 12px; }
}

/* Chip explanations (the % change chips): hover and keyboard focus show the text, a tap toggles it (script at the end of common.js) */
.chip-tip { position: relative; cursor: help; }
.chip-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-tip::after { content: attr(data-hint); display: none; position: absolute; z-index: 80; left: var(--tip-dx, 0px); top: calc(100% + 8px); width: var(--tip-w, 240px); padding: 10px 12px; border-radius: 8px; background: #1E3A4A; color: #fff; border: 1px solid rgba(255,255,255,.16); font: 500 12.5px/1.4 'Inter', sans-serif; text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); pointer-events: none; }
.chip-tip.chip-tip-open::after, .chip-tip:focus-visible::after { display: block; }
@media (hover: hover) { .chip-tip:hover::after { display: block; } }
/* the card holding an open explanation is lifted above its neighbours so the box is never hidden behind them */
.kpi:has(.chip-tip.chip-tip-open), .kpi:has(.chip-tip:focus-visible), .card:has(.chip-tip.chip-tip-open), .card:has(.chip-tip:focus-visible) { position: relative; z-index: 60; }
@media (hover: hover) { .kpi:has(.chip-tip:hover), .card:has(.chip-tip:hover) { position: relative; z-index: 60; } }
/* Client Overview: Contact, Account and Lead source in one row on wide screens, stacked on narrower ones */
.cards3 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, .8fr); } /* Contact and Account hold more, so they are wider than Lead source */
@media (max-width: 1100px) { .cards3 { grid-template-columns: minmax(0, 1fr); } }

/* Ads tab: cost per lead by month (3 tiles) */
.fcm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fcm-tile { padding: 18px 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.fcm-tile .label { font: 600 11px/1.2 'Inter', sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.fcm-value { font: 800 30px/1.15 'Plus Jakarta Sans', sans-serif; color: var(--text); min-height: 1.15em; }
.fcm-sub { color: var(--label); font-size: 12.5px; }
.fcm-low { font: 600 11.5px/1.3 'Inter', sans-serif; color: var(--label); background: var(--tint-2); border-radius: 6px; padding: 3px 8px; }
[data-fcm]:empty { display: none; }
@media (max-width: 640px) { .fcm-tiles { grid-template-columns: minmax(0, 1fr); } .fcm-value { font-size: 28px; } }

/* Explanations are shown by the page level popover (end of common.js), never by a pseudo element inside the card, so nothing can cover or clip them. */
.ti::after, .chip-tip::after { display: none !important; content: none !important; }
#sp-pop { position: fixed; z-index: 3000; left: 0; top: 0; padding: 10px 12px; border-radius: 8px; background: #1E3A4A; color: #fff; border: 1px solid rgba(255,255,255,.16); font: 500 12.5px/1.4 'Inter', sans-serif; text-align: left; text-transform: none; letter-spacing: 0; white-space: normal; box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); pointer-events: none; }
#sp-pop[hidden] { display: none; }
/* Analytics: long date ranges (quick ranges in the picker, the wait card) */
.rp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.rp-preset { border: 1px solid var(--line, rgba(30,58,74,.18)); background: transparent; color: inherit; border-radius: 999px; padding: 6px 12px; font: 600 12.5px/1 'Inter', sans-serif; cursor: pointer; }
.rp-preset:hover, .rp-preset:focus-visible { border-color: #4A90B8; }
.rp-preset.on { background: #4A90B8; border-color: #4A90B8; color: #fff; }
.ol-track { height: 8px; border-radius: 999px; background: rgba(74,144,184,.18); overflow: hidden; }
.ol-fill { height: 100%; background: #4A90B8; border-radius: 999px; transition: width .3s ease; }

/* Ads tab: slimmer Total card and month tiles (same information, less height) */
.pga-total { padding: 16px 20px; }
.pga-total .card-head { margin-bottom: 10px; }
.pga-total .pga-scope, .pga-total .pga-note { margin-bottom: 8px !important; }
.pga-total .grid { gap: 12px; }
.pga-total .kpi { padding: 12px 16px; }
.pga-total .kpi .label { margin: 0; }
.pga-total .kpi .value, .pga-total .kpi.primary .value { font-size: 26px; margin-top: 2px; }
.pga-total .kpi .note { margin-top: 2px; font-size: 12px; line-height: 1.3; }
.fcm { padding: 16px 20px; }
.fcm .card-head { margin-bottom: 10px; }
.fcm-tiles { gap: 12px; }
.fcm-tile { padding: 12px 16px; gap: 4px; }
.fcm-tile .label { font-size: 10.5px; }
.fcm-value { font-size: 24px; line-height: 1.1; }
.fcm-sub { font-size: 12px; line-height: 1.3; }
.fcm-low { font-size: 11px; padding: 2px 7px; }
.fcm .pga-note { margin: 8px 0 0 !important; font-size: 12px; }
@media (max-width: 800px) { .pga-total .grid.kpis.three { grid-template-columns: minmax(0, 1fr); gap: 8px; } .pga-total .kpi { padding: 10px 14px; } .pga-total .kpi .value, .pga-total .kpi.primary .value { font-size: 22px; } .fcm-tiles { gap: 8px; } .fcm-tile { padding: 10px 14px; } .fcm-value { font-size: 22px; } }

/* Compare with Meta and Compare with Google */
.modal.cmp { max-width: 920px; padding: 24px 28px; }
.cmp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cmp-top h2 { margin: 0; font-size: 21px; }
.cmp-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--label); padding: 0 4px; }
.cmp-intro { margin: 6px 0 14px; color: var(--label); font-size: 14px; line-height: 1.45; max-width: 640px; }
.cmp-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.cmp-seg button { border: 1px solid var(--line, rgba(30,58,74,.2)); background: transparent; color: inherit; border-radius: 999px; padding: 7px 14px; font: 600 13px/1 'Inter', sans-serif; cursor: pointer; }
.cmp-seg button.on { background: #4A90B8; border-color: #4A90B8; color: #fff; }
.cmp-sum { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line, rgba(30,58,74,.18)); margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.cmp-sum .cmp-ic { font-size: 18px; line-height: 1.3; }
.cmp-sum-x { color: var(--label); font-size: 13px; margin-top: 4px; }
.cmp-sum.match, .cmp-sum.close { border-color: rgba(46,160,110,.55); }
.cmp-sum.small { border-color: rgba(214,160,40,.65); }
.cmp-sum.check { border-color: rgba(214,80,80,.7); }
.cmp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 0 0 16px; font-size: 13.5px; }
.cmp-facts div { min-width: 0; } .cmp-facts dt { color: var(--label); font-size: 12px; } .cmp-facts dd { margin: 0; overflow-wrap: anywhere; }
.cmp-tbl { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: auto; }
.cmp-tbl th, .cmp-tbl td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line, rgba(30,58,74,.12)); vertical-align: top; }
.cmp-tbl thead th { color: var(--label); font: 600 12px/1.2 'Inter', sans-serif; text-transform: none; }
.cmp-tbl th:first-child, .cmp-tbl td:first-child, .cmp-tbl td:last-child, .cmp-tbl thead th:last-child { text-align: left; }
.cmp-tbl tbody th { font-weight: 600; text-align: left; }
.cmp-tbl tr.cmp-why td { color: var(--label); font-size: 12.5px; padding: 0 10px 10px; text-align: left; }
.cmp-b { display: inline-flex; gap: 6px; align-items: center; font: 600 12.5px/1.2 'Inter', sans-serif; white-space: nowrap; }
.cmp-b.match, .cmp-b.close { color: #2e9f6e; } .cmp-b.small { color: #c98a10; } .cmp-b.check { color: #d05050; }
.cmp-note { margin: 10px 0 0; color: var(--label); font-size: 12.5px; line-height: 1.4; }
.cmp-det { margin: 14px 0 0; border: 1px solid var(--line, rgba(30,58,74,.15)); border-radius: 12px; padding: 4px 14px 12px; }
.cmp-det summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.cmp-det .cmp-camps { margin-top: 4px; } .cmp-more { margin-top: 12px; }
.cmp-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 640px) {
  .modal.cmp { padding: 18px 16px; max-width: 100%; }
  .cmp-facts { grid-template-columns: minmax(0, 1fr); }
  .cmp-tbl, .cmp-tbl tbody, .cmp-tbl tr, .cmp-tbl th, .cmp-tbl td { display: block; width: 100%; box-sizing: border-box; }
  .cmp-tbl thead { position: absolute; left: -9999px; }
  .cmp-tbl tbody tr:not(.cmp-why) { border: 1px solid var(--line, rgba(30,58,74,.15)); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; }
  .cmp-tbl tr.cmp-why { margin: -4px 0 10px; }
  .cmp-tbl tr.cmp-why td { padding: 0 4px; }
  .cmp-tbl th, .cmp-tbl td { text-align: left !important; border: 0; padding: 3px 0; }
  .cmp-tbl td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 46%; color: var(--label); font-size: 12.5px; }
  .cmp-tbl td.num[data-label] { display: flex; justify-content: space-between; } .cmp-tbl td.num[data-label]::before { min-width: 0; }
  .cmp-tbl td[data-label="Result"] { display: flex; justify-content: space-between; align-items: center; } .cmp-tbl td[data-label="Result"]::before { min-width: 0; }
}
.cmp-tbl thead th, .cmp-tbl tbody th { text-transform: none; letter-spacing: 0; background: none; }
.cmp-tbl tbody th { font-size: 14px; color: inherit; }
.cmp-tbl th, .cmp-tbl td { white-space: normal; }
.cmp-camps th, .cmp-camps td { padding: 8px 6px; }
.cmp-camps tbody th { width: 30%; }
.cmp-det { overflow-x: auto; }
.cmp-camps td:last-child { text-align: right; }
@media (max-width: 640px) { .cmp-camps tbody th { width: 100%; } .cmp-camps td:last-child { text-align: left; } }

/* Rella sync banner */
.rella-banner { display: flex; align-items: center; gap: 8px; padding: 7px 20px; background: color-mix(in srgb, var(--bg) 90%, var(--accent) 10%); border-bottom: 1px solid var(--line, rgba(30,58,74,.12)); font-size: 13px; color: var(--label); min-height: 36px; }
.rella-banner-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--label); }
.rella-banner-dot.ok   { background: #22c55e; }
.rella-banner-dot.warn { background: #f59e0b; }
.rella-banner-dot.err  { background: #ef4444; }
.rella-banner-link { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 5px; white-space: nowrap; }
.rella-banner-link:hover { background: var(--accent); color: #fff; }
.rella-banner-reconnect { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#rella-chip { position: sticky; bottom: 0; padding: 8px 12px; border-top: 1px solid var(--line, rgba(30,58,74,.12)); display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--label); background: var(--bg); }
#rella-chip .rc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
#rella-chip .rc-dot.ok   { background: #22c55e; }
#rella-chip .rc-dot.warn { background: #f59e0b; }
#rella-chip .rc-dot.err  { background: #ef4444; }
