:root {
  --page: #edf2f7;
  --app: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --ink: #0f172a;
  --muted: #657085;
  --line: #e1e7f0;
  --green: #0f9f6e;
  --blue: #2563eb;
  --purple: #7c3aed;
  --amber: #b76618;
  --red: #d33b36;
  --shadow: 0 18px 50px rgba(33, 41, 62, .18);
  --shell-max: 100%;
  --page-pad: 0px;
  --content-gap: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--app);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: block;
  overflow-x: hidden;
  padding: 0;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  background: var(--app);
  position: relative;
  padding: 8px 16px 98px;
  box-shadow: none;
}

.boot-gate,
.login-gate {
  display: none;
}

.app-booting .app-shell,
.auth-signed-out .app-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-booting .app-shell > :not(.boot-gate),
.auth-signed-out .app-shell > :not(.login-gate) {
  display: none !important;
}

.app-booting .boot-gate,
.auth-signed-out .login-gate {
  width: 100%;
  min-height: calc(100dvh - 48px);
  display: grid;
  place-items: center;
}

.app-booting .boot-gate,
.boot-exiting .boot-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  min-height: 100dvh;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  background: #050817;
  opacity: 1;
  visibility: visible;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.boot-exiting .boot-gate {
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.gate-stack {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.gate-stack img {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(124, 77, 255, .42);
}

.boot-stack {
  width: min(100%, 390px);
  gap: 20px;
}

.boot-stack > img {
  animation: bootLogoPulse 1.6s ease-in-out infinite;
}

.boot-steps {
  width: min(100%, 330px);
  display: grid;
  gap: 13px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.boot-steps li {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.boot-steps li[hidden] {
  display: none;
}

.boot-steps i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(155, 168, 199, .38);
  border-radius: 50%;
  font-size: 11px;
  font-style: normal;
}

.boot-steps li.active {
  color: #fff;
}

.boot-steps li.active i {
  border-color: var(--purple);
  background: var(--purple);
  box-shadow: 0 0 0 4px rgba(124, 77, 255, .14);
  animation: bootStepPulse 1.1s ease-in-out infinite;
}

.boot-steps li.active i::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
}

.boot-steps li.done {
  color: #dce7ff;
}

.boot-steps li.done i {
  color: #06120e;
  border-color: var(--green);
  background: var(--green);
}

.boot-steps li.done i::after {
  content: "✓";
  font-weight: 950;
}

.boot-steps small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.boot-error {
  width: min(100%, 330px);
  text-align: center;
}

.boot-error p {
  margin: 0 0 12px;
  color: #ffdbe1;
  font-size: 13px;
  font-weight: 800;
}

.boot-error button {
  min-height: 44px;
  border: 1px solid rgba(124, 77, 255, .5);
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: rgba(124, 77, 255, .2);
  font-weight: 900;
}

@keyframes bootLogoPulse {
  0%, 100% { box-shadow: 0 18px 52px rgba(124, 77, 255, .3); }
  50% { box-shadow: 0 22px 66px rgba(47, 116, 255, .48); }
}

@keyframes bootStepPulse {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .app-booting .boot-gate,
  .boot-exiting .boot-gate {
    transition: none;
  }

  .boot-stack > img,
  .boot-steps li.active i {
    animation: none;
  }
}

.gate-brand h1 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.gate-brand h1 span {
  color: var(--purple);
}

.gate-brand p {
  max-width: 340px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.login-stack {
  gap: 22px;
}

#loginGateButton {
  min-height: 52px;
  min-width: min(100%, 280px);
  border: 1px solid rgba(124, 77, 255, .44);
  border-radius: 10px;
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(135deg, #6f4bff, #9d4dff);
  box-shadow: 0 18px 48px rgba(124, 77, 255, .34);
  font-size: 15px;
  font-weight: 950;
}

#loginGateButton.loading {
  cursor: wait;
  animation: loginPulse 1s ease-in-out infinite;
}

#loginGateButton:disabled {
  opacity: .9;
}

.status-bar {
  display: none;
}

.status-icons {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.status-icons i {
  width: 4px;
  border-radius: 3px;
  background: var(--ink);
}

.status-icons i:nth-child(1) {
  height: 6px;
}

.status-icons i:nth-child(2) {
  height: 9px;
}

.status-icons i:nth-child(3) {
  height: 12px;
}

.status-icons b {
  width: 22px;
  height: 11px;
  border: 1.7px solid var(--ink);
  border-radius: 3px;
  margin-left: 4px;
}

.app-top {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.brand:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 5px;
  border-radius: 12px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.05;
  letter-spacing: .02em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
}

.sign-out-button {
  color: var(--red);
}

.sign-out-button:hover {
  border-color: rgba(255, 85, 113, .44);
  background: rgba(255, 85, 113, .14);
}

.icon-button svg,
.tabbar svg,
.primary-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.has-badge::after {
  content: attr(data-badge);
  position: absolute;
  min-width: 18px;
  height: 18px;
  top: -4px;
  right: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border: 2px solid var(--app);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 14px;
}

.data-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.data-status[hidden] {
  display: none;
}

.data-status span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.data-status button {
  height: 28px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.segmented {
  height: 44px;
  display: grid;
  grid-template-columns: repeat(5, max-content);
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segmented button {
  min-width: 72px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segmented .active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(23, 31, 48, .11);
}

.site-select {
  position: relative;
  min-height: 44px;
  display: block;
  min-width: 0;
}

.site-filter-toggle {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr 18px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.site-filter-toggle > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.site-filter-toggle strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-filter-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s ease;
}

.site-filter-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.site-filter {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 230px;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(23, 31, 48, .18);
}

.site-filter[hidden] {
  display: none;
}

.period-summary {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12);
}

.period-summary[hidden] {
  display: none;
}

.period-summary span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.period-summary strong {
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-summary em {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--blue);
  background: #eaf1ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.period-summary em[hidden] {
  display: none;
}

.custom-range {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 18px;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(8px);
}

.custom-range[hidden] {
  display: none;
}

.custom-range-dialog {
  width: min(100%, 440px);
  display: grid;
  gap: 13px;
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 86px rgba(15, 23, 42, .32);
}

.custom-range-dialog header {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.custom-range-dialog header div {
  min-width: 0;
}

.custom-range-dialog header strong {
  display: block;
  margin-top: 2px;
  font-size: 21px;
  line-height: 1.1;
}

.custom-range label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.custom-range span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.custom-range input,
.custom-range button {
  height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.custom-range input {
  padding: 0 10px;
}

.date-input-row {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  min-width: 0;
}

.date-input-row input {
  width: 100%;
  cursor: pointer;
}

.date-picker-button {
  padding: 0;
  display: grid;
  place-items: center;
}

.date-picker-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#customApply {
  margin-top: 2px;
  padding: 0 12px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

#customApply:disabled {
  cursor: wait;
  opacity: .82;
}

#customApply.loading {
  display: inline-grid;
  grid-template-columns: 16px auto;
  place-content: center;
  align-items: center;
  gap: 8px;
}

#customApply.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.custom-range-close {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #f4f7fb;
}

.custom-range-close svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .38);
}

.calendar-overlay[hidden] {
  display: none;
}

.calendar-dialog {
  width: min(100%, 380px);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
}

.calendar-dialog header,
.calendar-dialog footer {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.calendar-dialog footer {
  grid-template-columns: 1fr 1fr;
}

.calendar-dialog header div {
  min-width: 0;
  text-align: center;
}

.calendar-dialog header span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-dialog header strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.1;
}

.calendar-nav,
.calendar-dialog footer button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
}

.calendar-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-dialog footer button:first-child {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-weekdays span {
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.calendar-grid button {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: #f4f7fb;
  font-size: 13px;
  font-weight: 900;
}

.calendar-grid button.outside {
  color: #a5adbc;
  background: #f8fafc;
}

.calendar-grid button.in-range {
  color: var(--blue);
  background: #eaf1ff;
}

.calendar-grid button.today {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .28);
}

.calendar-grid button.selected {
  color: #fff;
  background: var(--blue);
  box-shadow: none;
}

.filter-chip {
  min-height: 27px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fbfcff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  cursor: pointer;
}

.filter-chip input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--ink);
  flex: 0 0 auto;
}

.filter-chip span {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-chip:has(input:checked) {
  border-color: rgba(37, 99, 235, .28);
  background: #eef4ff;
}

.filter-chip:has(input:disabled) {
  cursor: default;
  opacity: .65;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr));
  gap: 10px;
}

.metric-card,
.section-block,
.chart-panel,
.top-article,
.alerts-panel,
.summary-strip,
.site-management-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-block,
.chart-panel,
.top-article,
.alerts-panel,
.summary-strip {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.metric-card {
  min-height: 148px;
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.metric-card > div:first-child {
  padding-right: 54px;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: clamp(24px, 8vw, 31px);
  line-height: 1;
  letter-spacing: 0;
}

.metric-card strong.is-unavailable {
  margin-top: 3px;
  color: var(--muted);
  font-size: clamp(11px, calc(8px + 1vw), 15px);
  font-weight: 750;
  line-height: 1.25;
  white-space: normal;
}

.metric-card p {
  margin: 0;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
}

.metric-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: currentColor;
  background: color-mix(in srgb, currentColor 14%, #fff);
}

.metric-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accent-green {
  color: var(--green);
}

.accent-blue {
  color: var(--blue);
}

.accent-purple {
  color: var(--purple);
}

.accent-amber {
  color: var(--amber);
}

.sparkline {
  width: 100%;
  height: 38px;
}

.sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rpm-gauge {
  height: 10px;
  align-self: center;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 13%, #fff);
  overflow: hidden;
}

.rpm-gauge i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  transition: width .28s ease;
}

.section-block,
.chart-panel,
.summary-strip {
  margin-top: 12px;
  padding: 4px 0 0;
}

.section-heading {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.section-heading > div,
.section-heading h2,
.section-heading p {
  min-width: 0;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.text-button {
  height: 30px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--blue);
  background: rgba(37, 99, 235, .08);
  font-size: 12px;
  font-weight: 900;
}

.site-list,
.share-list,
.source-list,
.page-list,
.connector-list,
.alert-list,
.revenue-grid {
  display: grid;
  gap: 8px;
}

.site-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}

.empty-state {
  min-height: 72px;
  display: grid;
  align-items: center;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.site-row img,
.site-management-card img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.site-row h3,
.site-management-card h3,
.top-article h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.22;
}

.site-row h3,
.site-row p,
.site-management-card h3,
.site-management-card p,
.top-article h3,
.top-article p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-row h3,
.site-row p,
.site-management-card h3,
.site-management-card p {
  white-space: nowrap;
}

.site-row p,
.site-management-card p,
.top-article p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.site-metrics {
  display: grid;
  justify-items: end;
  gap: 4px;
  white-space: nowrap;
}

.site-metrics strong {
  font-size: 14px;
}

.site-metrics span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.chart-panel {
  padding-bottom: 10px;
}

.chart-panel #chartTotal {
  color: var(--ink);
  font-size: 16px;
}

.bar-chart {
  height: clamp(156px, 31vw, 230px);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  padding-top: 8px;
}

.bar-chart button {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.bar-stack {
  height: 100%;
  min-height: 0;
  display: grid;
  align-items: end;
}

.bar-stack i {
  display: block;
  min-height: 8px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #2d6df6, #12a374);
}

.bar-chart span {
  font-size: 11px;
  font-weight: 800;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.top-article,
.alerts-panel {
  padding: 4px 0 0;
}

.article-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.article-row img {
  width: 76px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

.top-article strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 13px;
}

.alert-row,
.share-row,
.source-row,
.page-row,
.connector-row,
.security-list p,
.notification-list p,
.revenue-card {
  min-height: 48px;
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.alert-row {
  grid-template-columns: 28px 1fr auto;
}

.alert-dot {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.alert-row strong,
.connector-row strong,
.security-list strong {
  display: block;
  font-size: 13px;
}

.alert-row small,
.connector-row small,
.security-list span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.alert-row > span:nth-child(2),
.connector-row > div,
.page-row strong {
  min-width: 0;
}

.alert-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.summary-strip {
  display: grid;
  gap: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

.summary-strip div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-strip strong {
  font-size: 24px;
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
}

progress::-webkit-progress-bar {
  background: var(--surface-soft);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--green);
}

.status-pill {
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--amber) !important;
  background: #fff2de;
}

.status-pill.connected {
  color: var(--green) !important;
  background: #e6f8ef;
}

.status-pill.error {
  color: var(--red) !important;
  background: #ffe8e6;
}

.revenue-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.revenue-card {
  min-height: 78px;
  align-content: center;
}

.revenue-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revenue-card strong {
  font-size: 20px;
}

.share-row,
.source-row,
.page-row,
.connector-row {
  grid-template-columns: 1fr auto;
  min-width: 0;
}

.share-row .track,
.source-row .track {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}

.share-row .track i,
.source-row .track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.share-row strong,
.source-row strong,
.page-row strong {
  font-size: 13px;
}

.page-row strong span {
  display: block;
  margin-top: 2px;
}

.share-row span,
.source-row span,
.page-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-management {
  display: grid;
  gap: 10px;
}

.site-management-card {
  padding: 12px;
  min-width: 0;
}

.site-management-card header {
  display: grid;
  grid-template-columns: 44px 1fr 38px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-check {
  width: 34px;
  height: 34px;
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.site-check input {
  position: absolute;
  opacity: 0;
}

.site-check span {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #fff;
}

.site-check span::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}

.site-check input:checked + span {
  border-color: var(--green);
  background: var(--green);
}

.site-check input:checked + span::after {
  opacity: 1;
}

.site-check input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.site-sync-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.site-sync-line strong {
  color: var(--ink);
}

.site-management-card .connection-tags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.connection-tags span {
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 900;
}

.connection-tags .on {
  color: var(--green);
  background: #e6f8ef;
}

.primary-action {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 900;
}

.connector-row {
  grid-template-columns: 1fr auto;
}

.connector-row span {
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--amber);
  background: #fff2de;
  font-size: 11px;
  font-weight: 900;
}

.connector-row.connected span {
  color: var(--green);
  background: #e6f8ef;
}

.connector-row.error span {
  color: var(--red);
  background: #ffe8e6;
}

.security-list,
.notification-list {
  display: grid;
  gap: 8px;
}

.security-list p,
.notification-list p {
  grid-template-columns: 1fr;
  margin: 0;
}

.notification-list p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #cbd5e1;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
  transition: transform .18s ease;
}

.switch input:checked + span {
  background: var(--green);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100vw, var(--shell-max));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(18px);
}

.tabbar button {
  min-width: 0;
  height: 56px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
}

.tabbar button.active {
  color: var(--blue);
  background: #eaf1ff;
}

.tabbar span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 560px) {
  :root {
    --shell-max: 100%;
    --page-pad: 0px;
    --content-gap: 14px;
  }

  .status-bar {
    display: none;
  }

  .app-shell {
    min-height: 100dvh;
    border-radius: 0;
    padding: 16px 22px 104px;
  }

  .app-top {
    min-height: 62px;
  }

  .brand h1 {
    font-size: 25px;
  }

  .control-row {
    grid-template-columns: minmax(250px, 430px) minmax(280px, 1fr);
    align-items: start;
  }

  .site-filter {
    left: auto;
    width: min(420px, 100%);
  }

  .data-status {
    max-width: 520px;
  }

  .site-list,
  .site-management,
  .connector-list,
  .security-list,
  .notification-list {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }

  .split-grid,
  [data-view="traffic"].active,
  [data-view="settings"].active {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--content-gap);
  }

  [data-view="traffic"].active > *,
  [data-view="settings"].active > * {
    margin-top: 0;
  }

  .revenue-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  :root {
    --shell-max: 100%;
    --page-pad: 0px;
    --content-gap: 16px;
  }

  body {
    align-items: flex-start;
  }

  .app-shell {
    padding: 24px 28px 110px;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--content-gap);
  }

  .metric-card {
    min-height: 160px;
  }

  [data-view="dashboard"].active {
    display: grid;
    grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr);
    align-items: start;
    gap: var(--content-gap);
  }

  [data-view="dashboard"].active > .kpi-grid,
  [data-view="dashboard"].active > .split-grid {
    grid-column: 1 / -1;
  }

  [data-view="dashboard"].active > .section-block,
  [data-view="dashboard"].active > .chart-panel,
  [data-view="dashboard"].active > .split-grid {
    margin-top: 0;
  }

  .bar-chart {
    height: 252px;
  }

  [data-view="revenue"].active {
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
    gap: var(--content-gap);
    align-items: start;
  }

  [data-view="revenue"].active > * {
    margin-top: 0;
  }

  [data-view="revenue"].active > .section-block:last-child {
    grid-column: 1 / -1;
  }

  .tabbar {
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px rgba(33, 41, 62, .12);
  }
}

@media (min-width: 1120px) {
  :root {
    --shell-max: 100%;
    --page-pad: 0px;
    --content-gap: 20px;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas:
      "top nav"
      "status status"
      "controls controls"
      "summary summary"
      "content content";
    column-gap: 18px;
    row-gap: 14px;
    min-height: 100dvh;
    padding: 22px clamp(24px, 3vw, 48px) 32px;
    border-radius: 0;
  }

  .app-shell:has(.data-status[hidden]) {
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "top nav"
      "controls controls"
      "summary summary"
      "content content";
  }

  .app-shell:has(.period-summary[hidden]) {
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "top nav"
      "status status"
      "controls controls"
      "content content";
  }

  .app-shell:has(.data-status[hidden]):has(.period-summary[hidden]) {
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "top nav"
      "controls controls"
      "content content";
  }

  .app-top {
    grid-area: top;
    min-height: 56px;
  }

  .control-row {
    grid-area: controls;
    grid-template-columns: minmax(310px, 520px) minmax(300px, 520px);
    justify-content: start;
    margin: 0;
  }

  .period-summary {
    grid-area: summary;
    width: min(100%, 720px);
    margin: 0;
  }

  .data-status {
    grid-area: status;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .view.active {
    grid-area: content;
    min-width: 0;
  }

  .tabbar {
    grid-area: nav;
    position: sticky;
    top: 14px;
    left: auto;
    bottom: auto;
    z-index: 20;
    width: auto;
    transform: none;
    grid-template-columns: repeat(5, max-content);
    justify-self: end;
    align-self: center;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: none;
    background: rgba(255, 255, 255, .88);
  }

  .tabbar button {
    height: 38px;
    min-width: 0;
    grid-template-columns: 18px auto;
    justify-content: center;
    justify-items: center;
    gap: 7px;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 12px;
  }

  .tabbar svg {
    width: 17px;
    height: 17px;
  }

  [data-view="dashboard"].active {
    grid-template-columns: minmax(300px, .74fr) minmax(0, 1.26fr);
  }

  .site-list {
    grid-template-columns: 1fr;
  }

  [data-view="sites"].active {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
  }

  .site-management {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .primary-action {
    max-width: 340px;
  }

  [data-view="settings"].active {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  }

  [data-view="settings"].active > .section-block:first-child {
    grid-row: span 2;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .site-select {
    gap: 8px;
  }

  .custom-range {
    grid-template-columns: 1fr;
  }

  .calendar-overlay {
    padding: 10px;
  }

  .calendar-dialog {
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }

  .revenue-grid {
    grid-template-columns: 1fr;
  }

  .tabbar {
    padding-inline: 6px;
  }

  .tabbar button {
    font-size: 9px;
  }
}

@media (max-width: 330px) {
  .kpi-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 12px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .tabbar svg {
    width: 18px;
    height: 18px;
  }
}

/* Dark cockpit refresh inspired by the reference dashboard */
:root {
  --page: #050817;
  --app: #070b1a;
  --surface: rgba(17, 22, 43, .82);
  --surface-soft: rgba(28, 35, 66, .78);
  --ink: #f8fbff;
  --muted: #9ba8c7;
  --line: rgba(153, 169, 211, .16);
  --green: #22f59a;
  --blue: #2f74ff;
  --purple: #7c4dff;
  --amber: #f59b3b;
  --red: #ff5571;
  --shadow: 0 22px 80px rgba(0, 0, 0, .38);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(96, 78, 255, .22), transparent 34vw),
    radial-gradient(circle at 88% 12%, rgba(191, 73, 255, .14), transparent 30vw),
    radial-gradient(circle at 50% 100%, rgba(47, 116, 255, .12), transparent 38vw),
    var(--app);
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 360px),
    transparent;
}

.brand img {
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(124, 77, 255, .32);
}

.brand h1 {
  color: #fff;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: none;
}

.brand h1 span {
  color: var(--purple);
}

.brand p,
.section-heading p,
.section-heading span,
.metric-card small,
.site-row p,
.site-management-card p,
.top-article p,
.alert-row small,
.connector-row small,
.security-list span,
.summary-strip span,
.share-row span,
.source-row span,
.page-row span,
.alert-row em {
  color: var(--muted);
}

.icon-button,
.data-status,
.segmented,
.site-filter-toggle,
.period-summary,
.custom-range-dialog,
.calendar-dialog,
.tabbar {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(13, 17, 35, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
}

.icon-button:hover,
.text-button:hover,
.tabbar button:hover {
  border-color: rgba(124, 77, 255, .42);
  background: rgba(124, 77, 255, .16);
}

.data-status span,
.site-filter-toggle strong,
.filter-chip span,
.section-heading h2,
.site-row h3,
.site-management-card h3,
.top-article h3,
.alert-row strong,
.connector-row strong,
.security-list strong,
.share-row strong,
.source-row strong,
.page-row strong,
.summary-strip strong {
  color: var(--ink);
}

.data-status button,
.primary-action,
#customApply,
.calendar-dialog footer button:first-child {
  color: #fff;
  background: linear-gradient(135deg, #6f4bff, #9d4dff);
  box-shadow: 0 12px 32px rgba(124, 77, 255, .28);
}

.segmented {
  background: rgba(10, 14, 31, .86);
}

.segmented button {
  color: var(--muted);
}

.segmented .active,
.tabbar button.active {
  color: #d9c9ff;
  background: linear-gradient(135deg, rgba(124, 77, 255, .32), rgba(47, 116, 255, .12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 28px rgba(58, 38, 141, .24);
}

.site-filter,
.filter-chip,
.custom-range input,
.custom-range button,
.calendar-nav,
.calendar-dialog footer button,
.calendar-grid button,
.site-row,
.empty-state,
.article-row img,
.alert-row,
.share-row,
.source-row,
.page-row,
.connector-row,
.security-list p,
.notification-list p,
.revenue-card,
.summary-strip,
.site-management-card {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(14, 19, 39, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.site-management-card.inactive {
  opacity: .58;
  background: rgba(10, 14, 31, .58);
}

.site-management-card.inactive img {
  filter: grayscale(1);
  opacity: .55;
}

.site-management-card.inactive .site-sync-line strong {
  color: var(--muted);
}

.filter-chip:has(input:checked) {
  border-color: rgba(124, 77, 255, .5);
  background: rgba(124, 77, 255, .2);
}

.filter-chip input {
  accent-color: var(--purple);
}

.metric-card {
  position: relative;
  border-color: var(--line);
  background:
    radial-gradient(circle at 82% 16%, color-mix(in srgb, currentColor 24%, transparent), transparent 34%),
    linear-gradient(145deg, rgba(22, 26, 51, .96), rgba(11, 15, 31, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 16px 48px rgba(0, 0, 0, .22);
}

.metric-card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: currentColor;
  opacity: .12;
  filter: blur(8px);
  pointer-events: none;
}

.metric-icon {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .32), transparent 36%),
    color-mix(in srgb, currentColor 23%, rgba(255, 255, 255, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 12px 26px color-mix(in srgb, currentColor 22%, transparent);
  z-index: 1;
}

.metric-icon svg {
  filter: drop-shadow(0 0 8px color-mix(in srgb, currentColor 42%, transparent));
}

.metric-card strong {
  color: #fff;
}

.accent-green {
  color: var(--green);
}

.accent-blue {
  color: #3a8cff;
}

.accent-purple {
  color: #b24cff;
}

.accent-amber {
  color: var(--amber);
}

.sparkline polyline {
  stroke-width: 3.2;
  filter: drop-shadow(0 0 8px currentColor);
}

.rpm-gauge {
  background: rgba(255, 255, 255, .08);
}

.chart-panel,
.top-article,
.alerts-panel,
.section-block {
  color: var(--ink);
}

.bar-stack i {
  background: linear-gradient(180deg, #8f5bff, #245cff);
  box-shadow: 0 0 18px rgba(124, 77, 255, .35);
}

progress,
progress::-webkit-progress-bar,
.share-row .track,
.source-row .track {
  background: rgba(255, 255, 255, .08);
}

progress::-webkit-progress-value,
.share-row .track i,
.source-row .track i {
  background: linear-gradient(90deg, #245cff, #8f5bff);
}

.status-pill,
.connector-row span {
  color: #ffd194 !important;
  background: rgba(245, 155, 59, .16);
}

.status-pill.connected,
.connector-row.connected span,
.connection-tags .on {
  color: var(--green) !important;
  background: rgba(34, 245, 154, .14);
}

.status-pill.error,
.connector-row.error span {
  color: var(--red) !important;
  background: rgba(255, 85, 113, .14);
}

.connection-tags span {
  color: var(--muted);
  background: rgba(255, 255, 255, .07);
}

.site-check span {
  border-color: rgba(153, 169, 211, .26);
  background: rgba(255, 255, 255, .05);
}

.switch span {
  background: rgba(153, 169, 211, .28);
}

.switch input:checked + span {
  background: linear-gradient(90deg, #245cff, #22f59a);
}

.custom-range,
.calendar-overlay {
  background: rgba(3, 6, 18, .72);
}

.calendar-grid button.outside {
  color: rgba(155, 168, 199, .58);
  background: rgba(255, 255, 255, .035);
}

.calendar-grid button.in-range {
  color: #d8caff;
  background: rgba(124, 77, 255, .18);
}

.calendar-grid button.today {
  box-shadow: inset 0 0 0 2px rgba(124, 77, 255, .48);
}

.calendar-grid button.selected {
  color: #fff;
  background: linear-gradient(135deg, #245cff, #8f5bff);
}

.period-summary span {
  color: #b79cff;
}

.period-summary em {
  color: #d9c9ff;
  background: rgba(124, 77, 255, .18);
}

@media (min-width: 1120px) {
  .app-shell {
    padding-top: 28px;
  }

  .tabbar {
    background: rgba(11, 15, 31, .7);
  }
}

.data-status {
  position: relative;
  isolation: isolate;
}

.data-status[data-state="loading"],
.data-status[data-state="connecting"],
.data-status[data-state="syncing"] {
  border-color: rgba(124, 77, 255, .58);
  animation: statusPulse 1s ease-in-out infinite;
}

.data-status[data-state="loading"] {
  background: linear-gradient(135deg, rgba(47, 116, 255, .22), rgba(13, 17, 35, .86));
}

.data-status[data-state="connecting"] {
  background: linear-gradient(135deg, rgba(245, 155, 59, .24), rgba(13, 17, 35, .88));
}

.data-status[data-state="syncing"] {
  background: linear-gradient(135deg, rgba(124, 77, 255, .30), rgba(47, 116, 255, .18));
}

.data-status[data-state="success"] {
  border-color: rgba(34, 245, 154, .38);
  background: rgba(34, 245, 154, .10);
}

.data-status[data-state="warning"],
.data-status[data-state="error"] {
  border-color: rgba(255, 85, 113, .40);
  background: rgba(255, 85, 113, .10);
}

.data-status[data-state="loading"]::before,
.data-status[data-state="connecting"]::before,
.data-status[data-state="syncing"]::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: statusDot 1s ease-out infinite;
}

.data-status[data-state="syncing"] span,
.data-status[data-state="connecting"] span,
.data-status[data-state="loading"] span {
  color: #fff;
}

.activity-syncing .metric-card,
.activity-syncing .chart-panel,
.activity-syncing .section-block,
.activity-syncing .summary-strip,
.activity-syncing .top-article,
.activity-syncing .alerts-panel,
.activity-syncing .site-management-card,
.activity-loading .metric-card,
.activity-loading .chart-panel,
.activity-loading .section-block,
.activity-loading .summary-strip {
  animation: blockRefresh 1.05s ease-in-out infinite;
}

.activity-syncing .icon-button#syncButton {
  animation: syncButtonSpin .9s linear infinite;
}

@keyframes loginPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 18px 48px rgba(124, 77, 255, .34);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 22px 64px rgba(124, 77, 255, .56);
  }
}

@keyframes statusPulse {
  0%,
  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 0 rgba(124, 77, 255, 0);
  }
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 0 28px rgba(124, 77, 255, .34);
  }
}

@keyframes statusDot {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 42%, transparent);
  }
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}

@keyframes blockRefresh {
  0%,
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: brightness(1.18);
    transform: translateY(-1px);
  }
}

@keyframes syncButtonSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  #loginGateButton.loading,
  .data-status[data-state="loading"],
  .data-status[data-state="connecting"],
  .data-status[data-state="syncing"],
  .data-status[data-state="loading"]::before,
  .data-status[data-state="connecting"]::before,
  .data-status[data-state="syncing"]::before,
  .activity-syncing .metric-card,
  .activity-syncing .chart-panel,
  .activity-syncing .section-block,
  .activity-syncing .summary-strip,
  .activity-syncing .top-article,
  .activity-syncing .alerts-panel,
  .activity-syncing .site-management-card,
  .activity-loading .metric-card,
  .activity-loading .chart-panel,
  .activity-loading .section-block,
  .activity-loading .summary-strip,
  .activity-syncing .icon-button#syncButton {
    animation: none;
  }
}

/* Dashboard professional refresh */
.app-shell {
  max-width: 1500px;
  margin-inline: auto;
}

.sync-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(155, 168, 199, .12);
}

.sync-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 245, 154, .14);
}

.sync-dot.stale {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 155, 59, .16);
}

.sync-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 85, 113, .16);
}

.control-row {
  align-items: stretch;
}

.compare-toggle,
.reset-filters {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(13, 17, 35, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
  font-size: 12px;
  font-weight: 900;
}

.compare-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.compare-toggle input {
  accent-color: var(--purple);
}

.reset-filters {
  padding: 0 14px;
}

.site-search {
  min-width: min(100%, 260px);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
}

.filter-chip img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex: 0 0 auto;
}

.metric-card {
  min-height: 176px;
}

.metric-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.metric-card::after {
  opacity: .08;
  filter: blur(10px);
}

.metric-icon {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px color-mix(in srgb, currentColor 15%, transparent);
}

.trend-text {
  color: var(--muted) !important;
}

.trend-text.positive {
  color: var(--green) !important;
}

.trend-text.negative {
  color: var(--red) !important;
}

.trend-text.neutral {
  color: var(--muted) !important;
}

.chart-actions,
.view-switch,
.mini-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-actions button,
.view-switch button,
.mini-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  font-size: 12px;
  font-weight: 900;
}

.chart-actions button.active,
.view-switch button.active,
.mini-tabs button.active {
  color: #d9c9ff;
  border-color: rgba(124, 77, 255, .5);
  background: rgba(124, 77, 255, .22);
}

.line-chart {
  height: 240px;
  min-height: 220px;
  display: grid;
  place-items: stretch;
  padding: 8px 0 0;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid line {
  stroke: rgba(153, 169, 211, .16);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: url("#chartGradient");
  stroke: #8f5bff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(124, 77, 255, .35));
}

.chart-points circle {
  fill: #0b1024;
  stroke: #8f5bff;
  stroke-width: 2;
}

.chart-labels text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(153, 169, 211, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.chart-empty strong {
  color: var(--ink);
}

.chart-empty span {
  color: var(--muted);
  font-size: 13px;
}

.site-row {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
}

.site-row > .status-pill {
  grid-column: 1 / -1;
  justify-self: start;
}

.site-card-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.site-card-grid span {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
}

.site-card-grid strong,
.site-card-grid em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.site-card-grid em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.performance-table,
.content-list,
.recommendation-list {
  display: grid;
  gap: 8px;
}

.performance-head,
.performance-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(5, minmax(90px, 1fr));
  gap: 8px;
  align-items: center;
}

.performance-head {
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.performance-row,
.content-row,
.recommendation-row {
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 19, 39, .82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.performance-row.best {
  border-color: rgba(34, 245, 154, .34);
}

.perf-site {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  min-width: 0;
}

.perf-site img {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.perf-site strong,
.perf-site em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-site em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.performance-row > span:not(.perf-site) {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.content-row strong,
.content-row span {
  display: block;
  min-width: 0;
}

.content-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.content-row dl {
  display: flex;
  gap: 10px;
  margin: 0;
}

.content-row dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.content-row dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.alert-row {
  grid-template-columns: 28px 1fr auto;
}

.alert-row button {
  grid-column: 2 / -1;
  justify-self: start;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
  font-size: 11px;
  font-weight: 900;
}

.goals-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.recommendation-row {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

@media (min-width: 560px) {
  .control-row {
    grid-template-columns: minmax(250px, 1fr) minmax(220px, .7fr) auto auto;
  }
}

@media (min-width: 860px) {
  [data-view="dashboard"].active {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
  }

  [data-view="dashboard"].active > .kpi-grid,
  [data-view="dashboard"].active > .performance-panel,
  [data-view="dashboard"].active > .split-grid,
  [data-view="dashboard"].active > .dashboard-secondary {
    grid-column: 1 / -1;
  }

  [data-view="dashboard"].active > .section-block:not(.performance-panel) {
    grid-column: span 4;
  }

  [data-view="dashboard"].active > .chart-panel {
    grid-column: span 8;
  }

  .line-chart {
    height: 320px;
  }
}

@media (min-width: 1120px) {
  .control-row {
    grid-template-columns: minmax(420px, 620px) minmax(300px, 440px) max-content max-content;
  }
}

@media (max-width: 720px) {
  .chart-actions,
  .view-switch,
  .mini-tabs {
    justify-content: flex-start;
  }

  .line-chart {
    height: 240px;
  }

  .site-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-head {
    display: none;
  }

  .performance-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .performance-row .perf-site {
    grid-column: 1 / -1;
  }

  .content-row {
    grid-template-columns: 1fr;
  }

  .content-row dl {
    flex-wrap: wrap;
  }
}

/* Dashboard temporel */
.legacy-period-controls,
.legacy-chart-panel {
  display: none !important;
}

.control-row {
  display: flex;
  justify-content: flex-end;
}

.control-row .site-select {
  width: min(100%, 420px);
}

.dashboard-intro {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.dashboard-intro span {
  color: var(--purple);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-intro h2,
.dashboard-intro p {
  margin: 0;
}

.dashboard-intro h2 {
  font-size: clamp(20px, 2vw, 28px);
}

.dashboard-intro p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.period-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 680px), 1fr));
  gap: 18px;
}

.period-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(33, 41, 62, .08);
}

.period-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.period-card-header > div:first-child {
  display: grid;
  gap: 3px;
}

.period-card-header span {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.period-card-header strong,
.period-card-header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.period-mode {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #11172a;
}

.period-mode button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: #b8c1d8;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.period-mode button.active {
  color: #fff !important;
  background: #6d4aff !important;
  box-shadow: 0 5px 14px rgba(109, 74, 255, .28);
}

.period-mode button:hover:not(:disabled) {
  color: #fff;
  background: #232d4d;
}

.period-mode button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .75);
  outline-offset: 2px;
}

.period-mode button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.period-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 18px;
}

.period-metrics > div {
  min-width: 0;
  padding: 10px;
  border-left: 3px solid var(--line);
  background: var(--surface-soft);
}

.period-metrics > div:nth-child(1) { border-color: #0f9f6e; }
.period-metrics > div:nth-child(2) { border-color: #2563eb; }
.period-metrics > div:nth-child(3) { border-color: #a12ac7; }
.period-metrics > div:nth-child(4) { border-color: #d47a19; }

.period-metrics span,
.period-metrics strong,
.period-metrics em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.period-metrics span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.period-metrics strong {
  margin-top: 4px;
  font-size: 16px;
}

.period-metrics em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.period-metrics em.positive { color: var(--green); }
.period-metrics em.negative { color: var(--red); }

.period-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 14px;
}

.period-chart {
  min-width: 0;
}

.period-chart h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 12px;
}

.period-line-chart {
  width: 100%;
  height: 210px;
  overflow: visible;
}

.period-chart-grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.period-line-chart polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.period-line-chart .current-line {
  stroke: currentColor;
  stroke-width: 3;
}

.period-line-chart .comparison-line {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 5 5;
  opacity: .42;
}

.period-line-chart circle {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 2;
}

.period-line-chart .comparison-point {
  opacity: .42;
}

.metric-revenue { color: #0f9f6e; }
.metric-visitors { color: #2563eb; }
.metric-pageviews { color: #a12ac7; }
.metric-rpm { color: #d47a19; }

.period-axis-labels text {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.period-chart-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

@media (min-width: 860px) {
  [data-view="dashboard"].active > .dashboard-intro,
  [data-view="dashboard"].active > .period-dashboard-grid {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1500px) {
  .period-dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(740px, 1fr));
  }

  .period-line-chart,
  .period-chart-empty {
    min-height: 250px;
    height: 250px;
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding-inline: 12px;
  }

  .control-row,
  .control-row .site-select {
    width: 100%;
  }

  .period-card {
    padding: 14px;
  }

  .period-card-header {
    display: grid;
  }

  .period-mode {
    justify-content: stretch;
  }

  .period-mode button {
    flex: 1;
  }

  .period-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-charts {
    grid-template-columns: 1fr;
  }

  .period-line-chart,
  .period-chart-empty {
    min-height: 220px;
    height: 220px;
  }
}

/* Deterministic copilot, goals and KPI explanations */
.metric-card {
  padding-bottom: 54px;
}

/* Premium chrome and icon polish */
:root {
  --ui-control-radius: 8px;
  --ui-panel-radius: 8px;
  --chrome-line: rgba(157, 174, 218, .14);
  --chrome-muted: #8592ae;
}

.app-top,
.tabbar,
.icon-button {
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, backdrop-filter 180ms ease;
}

.icon-button {
  border-color: var(--chrome-line);
  border-radius: var(--ui-control-radius);
  color: #c7d0e6;
  background: rgba(18, 24, 47, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.icon-button svg,
.tabbar svg,
.band-icon svg,
.objectives-kicker svg,
.alert-dot svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  color: #fff;
  border-color: rgba(151, 122, 255, .42);
  background: rgba(124, 77, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.icon-button:active,
.tabbar button:active {
  transform: scale(.96);
}

.sign-out-button {
  color: #d6a1ad;
}

.has-badge::after {
  top: -3px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-color: #090d1d;
  font-size: 9px;
}

.activity-syncing .icon-button#syncButton {
  animation: none;
}

.activity-syncing #syncButton svg {
  animation: premiumSyncSpin .9s linear infinite;
}

@keyframes premiumSyncSpin {
  to { transform: rotate(360deg); }
}

.tabbar {
  border-color: var(--chrome-line);
  background: rgba(9, 13, 29, .76);
  box-shadow: 0 -8px 26px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.tabbar button {
  color: var(--chrome-muted);
  transition: color 160ms ease, background-color 160ms ease, transform 100ms ease;
}

.tabbar button.active {
  color: #b8a4ff;
  background: rgba(124, 77, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.tabbar svg {
  stroke-width: 1.8;
}

.band-icon svg {
  width: 15px;
  height: 15px;
}

.objectives-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.objectives-kicker svg {
  width: 14px;
  height: 14px;
}

.alert-dot {
  color: var(--alert-color, var(--blue));
  border: 1px solid color-mix(in srgb, var(--alert-color, var(--blue)) 26%, transparent);
  background: color-mix(in srgb, var(--alert-color, var(--blue)) 12%, transparent);
}

.alert-dot svg {
  width: 16px;
  height: 16px;
}

.dashboard-takeaways,
.dashboard-priority,
.momentum-panel,
.objectives-panel {
  border-color: var(--chrome-line);
}

@media (max-width: 1119px) {
  .app-top {
    background: rgba(7, 11, 26, .66);
    border-bottom: 1px solid rgba(157, 174, 218, .08);
    box-shadow: none;
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
  }

  .header-scrolled .app-top {
    background: rgba(7, 11, 26, .88);
    border-bottom-color: var(--chrome-line);
    backdrop-filter: blur(20px) saturate(1.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.16);
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }
}

@media (min-width: 1120px) {
  .app-top {
    min-height: 52px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: var(--ui-panel-radius);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-scrolled .app-top {
    border-color: var(--chrome-line);
    background: rgba(8, 12, 28, .7);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
  }

  .icon-button {
    width: 38px;
    height: 38px;
    background: rgba(18, 24, 47, .32);
  }

  .tabbar {
    top: 10px;
    padding: 4px;
    border-radius: var(--ui-control-radius);
    background: rgba(9, 13, 29, .34);
    box-shadow: none;
  }

  .header-scrolled .tabbar {
    background: rgba(9, 13, 29, .72);
  }

  .tabbar button {
    height: 36px;
    border-radius: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-top,
  .tabbar,
  .icon-button,
  .tabbar button,
  .activity-syncing #syncButton svg {
    transition: none;
    animation: none;
  }
}

.metric-card em {
  padding-right: 78px;
}

.kpi-why-button {
  position: absolute;
  right: 12px;
  bottom: 10px;
  min-height: 36px;
  border: 1px solid rgba(124, 77, 255, .34);
  border-radius: 7px;
  padding: 0 10px;
  color: #cdbfff;
  background: rgba(124, 77, 255, .12);
  font-size: 11px;
  font-weight: 900;
}

.kpi-why-button:hover,
.kpi-why-button:focus-visible {
  color: #fff;
  border-color: rgba(124, 77, 255, .68);
  background: rgba(124, 77, 255, .24);
  outline: none;
}

.objectives-panel {
  min-width: 0;
  margin-top: 12px;
  padding: 15px 16px;
  border-block: 1px solid var(--line);
  background: rgba(13, 17, 35, .48);
}

.objectives-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.objectives-header span {
  color: var(--purple);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.objectives-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.objectives-header button,
.objectives-form button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
  font-size: 11px;
  font-weight: 900;
}

.objectives-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 13px;
}

.objective-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
}

.objective-row span,
.objective-row small,
.objectives-empty {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.objective-row strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
}

.objective-row em {
  align-self: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.objective-row em.ahead { color: var(--green); }
.objective-row em.behind { color: var(--amber); }
.objective-row em.on-pace { color: var(--blue); }

.objective-row progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 5px;
  accent-color: var(--purple);
}

.objective-row > small {
  grid-column: 1 / -1;
}

.objectives-empty {
  margin: 0;
  font-size: 12px;
}

.objectives-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.objectives-form[hidden] {
  display: none;
}

.objectives-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.objectives-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
}

.objectives-form > div {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.objectives-form button[type="submit"] {
  color: #fff;
  border-color: transparent;
  background: var(--purple);
}

.kpi-why-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
  padding-top: var(--safe-top);
  background: rgba(2, 5, 15, .62);
  backdrop-filter: blur(5px);
}

.kpi-why-overlay[hidden] {
  display: none;
}

.kpi-why-sheet {
  max-height: calc(88dvh - var(--safe-top));
  overflow-y: auto;
  padding: 18px 16px calc(18px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  background: #0b1024;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, .42);
}

.kpi-why-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.kpi-why-sheet header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi-why-sheet header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 20px;
}

#closeKpiWhy {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
  font-size: 24px;
}

.why-open {
  overflow: hidden;
}

#kpiWhyContent {
  display: grid;
  gap: 16px;
  margin-top: 17px;
}

.why-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 5px 12px;
}

.why-summary > strong {
  color: var(--ink);
  font-size: 30px;
}

.why-summary > em {
  font-size: 15px;
  font-style: normal;
  font-weight: 950;
}

.why-summary > small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.why-section {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.why-section h3 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.why-section p {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.why-section p > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.why-section img {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
}

.why-section p > strong {
  flex: 0 0 auto;
}

.why-empty {
  color: var(--muted) !important;
}

@media (min-width: 760px) {
  .kpi-why-overlay {
    justify-items: end;
    align-items: stretch;
  }

  .kpi-why-sheet {
    width: min(520px, 100%);
    max-height: 100dvh;
    padding-top: calc(22px + var(--safe-top));
    border-radius: 12px 0 0 12px;
  }
}

@media (max-width: 700px) {
  .kpi-why-button,
  .objectives-header button,
  .objectives-form button {
    min-height: 44px;
  }

  .objectives-panel {
    margin-top: 8px;
    padding: 13px 4px;
  }

  .objectives-overview,
  .objectives-form {
    grid-template-columns: 1fr;
  }
}

/* Mobile/PWA shell */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sticky-header-height: 66px;
  --mobile-nav-space: 82px;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: clip;
}

body,
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell {
  padding-top: 0;
  padding-bottom: calc(var(--mobile-nav-space) + var(--safe-bottom));
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 58px;
  padding-top: var(--safe-top);
  background: rgba(7, 11, 26, .96);
  box-shadow: 0 1px 0 rgba(153, 169, 211, .12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.data-status:not([hidden]) {
  position: sticky;
  top: var(--sticky-header-height);
  z-index: 45;
  margin-top: 0;
  background-clip: padding-box;
}

.data-status[data-state="offline"] {
  border-color: rgba(245, 155, 59, .42);
  background: rgba(245, 155, 59, .12);
}

.tabbar {
  padding-bottom: calc(8px + var(--safe-bottom));
}

.app-booting .app-shell,
.auth-signed-out .app-shell {
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
}

.app-booting .boot-gate,
.auth-signed-out .login-gate {
  min-height: auto;
}

.custom-range,
.calendar-overlay {
  padding-top: calc(18px + var(--safe-top));
  padding-bottom: calc(18px + var(--safe-bottom));
}

.calendar-dialog {
  max-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom));
}

.icon-button,
.period-mode button,
.reference-date-control label,
.reference-date-control button,
.custom-range input,
.custom-range button,
.calendar-nav,
.calendar-dialog footer button {
  min-height: 44px;
}

@media (max-width: 700px) {
  :root {
    --mobile-nav-space: 76px;
  }

  .app-shell {
    padding-inline: 12px;
  }

  .app-top {
    min-height: 52px;
    gap: 6px;
    padding-bottom: 4px;
  }

  .brand {
    gap: 8px;
  }

  .brand > div {
    min-width: 0;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    max-width: 120px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .icon-actions {
    gap: 4px;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .data-status:not([hidden]) {
    min-height: 36px;
    margin-bottom: 7px;
    padding-block: 6px;
  }

  .data-status span {
    font-size: 11px;
  }

  .control-row {
    margin-block: 7px 10px;
  }

  .dashboard-intro {
    margin-top: 6px;
  }

  .period-dashboard-grid {
    gap: 12px;
  }

  .period-card {
    padding: 12px;
  }

  .period-metrics {
    margin-block: 12px 14px;
  }

  .metric-card {
    min-height: 150px;
    padding: 12px;
  }

  .period-chart-empty {
    min-height: 120px;
    height: 120px;
    padding: 10px;
  }

  .combined-line-chart {
    height: 250px;
  }

  .combined-chart-tooltip {
    max-width: calc(100% - 16px);
  }

  .tabbar button {
    height: 52px;
  }

  .custom-range,
  .calendar-overlay {
    padding-inline: 10px;
  }
}

@media (min-width: 1120px) {
  :root {
    --sticky-header-height: 68px;
  }

  .app-shell {
    padding-top: 0;
    padding-bottom: 32px;
  }

  .app-top {
    min-height: 68px;
  }

  .tabbar {
    padding-bottom: 6px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .combined-line-chart {
    height: 220px;
  }

  .calendar-dialog {
    gap: 7px;
    padding: 10px;
  }
}

/* Dashboard editorial hierarchy */
.dashboard-story,
.dashboard-momentum {
  display: grid;
  gap: 12px;
}

.dashboard-story {
  margin-top: 12px;
}

.dashboard-takeaways,
.dashboard-priority,
.momentum-panel {
  min-width: 0;
  padding: 16px;
  border-block: 1px solid var(--line);
  background: rgba(13, 17, 35, .48);
}

.dashboard-band-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.dashboard-band-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.band-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--purple);
  background: rgba(124, 77, 255, .16);
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
}

.band-icon.insight,
.momentum-panel.winner .band-icon {
  color: var(--green);
  background: rgba(34, 245, 154, .12);
}

.band-icon.priority,
.momentum-panel.watch .band-icon {
  color: var(--amber);
  background: rgba(245, 155, 59, .14);
}

.takeaway-list {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.takeaway,
.dashboard-priority > p,
.momentum-panel p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.takeaway {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.takeaway i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.takeaway.positive i { background: var(--green); }
.takeaway.warning i { background: var(--amber); }

.dashboard-priority > p {
  margin-top: 13px;
}

.dashboard-momentum {
  margin-top: 2px;
}

.momentum-panel > div:last-child {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.momentum-panel p:not(.momentum-empty) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.momentum-panel p > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.momentum-panel img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.momentum-empty {
  color: var(--muted) !important;
  font-size: 12px !important;
}

@media (min-width: 860px) {
  [data-view="dashboard"].active > .dashboard-story,
  [data-view="dashboard"].active > .objectives-panel,
  [data-view="dashboard"].active > .dashboard-momentum {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .dashboard-story,
  .dashboard-momentum {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .period-card[data-period-card="today"],
  .period-card[data-period-card="year"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .dashboard-intro {
    margin-bottom: 2px;
  }

  .dashboard-story {
    margin-top: 8px;
  }

  .dashboard-takeaways,
  .dashboard-priority,
  .momentum-panel {
    padding: 13px 4px;
  }
}

.reference-date-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.reference-date-control label {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #33405f;
  border-radius: 7px;
  color: #eef2ff;
  background: #11172a;
}

.reference-date-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #9c83ff;
  stroke-width: 1.8;
}

.reference-date-control input {
  min-width: 126px;
  border: 0;
  outline: 0;
  color: #eef2ff;
  background: transparent;
  color-scheme: dark;
  font-size: 12px;
  font-weight: 850;
}

.reference-date-control label:focus-within {
  border-color: #8b6cff;
  box-shadow: 0 0 0 3px rgba(109, 74, 255, .2);
}

.reference-date-control button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  color: #9c83ff;
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.reference-date-control button:hover,
.reference-date-control button:focus-visible {
  color: #fff;
  background: #232d4d;
  outline: none;
}

.combined-chart-shell {
  min-width: 0;
  margin-top: 4px;
}

.combined-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.combined-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.combined-chart-legend i,
.combined-chart-tooltip i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--series-color, currentColor);
}

.chart-scale-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.combined-chart-stage {
  min-width: 0;
  position: relative;
}

.combined-line-chart {
  width: 100%;
  height: 300px;
  overflow: visible;
  touch-action: pan-y;
}

.combined-line-chart polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.combined-line-chart .current-line {
  stroke-width: 3;
}

.combined-line-chart .comparison-line {
  stroke-width: 2;
  stroke-dasharray: 6 6;
  opacity: .4;
}

.combined-line-chart circle {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 2;
  pointer-events: none;
}

.combined-line-chart .comparison-point {
  opacity: .4;
}

.series-revenue { --series-color: #12b981; color: var(--series-color); stroke: var(--series-color); }
.series-visitors { --series-color: #2f6fff; color: var(--series-color); stroke: var(--series-color); }
.series-pageviews { --series-color: #c23be2; color: var(--series-color); stroke: var(--series-color); }
.series-rpm { --series-color: #e88724; color: var(--series-color); stroke: var(--series-color); }

.chart-hit {
  fill: transparent;
  pointer-events: all;
}

.combined-chart-tooltip {
  width: 200px;
  position: absolute;
  z-index: 4;
  top: 10px;
  padding: 10px;
  border: 1px solid #364363;
  border-radius: 8px;
  color: #f8fafc;
  background: rgba(9, 14, 30, .96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  pointer-events: none;
}

.combined-chart-tooltip[hidden] {
  display: none;
}

.combined-chart-tooltip > strong,
.combined-chart-tooltip > em {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.combined-chart-tooltip > em {
  margin-top: 8px;
  color: #aeb8d0;
  font-style: normal;
  font-weight: 850;
}

.combined-chart-tooltip > div {
  display: grid;
  gap: 4px;
}

.combined-chart-tooltip span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 6px;
  align-items: center;
  color: #cbd5e1;
  font-size: 10px;
}

.combined-chart-tooltip span strong {
  color: #fff;
}

@media (min-width: 1100px) {
  .combined-line-chart {
    height: 370px;
  }
}

@media (max-width: 700px) {
  .reference-date-control {
    flex-wrap: wrap;
  }

  .combined-line-chart {
    height: 270px;
  }

  .combined-chart-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final touch-target overrides for controls declared after the PWA shell. */
.reference-date-control label,
.reference-date-control button {
  min-height: 44px;
}

@media (max-width: 700px) {
  .combined-line-chart {
    height: 250px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .combined-line-chart {
    height: 220px;
  }
}

.metric-card {
  padding-bottom: 54px;
}

/* Keep chrome rules last: the legacy PWA layer above also styles these controls. */
.app-shell {
  max-width: none;
}

/* Desktop: identity, actions and navigation share one sticky toolbar. */
.app-toolbar {
  display: contents;
}

@media (min-width: 1024px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "toolbar"
      "status"
      "controls"
      "summary"
      "content";
  }

  .app-shell:has(.data-status[hidden]) {
    grid-template-areas:
      "toolbar"
      "controls"
      "summary"
      "content";
  }

  .app-shell:has(.period-summary[hidden]) {
    grid-template-areas:
      "toolbar"
      "status"
      "controls"
      "content";
  }

  .app-shell:has(.data-status[hidden]):has(.period-summary[hidden]) {
    grid-template-areas:
      "toolbar"
      "controls"
      "content";
  }

  .app-toolbar {
    grid-area: toolbar;
    position: sticky;
    top: 0;
    z-index: 60;
    min-width: 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.4vw, 22px);
    padding: 5px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    transition: min-height 200ms ease, padding 200ms ease, background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease, backdrop-filter 200ms ease;
  }

  .header-scrolled .app-toolbar {
    min-height: 56px;
    padding-block: 3px;
    border-color: var(--chrome-line);
    background: rgba(8, 12, 28, .86);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
  }

  .app-toolbar .app-top {
    position: static;
    flex: 1 1 auto;
    min-width: 230px;
    min-height: 48px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-scrolled .app-toolbar .app-top {
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .app-toolbar .icon-actions {
    flex: 0 0 auto;
    align-items: center;
  }

  .app-toolbar .tabbar {
    position: static;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    transform: none;
    align-self: center;
    display: grid;
    grid-template-columns: repeat(5, max-content);
    gap: 3px;
    padding: 3px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-scrolled .app-toolbar .tabbar {
    background: transparent;
  }

  .app-toolbar .tabbar button {
    height: 38px;
    grid-template-columns: 17px auto;
    gap: 6px;
    padding-inline: clamp(7px, .7vw, 11px);
    border-radius: 6px;
  }

  .data-status:not([hidden]) {
    top: 60px;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .app-toolbar {
    gap: 8px;
  }

  .app-toolbar .brand p {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-toolbar .tabbar button {
    padding-inline: 7px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toolbar {
    transition: none;
  }
}

.icon-button {
  border-color: var(--chrome-line);
  border-radius: var(--ui-control-radius);
  color: #c7d0e6;
  background: rgba(18, 24, 47, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.icon-button:hover {
  color: #fff;
  border-color: rgba(151, 122, 255, .42);
  background: rgba(124, 77, 255, .14);
}

.sign-out-button {
  color: #d6a1ad;
}

.activity-syncing .icon-button#syncButton {
  animation: none;
}

.tabbar {
  border-color: var(--chrome-line);
  background: rgba(9, 13, 29, .76);
  box-shadow: 0 -8px 26px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.tabbar button {
  color: var(--chrome-muted);
}

.tabbar button.active {
  color: #b8a4ff;
  background: rgba(124, 77, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

@media (max-width: 1119px) {
  .app-top {
    background: rgba(7, 11, 26, .66);
    border-bottom: 1px solid rgba(157, 174, 218, .08);
    box-shadow: none;
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
  }

  .header-scrolled .app-top {
    background: rgba(7, 11, 26, .88);
    border-bottom-color: var(--chrome-line);
    backdrop-filter: blur(20px) saturate(1.16);
    -webkit-backdrop-filter: blur(20px) saturate(1.16);
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }
}

@media (min-width: 1120px) {
  .app-top {
    min-height: 52px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: var(--ui-panel-radius);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-scrolled .app-top {
    border-color: var(--chrome-line);
    background: rgba(8, 12, 28, .7);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
  }

  .icon-button {
    width: 38px;
    height: 38px;
    background: rgba(18, 24, 47, .32);
  }

  .tabbar {
    top: 10px;
    padding: 4px;
    border-radius: var(--ui-control-radius);
    background: rgba(9, 13, 29, .34);
    box-shadow: none;
  }

  .header-scrolled .tabbar {
    background: rgba(9, 13, 29, .72);
  }

  .tabbar button {
    height: 36px;
    border-radius: 6px;
  }
}
