/* Same palette as the Gunly Analytics plugin ships to clients, so the admin and
   the client dashboard read as one product. Values mirror the plugin's
   "Gunly Admin alpha design system" block. */
:root {
  --orange: #F45A27;
  --orange-soft: #FFF0E8;
  --action: #C2451C;
  --ink: #1D2327;
  --body: #3C434A;
  --muted: #646970;
  --border: #C3C4C7;
  --border-subtle: #DCDCDE;
  --field-border: #8C8F94;
  --bg: #F0F0F1;
  --panel: #FFFFFF;
  --sunken: #F6F7F7;
  --app-bar: #0C151B;
  --success: #00A32A;
  --warning: #DBA617;
  --error: #D63638;
  --info: #2271B1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 30px;
  border: 1px solid var(--action);
  border-radius: 3px;
  padding: 0 12px;
  background: var(--action);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  box-shadow: none;
}

button.dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

button.ghost {
  border-color: var(--border);
  background: #fff;
  color: #333840;
}

button:disabled {
  border-color: #d7dade;
  background: #eef0f2;
  color: #8a9099;
  cursor: not-allowed;
}

a {
  color: #b04410;
  font-weight: 800;
  text-decoration: none;
}

.pill {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f2f3f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 30, 38, 0.08);
}

.login-card h1 {
  margin: 12px 0 4px;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.login-card label,
.settings-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: #3b4047;
  font-weight: 700;
}

.login-card input,
.settings-form input,
.settings-form select,
.settings-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}

.settings-form textarea {
  min-height: 128px;
  resize: vertical;
}

.compact-select {
  min-height: 39px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: #333840;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 850;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: #f7f7f8;
  padding: 10px 8px 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 6px 12px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 2px 0;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: transparent;
  color: #383d44;
  text-align: left;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.nav:hover,
.nav.active {
  background: var(--orange-soft);
  color: #933b12;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-icon {
  display: inline-flex;
  flex: 0 0 17px;
  align-items: center;
  justify-content: center;
  color: #101214;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.nav-label {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 18px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #e7e8ea;
  color: #6f757d;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.nav-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4d535a;
}

.nav-chevron svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.main {
  min-width: 0;
  padding: 28px 32px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.top-actions,
.ranges,
.filters,
.domain-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.range-wrap {
  position: relative;
}

.filters {
  justify-content: space-between;
  margin-bottom: 18px;
}

.ranges button {
  border-color: var(--border);
  background: #fff;
  color: #343840;
}

.ranges button.active {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.custom-range-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 680px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(23, 29, 38, 0.16);
}

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

.calendar-head,
.calendar-presets,
.calendar-fields,
.calendar-actions,
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-head strong {
  font-size: 14px;
}

.calendar-head button,
.calendar-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.calendar-presets,
.calendar-fields {
  margin-bottom: 10px;
}

.calendar-presets button,
.calendar-fields button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.calendar-presets button {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.calendar-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.calendar-fields button {
  min-height: 56px;
  padding: 8px 10px;
  text-align: left;
}

.calendar-fields button.active {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(224, 87, 8, 0.12);
}

.calendar-fields span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-fields strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.calendar-nav {
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-nav strong {
  color: var(--muted);
  font-size: 12px;
}

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

.calendar-month {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fbfbfc;
}

.calendar-month h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

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

.calendar-weekdays {
  margin-bottom: 5px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.calendar-day {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.calendar-day:hover,
.calendar-day.today {
  border-color: rgba(224, 87, 8, 0.42);
}

.calendar-day.in-range {
  background: rgba(224, 87, 8, 0.12);
}

.calendar-day.selected {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.calendar-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.custom-range-popover label,
.modal-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.custom-range-popover input,
.modal-card input,
.settings-form input,
.settings-form select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.domain-filter {
  position: relative;
  justify-content: flex-end;
  max-width: 430px;
  margin-left: auto;
}

.domain-filter > span {
  color: var(--muted);
  font-weight: 750;
}

.domain-select {
  position: relative;
  width: min(430px, 100%);
}

.domain-select-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
  color: #343840;
  text-align: left;
}

.domain-select-button span,
.domain-select-button em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.domain-select-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 390px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(25, 30, 38, 0.14);
}

.domain-search {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
}

.domain-select-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.domain-select-actions button {
  flex: 1;
  border-color: var(--border);
  background: #fff;
  color: #343840;
}

.domain-select-actions button:first-child {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.domain-options {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}

.domain-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  padding: 8px;
  color: #343840;
}

.domain-options label:hover {
  background: #fff3ec;
}

.domain-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
}

.notice {
  margin-bottom: 16px;
  border: 1px solid #f0d7c8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff8f4;
  color: #8a390f;
}

.notice.error {
  border-color: #f0b8b8;
  background: #fff2f2;
  color: #a12828;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.kpi {
  position: relative;
  min-height: 92px;
  overflow: visible;
  padding: 14px 46px 14px 16px;
}

.kpi.good strong {
  color: #22843c;
}

.kpi-info {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
}

.kpi-info:hover,
.kpi-info:focus {
  border-color: var(--orange);
  color: var(--orange);
  outline: none;
}

.kpi-popover {
  position: absolute;
  left: 12px;
  top: calc(100% - 6px);
  z-index: 60;
  display: none;
  width: 286px;
  max-width: calc(100vw - 48px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(25, 30, 38, 0.14);
}

.kpi:nth-child(4n) .kpi-popover {
  right: 12px;
  left: auto;
}

.kpi:hover .kpi-popover,
.kpi:focus-within .kpi-popover,
.kpi:focus .kpi-popover {
  display: grid;
  gap: 8px;
}

.kpi-popover div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #eceff2;
  padding: 7px 0;
}

.kpi-popover div:first-child {
  padding-top: 0;
}

.kpi-popover div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kpi .kpi-popover strong {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.05;
  text-align: right;
  white-space: nowrap;
}

.kpi .kpi-popover span {
  overflow-wrap: anywhere;
  color: #6d737c;
  font-size: 14px;
  line-height: 1.15;
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 25px;
  line-height: 1.1;
}

.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.grid.two {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

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

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

.panel {
  padding: 18px;
  min-width: 0;
}

.panel.wide {
  width: 100%;
}

.grid.three > .panel.heatmap-wide {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(32, 35, 39, 0.26);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(25, 30, 38, 0.22);
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 18px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-color: var(--border);
  border-radius: 7px;
  padding: 0;
  background: #fff;
  color: var(--ink);
}

.skeleton-card span,
.skeleton-card strong,
.skeleton-card small,
.skeleton-block {
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(90deg, #eceff2 0%, #f7f8f9 45%, #eceff2 90%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.1s linear infinite;
  color: transparent !important;
}

.skeleton-card span {
  width: 50%;
  height: 15px;
}

.skeleton-card strong {
  width: 80%;
  height: 34px;
}

.skeleton-card small {
  width: 65%;
  height: 14px;
}

.dashboard-loader[hidden] {
  display: none;
}

.dashboard-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 32px;
  overflow: hidden;
  background: rgba(245, 247, 249, 0.68);
  backdrop-filter: blur(4px);
}

.loader-page {
  position: relative;
  display: grid;
  width: min(1180px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  gap: 14px;
  border: 1px solid rgba(211, 216, 222, 0.94);
  border-radius: 8px;
  padding: 18px;
  overflow: hidden;
  background: #f0f0f1;
  box-shadow: 0 18px 60px rgba(29, 35, 39, 0.12);
}

.loader-page-bar,
.loader-page-kpis i,
.loader-page-grid i {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(211, 216, 222, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 248, 250, 0.9));
}

.loader-page-bar::after,
.loader-page-kpis i::after,
.loader-page-grid i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(224, 87, 8, 0.1), transparent);
  background-size: 220% 100%;
  animation: skeleton-shimmer 2.6s linear infinite;
}

.loader-page-bar {
  height: 54px;
  background:
    linear-gradient(90deg, #191e22 0 42px, transparent 42px 58px, #dfe4e8 58px 190px, transparent 190px calc(100% - 390px), #eef1f3 calc(100% - 390px) calc(100% - 230px), transparent calc(100% - 230px) calc(100% - 174px), #F45A27 calc(100% - 174px) calc(100% - 88px), transparent calc(100% - 88px) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 251, 0.92));
}

.loader-page-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px;
}

.loader-page-kpis i {
  min-height: 106px;
}

.loader-page-kpis i::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 22px;
  width: 42%;
  height: 12px;
  border-radius: 999px;
  background: #dfe4e8;
  box-shadow: 0 32px 0 #cbd2d8, 0 56px 0 #edf1f3;
}

.loader-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.8fr);
  gap: 14px;
}

.loader-page-grid i {
  min-height: 220px;
}

.loader-page-grid i.wide {
  grid-row: span 2;
  min-height: 454px;
}

.loader-page-grid i::before {
  content: "";
  position: absolute;
  inset: 28px 24px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 0 72%, rgba(224, 87, 8, 0.16) 72% 73%, transparent 73% 100%),
    linear-gradient(90deg, rgba(25, 30, 34, 0.1) 1px, transparent 1px) 0 0 / 54px 54px,
    linear-gradient(0deg, rgba(25, 30, 34, 0.08) 1px, transparent 1px) 0 0 / 54px 54px;
}

.loader-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  width: min(880px, calc(100vw - 36px));
  min-height: 370px;
  border: 1px solid rgba(224, 87, 8, 0.22);
  border-radius: 8px;
  padding: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf7 100%);
  box-shadow: 0 24px 70px rgba(25, 30, 38, 0.18);
}

.loader-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(224, 87, 8, 0.12);
  border-radius: 8px;
  pointer-events: none;
}

.loader-visual {
  position: relative;
  display: grid;
  grid-template-columns: 74px repeat(4, minmax(0, 1fr));
  grid-template-rows: 42px 54px 72px 56px;
  gap: 10px;
  min-height: 292px;
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(145deg, #191e22 0%, #2b2f35 56%, #3a2a22 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.loader-reticle {
  position: absolute;
  left: 58%;
  top: 58%;
  z-index: 4;
  width: 148px;
  height: 148px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.22)) center / 100% 2px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.22)) center / 2px 100% no-repeat;
  transform: translate(-50%, -50%);
  animation: loader-pulse 1.8s ease-in-out infinite;
}

.loader-reticle::before {
  content: "";
  position: absolute;
  inset: 34px;
  border: 1px solid rgba(224, 87, 8, 0.75);
  border-radius: 50%;
}

.loader-reticle::after {
  content: "";
  position: absolute;
  inset: 62px;
  border: 5px solid rgba(224, 87, 8, 0.82);
  border-radius: 50%;
}

.loader-scan {
  position: absolute;
  inset: 0 18px auto 114px;
  z-index: 5;
  height: 36%;
  border-radius: 999px 8px 8px 999px;
  background: linear-gradient(180deg, rgba(224, 87, 8, 0), rgba(224, 87, 8, 0.38), rgba(255, 255, 255, 0.18), rgba(224, 87, 8, 0));
  animation: loader-scan 4.05s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.loader-box {
  position: relative;
  z-index: 3;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(224, 87, 8, 0.58), rgba(242, 161, 95, 0.16));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.loader-box.menu {
  grid-column: 1;
  grid-row: 1 / 5;
  background: linear-gradient(180deg, rgba(15, 18, 22, 0.86), rgba(224, 87, 8, 0.24));
}

.loader-box.topbar {
  grid-column: 2 / 6;
  grid-row: 1;
}

.loader-box.kpi-one {
  grid-column: 2;
  grid-row: 2;
}

.loader-box.kpi-two {
  grid-column: 3;
  grid-row: 2;
}

.loader-box.kpi-three {
  grid-column: 4;
  grid-row: 2;
}

.loader-box.chart {
  grid-column: 2 / 4;
  grid-row: 3 / 5;
}

.loader-box.table {
  grid-column: 4;
  grid-row: 3 / 5;
}

.loader-box.side {
  grid-column: 5;
  grid-row: 2 / 5;
}

.loader-box::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 30%;
  top: 14px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.loader-box::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 18px;
  bottom: 14px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

.loader-box.menu::before {
  z-index: 2;
  left: 18px;
  right: 20px;
  top: 18px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 42px 0 rgba(255, 255, 255, 0.22),
    0 70px 0 rgba(255, 255, 255, 0.18),
    0 98px 0 rgba(255, 255, 255, 0.22),
    0 126px 0 rgba(255, 255, 255, 0.16),
    0 154px 0 rgba(255, 255, 255, 0.2);
}

.loader-box.topbar::before {
  left: 16px;
  right: 58%;
  top: 13px;
  box-shadow: 0 14px 0 rgba(255, 255, 255, 0.18);
}

.loader-box.topbar::after {
  left: auto;
  right: 16px;
  top: 11px;
  bottom: auto;
  width: 82px;
  height: 20px;
  background: rgba(255, 255, 255, 0.3);
}

.loader-box.chart::before {
  inset: 18px;
  height: auto;
  border-radius: 7px;
  background:
    linear-gradient(180deg, transparent 0 68%, rgba(224, 87, 8, 0.18) 68% 70%, transparent 70% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px) 0 0 / 36px 36px;
  box-shadow: none;
}

.loader-box.chart::after {
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 48%;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(224, 87, 8, 0.48), rgba(224, 87, 8, 0.12));
  clip-path: polygon(0 72%, 18% 52%, 34% 62%, 52% 34%, 72% 48%, 100% 22%, 100% 100%, 0 100%);
}

.loader-box.table::before {
  left: 14px;
  right: 14px;
  top: 20px;
  height: 6px;
  box-shadow:
    0 24px 0 rgba(255, 255, 255, 0.22),
    0 48px 0 rgba(255, 255, 255, 0.28),
    0 72px 0 rgba(255, 255, 255, 0.18);
}

.loader-box.table::after {
  left: 14px;
  right: 52%;
  top: 20px;
  bottom: auto;
  height: 6px;
  background: rgba(224, 87, 8, 0.62);
  box-shadow:
    0 24px 0 rgba(224, 87, 8, 0.34),
    0 48px 0 rgba(224, 87, 8, 0.42),
    0 72px 0 rgba(224, 87, 8, 0.28);
}

.loader-box.side::before {
  left: 16px;
  right: 22px;
  top: 18px;
  height: 8px;
  box-shadow:
    0 36px 0 rgba(255, 255, 255, 0.2),
    0 62px 0 rgba(255, 255, 255, 0.28);
}

.loader-box.side::after {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border: 10px solid rgba(224, 87, 8, 0.48);
  border-left-color: rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: transparent;
  transform: translateX(-50%);
}

.loader-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.loader-copy span,
.loader-copy small {
  display: block;
  color: var(--muted);
  font-weight: 750;
}

.loader-copy span {
  color: var(--action);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loader-copy strong {
  display: block;
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1.12;
}

.loader-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.loader-tags i {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(224, 87, 8, 0.24);
  border-radius: 999px;
  padding: 5px 11px;
  background: #fff7f2;
  color: #90390f;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.loader-lines {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.loader-lines i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eceff2 0%, #f7f8f9 45%, #eceff2 90%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.1s linear infinite;
}

.loader-lines i:nth-child(2) {
  width: 78%;
}

.loader-lines i:nth-child(3) {
  width: 56%;
}

/* Loading never hides the view: the skeleton renders in place, where the
   figures will land, instead of behind a separate loader window. */

.app-shell.is-paint-ready {
  transform: translateZ(0);
  backface-visibility: hidden;
}

@keyframes skeleton-shimmer {
  to {
    background-position: -220% 0;
  }
}

@keyframes loader-scan {
  0% {
    transform: translateY(-120%);
  }
  55%,
  100% {
    transform: translateY(310%);
  }
}

@keyframes loader-pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

.panel h2,
.panel-head h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
}

.chart-shell {
  position: relative;
  height: 260px;
  min-height: 220px;
  border-radius: 8px;
  overflow: hidden;
}

.chart-shell canvas {
  height: 100% !important;
  min-height: 0;
  opacity: 1;
  transition: opacity 120ms ease;
}

.chart-shell.is-loading canvas,
.chart-shell.skeleton-block canvas {
  opacity: 0;
}

.chart-loader {
  position: absolute;
  inset: 0;
  display: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #eceff2 0%, #f7f8f9 45%, #eceff2 90%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.1s linear infinite;
}

.chart-shell.is-loading .chart-loader,
.chart-shell.skeleton-block .chart-loader {
  display: block;
}

.chart-shell.is-ready .chart-loader {
  display: none;
}

.big-number {
  margin: 4px 0 16px;
  color: #2c8d2c;
  font-size: 42px;
  font-weight: 850;
}

.live-panel {
  display: flex;
  min-height: 360px;
  flex-direction: column;
}

.live-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.live-panel-head h2 {
  margin: 3px 0 0;
}

.live-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.live-visitor-count {
  display: grid;
  grid-template-columns: 9px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  min-width: 76px;
}

.live-visitor-count i {
  grid-row: 1;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a8adb4;
  box-shadow: 0 0 0 4px rgba(168, 173, 180, 0.14);
}

.live-panel.has-live-visitors .live-visitor-count i {
  background: #2f8f46;
  box-shadow: 0 0 0 4px rgba(47, 143, 70, 0.14);
}

.live-visitor-count strong {
  grid-column: 2;
  color: var(--ink);
  font-size: 30px;
  font-weight: 850;
  line-height: 0.95;
}

.live-visitor-count small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.live-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.live-health-item {
  min-width: 0;
  padding: 14px 0;
}

.live-health-item:nth-child(odd) {
  border-right: 1px solid var(--border);
  padding-right: 14px;
}

.live-health-item:nth-child(even) {
  padding-left: 14px;
}

.live-health-item:nth-child(n + 3) {
  border-top: 1px solid var(--border);
}

.live-health-item span,
.live-health-item small,
.live-last-event span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.live-health-item strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 820;
  line-height: 1.1;
}

.live-health-item small {
  margin-top: 3px;
}

.live-last-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.live-last-event strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #3f454d;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  text-align: right;
}

.mini-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-cards-wide {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.quality-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mini-card {
  min-height: 78px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fbfbfc;
}

.mini-card span,
.mini-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-card strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 20px;
  line-height: 1.15;
}

.mini-cards-wide .mini-card {
  min-height: 112px;
  padding: 16px;
}

.mini-cards-wide .mini-card strong {
  font-size: 22px;
}

.quality-cards .mini-card {
  min-height: 118px;
}

.quality-cards .mini-card small {
  line-height: 1.35;
}

.category-breakdown {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: center;
}

.category-ring {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.category-ring .chart-shell {
  min-height: 300px;
}

.category-total {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fbfbfc;
}

.category-total span,
.category-total small {
  color: var(--muted);
  font-weight: 750;
}

.category-total strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.category-ranked .bars {
  gap: 13px;
}

.category-ranked .bar-row {
  min-height: 50px;
}

.category-ranked .bar-row i {
  height: 8px;
  background: linear-gradient(90deg, var(--orange), #f2a15f);
  opacity: 0.86;
}

.ffl-signal-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: stretch;
}

.ffl-signal-main {
  display: grid;
  align-content: end;
  min-height: 178px;
  border-radius: 8px;
  padding: 18px;
  background: linear-gradient(135deg, var(--orange), #f2a15f);
  color: #fff;
}

.ffl-signal-main span,
.ffl-signal-main small {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
}

.ffl-signal-main strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 30px;
  line-height: 1.05;
}

.ffl-signal-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ffl-signal-card {
  min-width: 0;
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fbfbfc;
}

.ffl-signal-card span,
.ffl-signal-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.ffl-signal-card strong {
  display: block;
  overflow-wrap: anywhere;
  margin: 5px 0 3px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.12;
}

.ffl-signal-ranked {
  grid-column: 1 / -1;
}

.ffl-signal-ranked .bars {
  gap: 12px;
}

.ffl-signal-ranked .bar-row {
  min-height: 46px;
}

.ffl-signal-ranked .bar-row i {
  height: 8px;
  background: linear-gradient(90deg, var(--orange), #f2a15f);
  opacity: 0.84;
}

.waterfall {
  display: grid;
  gap: 10px;
}

.waterfall-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
}

.waterfall-row span,
.waterfall-row strong {
  font-size: 12px;
  font-weight: 800;
}

.waterfall-row span {
  color: var(--muted);
}

.waterfall-row i {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: var(--orange);
}

.waterfall-row.loss i {
  background: #c94f4f;
}

.waterfall-row.gain i {
  background: #2f6f9f;
}

.waterfall-row.total i {
  background: var(--ink);
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 9px;
}

.heat-cell {
  display: grid;
  gap: 7px;
  align-content: space-between;
  min-height: 72px;
  border: 1px solid rgba(224, 87, 8, 0.18);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.heat-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-cell span {
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
}

.heat-cell strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.08;
  letter-spacing: 0;
}

.treemap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 260px;
}

.tree-cell {
  display: grid;
  align-content: end;
  min-width: 120px;
  min-height: 84px;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
}

.tree-cell strong,
.tree-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-cell strong {
  font-size: 13px;
}

.tree-cell span {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 850;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
}

.donut::after {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 850;
}

.donut-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.donut-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-legend strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend span {
  color: var(--muted);
  font-weight: 750;
}

.setup-grid {
  display: grid;
  gap: 10px;
}

.setup-grid article {
  border: 1px dashed #efc7b1;
  border-radius: 8px;
  padding: 12px;
  background: #fff8f4;
}

.setup-grid strong,
.setup-grid span {
  display: block;
}

.setup-grid span {
  margin-top: 4px;
  color: var(--muted);
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding-bottom: 8px;
}

.bar-row strong,
.bar-row span,
.bar-row em {
  position: relative;
  z-index: 1;
}

.bar-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.bar-row em {
  font-style: normal;
  font-weight: 800;
}

.bar-row i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 6px;
  border-radius: 999px;
  background: var(--orange);
  opacity: 0.76;
}

.funnel-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.funnel-step span {
  text-transform: capitalize;
}

.funnel-step strong {
  font-size: 18px;
}

.funnel-step i {
  grid-column: 1 / -1;
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--orange);
}

.funnel-step small {
  grid-column: 1 / -1;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.table-scroll table {
  min-width: 100%;
}

.module-controls-panel {
  display: none;
}

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

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

.connections-table,
.recent-events-table {
  min-width: 0;
  max-width: 100%;
}

.connections-table table {
  min-width: 1180px;
}

.connections-table td,
.recent-events-table .col-date,
.recent-events-table .col-domain {
  white-space: nowrap;
}

.recent-events-table table {
  min-width: 680px;
  table-layout: fixed;
}

.recent-events-table .col-domain {
  width: 180px;
}

.recent-events-table .col-date {
  width: 145px;
}

.recent-events-table .col-name {
  width: 165px;
}

.recent-events-table td.col-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.empty.compact {
  padding: 12px;
}

.settings-form {
  display: grid;
  gap: 12px;
}

.module-grid {
  display: grid;
  gap: 8px;
}

.module-toggle {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px !important;
  align-items: start;
  margin: 0 !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fbfbfc;
}

.module-toggle input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--orange);
}

.module-toggle strong,
.module-toggle small {
  display: block;
}

.module-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 650;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.check-row {
  display: flex !important;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px !important;
  margin: 0 !important;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--orange);
}

.staged-status {
  min-height: 18px;
  color: #9d3c0b;
  font-size: 12px;
  font-weight: 800;
}

.invite-list {
  display: grid;
  gap: 8px;
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.invite-row:last-child {
  border-bottom: 0;
}

.invite-row strong,
.invite-row small {
  display: block;
}

.invite-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-row small {
  color: var(--muted);
  font-weight: 650;
}

.status-chip {
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff3ec;
  color: #9d3c0b;
  font-size: 12px;
  font-weight: 850;
}

.status-chip.good {
  background: #e8f6ec;
  color: #236d37;
}

.status-chip.bad {
  background: #fff0f0;
  color: #a12828;
}

.readiness-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fafafa;
}

.readiness-score strong {
  font-size: 30px;
}

.readiness-score span {
  color: var(--muted);
  font-weight: 800;
}

.readiness-list {
  display: grid;
  gap: 8px;
}

.readiness-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.readiness-list article.ready {
  border-color: #cfe8d7;
}

.readiness-list article.needs {
  border-color: #f1d2c4;
}

.readiness-list small,
.readiness-list em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.readiness-list span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f1f3f4;
  color: #535a63;
  font-size: 12px;
  font-weight: 850;
}

.readiness-list .ready span {
  background: #dff2e5;
  color: #216b37;
}

.readiness-list .needs span {
  background: #fae8df;
  color: #a34015;
}

.invite-secret {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border: 1px solid #efc7b1;
  border-radius: 8px;
  padding: 12px;
  background: #fff8f4;
}

.invite-secret code {
  overflow-wrap: anywhere;
  border-radius: 7px;
  padding: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
}

.invite-secret small {
  color: var(--muted);
  font-weight: 650;
}

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

@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .kpi:nth-child(2n) .kpi-popover {
    right: 12px;
    left: auto;
  }

  .grid.two,
  .grid.three,
  .grid.two.domain-events-grid {
    grid-template-columns: 1fr;
  }

  .mini-cards-wide {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .category-breakdown {
    grid-template-columns: 1fr;
  }

  .ffl-signal-panel {
    grid-template-columns: 1fr;
  }

  .ffl-signal-cards {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu {
    flex-direction: row;
    flex: 0 0 auto;
    align-items: center;
  }

  .brand {
    min-width: 180px;
    margin-bottom: 0;
  }

  .nav {
    width: auto;
    white-space: nowrap;
  }

  .main {
    padding: 20px 16px 36px;
  }

  .live-panel {
    min-height: 0;
  }

  .topbar,
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-loader {
    padding: 16px;
  }

  .loader-page {
    width: calc(100vw - 32px);
    gap: 12px;
    padding: 12px;
  }

  .loader-page-bar {
    height: 46px;
  }

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

  .loader-page-kpis i {
    min-height: 78px;
  }

  .loader-page-kpis i:nth-child(n+3) {
    display: none;
  }

  .loader-page-grid {
    grid-template-columns: 1fr;
  }

  .loader-page-grid i,
  .loader-page-grid i.wide {
    grid-row: auto;
    min-height: 132px;
  }

  .loader-card {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 22px;
  }

  .loader-visual {
    grid-template-columns: 58px repeat(4, minmax(0, 1fr));
    grid-template-rows: 34px 44px 60px 48px;
    gap: 8px;
    min-height: 230px;
    padding: 14px;
  }

  .loader-scan {
    inset: 0 12px auto 84px;
  }

  .loader-copy strong {
    font-size: 22px;
  }

  .top-actions,
  .ranges,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .custom-range-popover {
    left: 0;
    width: 100%;
    max-width: none;
  }

  .calendar-grid,
  .calendar-fields {
    grid-template-columns: 1fr;
  }

  .top-actions button,
  .ranges button {
    width: 100%;
  }

  .domain-filter,
  .domain-select {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .domain-select-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

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

  .kpi:nth-child(n) .kpi-popover {
    right: auto;
    left: 12px;
    width: calc(100% - 24px);
    max-width: none;
  }

  .mini-cards,
  .ffl-signal-cards,
  .donut-wrap {
    grid-template-columns: 1fr;
  }
}

/* Compact executive dashboard */
.view:not(.dashboard-overview) .dashboard-metric-card .metric-detail-button {
  display: none;
}

.search-platform-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  scrollbar-width: thin;
}

[data-search-connectors] {
  grid-template-columns: minmax(0, 1fr);
}

.search-platform-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}

.search-platform-tabs button:hover,
.search-platform-tabs button:focus-visible {
  border-color: var(--border);
  background: #f7f8f9;
}

.search-platform-tabs button.is-active {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.search-platform-panel {
  display: none;
}

.search-platform-panel.is-active {
  display: block;
}

.search-platform-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.search-platform-stat {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.search-platform-stat span,
.search-platform-stat small {
  display: block;
  color: var(--muted);
}

.search-platform-stat span {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-platform-stat strong {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.12;
}

.search-platform-stat small {
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-overview {
  gap: 26px;
}

.overview-intro,
.section-heading,
.overview-band-head {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}

.overview-intro span,
.section-heading span,
.overview-band-head span {
  display: block;
  margin-bottom: 5px;
  color: var(--gunly-orange);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.overview-intro h2,
.section-heading h2,
.overview-band-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.overview-intro p,
.section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--gunly-muted);
  font-size: 14px;
  line-height: 1.5;
}

.dashboard-card-grid,
.integration-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-card-grid.is-detail {
  margin-bottom: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-metric-card,
.integration-card {
  display: flex;
  min-width: 0;
  min-height: 190px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #dce2e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(24, 31, 39, 0.04);
}

.dashboard-metric-card.is-wide {
  grid-column: span 2;
}

.dashboard-metric-head {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.dashboard-metric-head > span {
  min-width: 0;
  color: #69727c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.dashboard-metric-card > strong,
.integration-card > strong {
  display: block;
  margin-top: 15px;
  color: #20252b;
  font-size: 26px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.dashboard-metric-card > p,
.integration-card > p {
  margin: 8px 0 16px;
  color: #68727c;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.metric-status {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef1f3;
  color: #5d6670;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
  overflow-wrap: anywhere;
}

.metric-status.is-live {
  background: #e8f5e7;
  color: #2f7a33;
}

.metric-status.is-ai,
.metric-status.is-watch {
  background: #fff0e7;
  color: #a94006;
}

.metric-detail-button,
.text-link {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 7px 10px;
  border: 1px solid #d7dde2;
  border-radius: 6px;
  background: #fff;
  color: #343c44;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.metric-detail-button:hover,
.text-link:hover {
  border-color: var(--gunly-orange);
  color: var(--gunly-orange);
}

.overview-band {
  padding-top: 4px;
}

.overview-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.overview-visual {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dce2e7;
  border-radius: 8px;
  background: #fff;
}

.overview-visual.is-wide {
  grid-column: 1 / -1;
}

.overview-visual .panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.overview-visual .text-link {
  margin-top: 0;
}

@media (max-width: 1380px) {
  .dashboard-card-grid,
  .integration-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-metric-card.is-wide {
    grid-column: span 1;
  }
}

@media (max-width: 980px) {
  .search-platform-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-card-grid,
  .dashboard-card-grid.is-detail,
  .integration-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .search-platform-stat-grid {
    grid-template-columns: 1fr;
  }

  .overview-intro,
  .section-heading,
  .overview-band-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-card-grid,
  .dashboard-card-grid.is-detail,
  .integration-card-grid,
  .overview-visual-grid {
    grid-template-columns: 1fr;
  }

  .overview-visual.is-wide,
  .dashboard-metric-card.is-wide {
    grid-column: auto;
  }
}

.ai-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-color: rgba(224, 87, 8, 0.18);
  background: linear-gradient(135deg, #fff 0%, #fff7f2 100%);
}

.ai-hero h2 {
  margin-bottom: 6px;
}

.ai-hero p,
.ai-actions span {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.ai-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ai-summary-row article {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(25, 30, 38, 0.08);
}

.ai-summary-row span,
.ai-summary-row small {
  display: block;
  color: var(--muted);
  font-weight: 760;
}

.ai-summary-row strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 28px;
  line-height: 1.08;
}

.ai-forecast-panel {
  margin-bottom: 18px;
}

.ai-forecast-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.ai-forecast-grid article {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcfd);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.ai-forecast-grid article.is-watch {
  border-color: #f2b995;
  background: #fff7f2;
}

.ai-forecast-grid span,
.ai-forecast-grid small,
.ai-forecast-grid em {
  display: block;
}

.ai-forecast-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ai-forecast-grid strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.05;
}

.ai-forecast-grid small {
  min-height: 34px;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.3;
}

.ai-forecast-grid em {
  margin-top: 10px;
  color: var(--orange);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-panel .ai-list {
  display: grid;
  gap: 10px;
}

.ai-panel.wide .ai-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid #55a3e6;
  border-radius: 8px;
  background: #fff;
}

.ai-item.medium {
  border-left-color: #ffc861;
}

.ai-item.high {
  border-left-color: var(--orange);
  background: #fff7f2;
}

.ai-item strong,
.ai-item span {
  display: block;
}

.ai-item strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.ai-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ai-item em {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f2f4;
  color: #5d636b;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .ai-hero,
  .ai-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .ai-panel.wide .ai-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .ai-forecast-grid {
    grid-template-columns: 1fr;
  }
}

/* Client dashboard visual parity for the central multi-site admin. */
.app-shell {
  background: var(--bg);
}

.main {
  padding: 28px 32px 48px;
}

.topbar h1 {
  font-size: 26px;
  line-height: 1.2;
}

.topbar p {
  color: var(--muted);
  font-weight: 600;
}

.top-actions button,
.compact-select,
.ranges button,
.domain-select-button {
  min-height: 39px;
}

.top-actions button,
.ranges button,
.domain-select-actions button,
.compact-select {
  border-radius: 7px;
  font-weight: 750;
}

.filters {
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
}

.ranges {
  justify-content: flex-start;
}

.ranges button.active {
  box-shadow: 0 8px 18px rgba(224, 87, 8, 0.14);
}

.domain-filter {
  max-width: 520px;
}

.demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #5f6872;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.demo-toggle input {
  margin: 0;
}

.domain-select-button {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(25, 30, 38, 0.04);
}

.view > .panel {
  margin-bottom: 14px;
}

.view > .panel:last-child {
  margin-bottom: 0;
}

.kpi,
.panel {
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.panel h2,
.panel-head h2 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
}

.panel-head {
  margin-bottom: 8px;
}

.chart-shell {
  background: #fff;
}

.mini-cards {
  gap: 10px;
}

.mini-card {
  min-height: 92px;
  background: #fafbfc;
}

.mini-cards-wide .mini-card {
  min-height: 112px;
}

.panel:hover,
.kpi:hover,
.mini-card:hover,
.nav:hover,
.domain-select-button:hover,
.ranges button:hover,
.top-actions button:hover {
  transform: none;
}

table {
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

td {
  color: #343940;
  font-weight: 600;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.035);
}

.settings-tabs button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 13px;
  background: #fff;
  color: #3d4249;
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}

.settings-tabs button:hover,
.settings-tabs button:focus {
  border-color: rgba(224, 87, 8, 0.55);
  color: #933b12;
  outline: none;
}

.settings-tabs button.is-active {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.settings-panel {
  display: none;
}

.settings-panel.is-active {
  display: block;
}

.settings-panel > .grid,
.settings-panel > .panel {
  margin-bottom: 14px;
}

.settings-panel > :last-child {
  margin-bottom: 0;
}

.settings-form label {
  color: #4b5560;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  font-size: 13px;
  font-weight: 500;
}

.settings-form button {
  min-height: 39px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
}

.mini-card span,
.mini-card small {
  font-weight: 650;
}

.panel h2,
.panel-head h2 {
  font-size: 16px;
}

[data-copy-summary],
[data-ad-spend],
[data-export],
[data-export-pdf],
[data-export-html],
[data-export-dataset],
[data-refresh] {
  display: none !important;
}

.gunly-ai-open { overflow: hidden; }

.gunly-ai-assistant-root {
  --gunly-orange: var(--orange);
  --gunly-ink: var(--ink);
  --gunly-muted: var(--muted);
  color: var(--gunly-ink);
}

.gunly-ai-assistant-root,
.gunly-ai-assistant-root * { box-sizing: border-box; }

.gunly-ai-launcher {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 80;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: visible;
  border: 5px solid var(--gunly-orange);
  border-radius: 50%;
  background: #000;
  color: #fff;
  box-shadow: 0 16px 38px rgba(25, 30, 38, 0.2), 0 0 0 6px rgba(224, 87, 8, 0.08);
  cursor: pointer;
  font-size: 0;
}

.gunly-ai-launcher:hover { box-shadow: 0 16px 38px rgba(25, 30, 38, 0.22), 0 0 0 7px rgba(224, 87, 8, 0.14); }
.gunly-ai-launcher:focus-visible { outline: 3px solid rgba(224, 87, 8, 0.3); outline-offset: 4px; }

.gunly-ai-launcher-mark {
  display: grid;
  width: 43px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  background: #111;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.gunly-ai-launcher-mark strong { color: var(--gunly-orange); font-size: 30px; line-height: 1; }
.gunly-ai-launcher em { position: absolute; top: 13px; right: 11px; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; }

.gunly-ai-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 18, 24, 0.18);
}

.gunly-ai-chat-modal[hidden] { display: none; }

.gunly-ai-chat-dialog {
  display: flex;
  width: min(1720px, calc(100vw - 28px));
  height: calc(100vh - 34px);
  margin: 14px auto 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dce6ee;
  border-radius: 15px;
  background: #edf3f7;
  box-shadow: 0 30px 84px rgba(22, 28, 36, 0.22);
}

.gunly-ai-chat-dialog svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.35;
}

.gunly-ai-chat-head {
  display: flex;
  min-height: 86px;
  flex: 0 0 auto;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #dce6ee;
  background: #fff;
}

.gunly-ai-chat-brand { display: flex; gap: 12px; align-items: center; }
.gunly-ai-chat-brand strong, .gunly-ai-chat-brand small { display: block; letter-spacing: 0; }
.gunly-ai-chat-brand strong { color: #1f252c; font-size: 21px; font-weight: 750; line-height: 1.05; }
.gunly-ai-chat-brand small { margin-top: 5px; color: #77818c; font-size: 13px; font-weight: 600; text-transform: uppercase; }

.gunly-ai-chat-brand-icon,
.gunly-ai-chat-panel-icon {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: var(--gunly-orange);
  color: #fff;
  box-shadow: 0 10px 22px rgba(224, 87, 8, 0.18);
}

.gunly-ai-chat-brand-icon { width: 34px; height: 34px; border-radius: 9px; background: rgba(224, 87, 8, 0.12); color: var(--gunly-orange); box-shadow: none; }

.gunly-ai-chat-head > button {
  display: grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #d9e5ee;
  border-radius: 10px;
  background: #fff;
  color: #172636;
  box-shadow: 0 6px 14px rgba(22, 28, 36, 0.04);
}

.gunly-ai-chat-head > button:hover { border-color: rgba(224, 87, 8, 0.38); color: var(--gunly-orange); }

.gunly-ai-chat-body {
  display: grid;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(280px, 0.85fr) minmax(520px, 1.85fr) minmax(270px, 0.72fr);
  gap: 16px;
  padding: 16px;
  background: #edf3f7;
}

.gunly-ai-chat-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d9e5ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(22, 28, 36, 0.05);
}

.gunly-ai-chat-rail { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.gunly-ai-chat-main, .gunly-ai-chat-tools-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }

.gunly-ai-chat-panel-head {
  display: flex;
  min-height: 86px;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid #d9e5ee;
  background: #fff;
}

.gunly-ai-chat-panel-head > div:not(.gunly-ai-chat-view-actions) { min-width: 0; }
.gunly-ai-chat-panel-head h3 { margin: 0; color: #1f252c; font-size: 20px; font-weight: 750; line-height: 1.12; }
.gunly-ai-chat-panel-head p { margin: 5px 0 0; color: #77818c; font-size: 13px; line-height: 1.28; }

.gunly-ai-chat-history,
.gunly-ai-chat-messages {
  min-height: 0;
  overflow: auto;
  background-color: #fff;
  background-image: radial-gradient(rgba(224, 87, 8, 0.075) 1px, transparent 1px);
  background-size: 23px 23px;
}

.gunly-ai-chat-history { padding: 16px; }
.gunly-ai-chat-messages { padding: 18px; }
.gunly-ai-chat-history-empty { display: grid; min-height: 100%; place-items: center; align-content: center; gap: 10px; text-align: center; }
.gunly-ai-chat-history-empty span { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 12px; background: rgba(224, 87, 8, 0.1); color: var(--gunly-orange); }
.gunly-ai-chat-history-empty p { max-width: 220px; margin: 0; color: #7b858f; font-size: 13px; line-height: 1.38; }

.gunly-ai-chat-history > button {
  display: grid;
  width: 100%;
  gap: 5px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #d9e5ee;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #2c333b;
  text-align: left;
}

.gunly-ai-chat-history > button:hover { border-color: rgba(224, 87, 8, 0.34); }
.gunly-ai-chat-history > button span { display: -webkit-box; overflow: hidden; font-size: 13px; font-weight: 650; line-height: 1.32; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gunly-ai-chat-history > button small { color: var(--gunly-orange); font-size: 11px; font-weight: 700; text-transform: uppercase; }

.gunly-ai-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-top: 1px solid #d9e5ee; background: #fff; }
.gunly-ai-chat-chips button,
.gunly-ai-chat-view-actions button {
  display: inline-flex;
  min-height: 34px;
  gap: 7px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid #d9e5ee;
  border-radius: 999px;
  background: #fff;
  color: #26313d;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}

.gunly-ai-chat-chips button:hover, .gunly-ai-chat-view-actions button:hover { border-color: rgba(224, 87, 8, 0.34); color: var(--gunly-orange); }
.gunly-ai-chat-view-actions { display: flex; flex: 0 0 auto; gap: 9px; align-items: center; margin-left: auto; }
.gunly-ai-chat-view-actions svg { width: 17px; height: 17px; color: var(--gunly-orange); }

.gunly-ai-chat-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  align-content: center;
  padding: clamp(22px, 5vw, 72px);
  border: 1px solid #d9e5ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  text-align: center;
}

.gunly-ai-chat-empty-icon { display: grid; width: 52px; height: 52px; place-items: center; margin-bottom: 22px; border-radius: 14px; background: rgba(224, 87, 8, 0.11); color: var(--gunly-orange); }
.gunly-ai-chat-empty strong { max-width: 720px; margin: 0 0 14px; color: #1f252c; font-size: 32px; font-weight: 600; line-height: 1.14; }
.gunly-ai-chat-empty p { max-width: 760px; margin: 0; color: #74808b; font-size: 16px; line-height: 1.6; }

.gunly-ai-chat-message { display: flex; margin-bottom: 16px; }
.gunly-ai-chat-message.is-user { justify-content: flex-end; }
.gunly-ai-chat-message.is-user > p { max-width: min(760px, 82%); margin: 0; padding: 13px 15px; border-radius: 12px; background: #1f252c; color: #fff; box-shadow: 0 12px 24px rgba(22, 28, 36, 0.12); font-size: 14px; line-height: 1.45; }
.gunly-ai-chat-message.is-assistant { justify-content: flex-start; }
.gunly-ai-chat-answer { width: min(1060px, 100%); }
.gunly-ai-chat-answer h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.24; }
.gunly-ai-chat-summary { margin: 0 0 12px; color: var(--gunly-muted); font-size: 14px; line-height: 1.48; }

.gunly-ai-chat-block,
.gunly-ai-chat-thinking { border: 1px solid #d9e5ee; border-radius: 12px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 10px 22px rgba(22, 28, 36, 0.05); }
.gunly-ai-chat-block { margin-bottom: 12px; padding: 16px; }
.gunly-ai-chat-block h4 { margin: 0 0 10px; font-size: 15px; line-height: 1.28; }
.gunly-ai-chat-block p { margin: 0; color: #4f5964; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.gunly-ai-chat-evidence { display: block; margin-top: 10px; color: #7b858f; font-size: 12px; }
.gunly-ai-chat-error { border-color: #efb5b5; color: #a32929; }

.gunly-ai-chat-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gunly-ai-chat-metrics article { padding: 12px; border: 1px solid rgba(46, 96, 135, 0.1); border-radius: 8px; background: #fbfcfd; }
.gunly-ai-chat-metrics span, .gunly-ai-chat-metrics small { display: block; color: #6f7882; font-size: 11px; }
.gunly-ai-chat-metrics strong { display: block; margin: 4px 0; font-size: 18px; }
.gunly-ai-chat-table-wrap { overflow-x: auto; }
.gunly-ai-chat-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 12px; }
.gunly-ai-chat-table th, .gunly-ai-chat-table td { padding: 8px; border-bottom: 1px solid #eceff1; text-align: left; white-space: nowrap; }
.gunly-ai-chat-actions { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gunly-ai-chat-actions li { padding-left: 12px; border-left: 3px solid var(--gunly-orange); }
.gunly-ai-chat-actions p { margin: 4px 0; }
.gunly-ai-chat-actions small { color: #7b858f; font-size: 12px; }
.gunly-ai-chat-followups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.gunly-ai-chat-followups button { padding: 10px 12px; border: 1px solid #d9e5ee; border-radius: 8px; background: #fff; color: #3f4852; font-size: 13px; font-weight: 700; text-align: left; }

.gunly-ai-chat-form { display: grid; position: relative; grid-template-columns: 1fr; gap: 11px; padding: 14px 16px 16px; border-top: 1px solid #d9e5ee; background: #fff; }
.gunly-ai-chat-form textarea { width: 100%; min-height: 112px; max-height: 180px; resize: vertical; border: 1px solid #d9e5ee; border-radius: 14px; padding: 17px; background: #fff; color: #1f252c; font: inherit; font-size: 14px; line-height: 1.45; }
.gunly-ai-chat-form textarea:focus { border-color: rgba(224, 87, 8, 0.48); box-shadow: 0 0 0 3px rgba(224, 87, 8, 0.11); outline: none; }
.gunly-ai-chat-form .gunly-ai-chat-submit { display: inline-flex; width: 100%; min-height: 42px; gap: 7px; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: var(--gunly-orange); color: #fff; box-shadow: 0 10px 20px rgba(224, 87, 8, 0.2); font-size: 13px; font-weight: 650; }
.gunly-ai-chat-form .gunly-ai-chat-submit:hover { background: #c94c05; }

.gunly-ai-chat-thinking { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.gunly-ai-chat-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--gunly-orange); opacity: 0.35; animation: gunly-ai-thinking 900ms infinite ease-in-out; }
.gunly-ai-chat-thinking span:nth-child(2) { animation-delay: 120ms; }
.gunly-ai-chat-thinking span:nth-child(3) { animation-delay: 240ms; }
@keyframes gunly-ai-thinking { 50% { opacity: 1; } }

.gunly-ai-tool-list { display: grid; min-height: 0; gap: 12px; padding: 16px; overflow: auto; }
.gunly-ai-tool-list button { display: flex; width: 100%; height: 53px; gap: 12px; align-items: center; padding: 1px 14px; border: 1px solid #d9e5ee; border-radius: 10px; background: #fff; color: #26313d; font-size: 14px; font-weight: 600; line-height: 1.25; text-align: left; }
.gunly-ai-tool-list button:hover { border-color: rgba(224, 87, 8, 0.36); background: #fffaf7; }
.gunly-ai-tool-list svg { flex: 0 0 auto; color: var(--gunly-orange); }

@media (max-width: 1280px) {
  .gunly-ai-chat-body { grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr); overflow: auto; }
  .gunly-ai-chat-tools-panel { grid-column: 1 / -1; min-height: 260px; }
  .gunly-ai-tool-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .gunly-ai-chat-dialog { width: calc(100vw - 20px); height: calc(100vh - 24px); margin-top: 10px; }
  .gunly-ai-chat-body { grid-template-columns: 1fr; }
  .gunly-ai-chat-rail, .gunly-ai-chat-main, .gunly-ai-chat-tools-panel { min-height: 360px; }
  .gunly-ai-tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
  .gunly-ai-launcher { right: 18px; bottom: 18px; }
  .gunly-ai-chat-dialog { width: calc(100vw - 14px); height: calc(100vh - 14px); margin-top: 7px; }
  .gunly-ai-chat-head { min-height: 72px; padding: 12px; }
  .gunly-ai-chat-brand strong { font-size: 19px; }
  .gunly-ai-chat-brand small { font-size: 11px; }
  .gunly-ai-chat-body { gap: 12px; padding: 12px; }
  .gunly-ai-chat-panel-head { min-height: 74px; padding: 14px; }
  .gunly-ai-chat-view-actions { display: none; }
  .gunly-ai-tool-list, .gunly-ai-chat-followups, .gunly-ai-chat-metrics { grid-template-columns: 1fr; }
  .gunly-ai-chat-message.is-user > p { max-width: 100%; }
  .gunly-ai-chat-empty strong { font-size: 25px; }
}

@media (max-width: 780px) {
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .settings-tabs button {
    flex: 0 0 auto;
  }
}

/* Gunly Admin alpha design system */
:root {
  --orange: #F45A27;
  --orange-soft: #F6F7F7;
  --ink: #1D2327;
  --muted: #646970;
  --border: #C3C4C7;
  --border-subtle: #DCDCDE;
  --field-border: #8C8F94;
  --bg: #F0F0F1;
  --panel: #FFFFFF;
  --sunken: #F6F7F7;
  --app-bar: #0C151B;
  --action: #C2451C;
  --success: #00A32A;
  --warning: #DBA617;
  --error: #D63638;
  --info: #2271B1;
}

body {
  color: var(--ink);
  background: var(--bg);
  font: 400 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  letter-spacing: 0;
}

#app *,
#app *::before,
#app *::after {
  background-image: none !important;
  letter-spacing: 0 !important;
}

#app button,
#app input,
#app select,
#app textarea {
  font: inherit;
}

#app button,
#app .button {
  min-height: 30px;
  border: 1px solid var(--action);
  border-radius: 3px;
  padding: 0 12px;
  background: var(--action);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  transition: none;
}

#app button:hover,
#app button:focus-visible {
  border-color: #A53A17;
  background: #A53A17;
  box-shadow: none;
  transform: none;
}

#app button:focus-visible,
#app a:focus-visible,
#app input:focus,
#app select:focus,
#app textarea:focus {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 1px var(--orange) !important;
  outline: 2px solid transparent !important;
}

#app button.ghost,
#app .text-link,
#app .metric-detail-button,
#app .search-platform-tabs button,
#app .nav,
#app .app-signout {
  border-color: var(--border);
  background: #FFFFFF;
  box-shadow: none;
  color: var(--ink);
}

#app button.ghost:hover,
#app .text-link:hover,
#app .metric-detail-button:hover {
  border-color: var(--field-border);
  background: var(--sunken);
  color: var(--ink);
}

#app input,
#app select,
#app textarea,
#app .compact-select {
  min-height: 30px;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 4px 8px;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 0 0 transparent;
  font-size: 13px;
  font-weight: 400;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.app-bar {
  z-index: 100;
  display: grid;
  position: sticky;
  top: 0;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: minmax(220px, auto) minmax(180px, 520px) auto;
  min-height: 48px;
  gap: 20px;
  align-items: center;
  padding: 0 12px;
  background: var(--app-bar);
  color: #FFFFFF;
}

.app-identity,
.app-bar-actions,
.app-search { display: flex; align-items: center; }
.app-identity { gap: 8px; min-width: 0; }
.app-identity strong { font-size: 13px; font-weight: 600; white-space: nowrap; }
.app-store { overflow: hidden; color: #C3C4C7; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.app-mark { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 3px; background: var(--orange); color: #FFFFFF; font-weight: 700; }
.app-search { position: relative; color: #C3C4C7; }
.app-search i { position: absolute; left: 8px; font-size: 13px; }
#app .app-search input { width: 100%; min-height: 30px; border-color: #50575E; padding-left: 28px; background: #1D2327; color: #FFFFFF; }
#app .app-search input::placeholder { color: #A7AAAD; }
.app-bar-actions { justify-content: flex-end; gap: 8px; }
#app .app-new { display: inline-flex; gap: 6px; align-items: center; }
#app .app-signout { display: grid; width: 30px; min-width: 30px; padding: 0; place-items: center; border-color: #50575E; background: transparent; color: #FFFFFF; }
#app .app-signout:hover { border-color: #A7AAAD; background: #1D2327; }

.sidebar {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  border-right: 1px solid var(--border-subtle);
  padding: 8px;
  background: #FFFFFF;
  overflow-y: auto;
}

.brand { display: none; }
.nav-menu { display: flex; flex-direction: column; gap: 0; }
.nav-section-label { display: block; margin: 12px 8px 4px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 16px; }

#app .nav {
  display: flex;
  width: 100%;
  min-height: 32px;
  gap: 8px;
  align-items: center;
  margin: 0;
  border: 0;
  border-radius: 4px;
  padding: 6px 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  text-align: left;
}

#app .nav:hover { background: var(--sunken); color: var(--ink); }
#app .nav.active { background: var(--sunken); color: var(--ink); font-weight: 600; }
.nav-icon { display: inline-flex; flex: 0 0 16px; justify-content: center; color: currentColor; font-size: 16px; }
.nav-icon svg { display: none; }
.nav-badge { min-width: 18px; min-height: 18px; border-radius: 999px; padding: 1px 6px; background: var(--orange); color: #FFFFFF; font-size: 11px; font-weight: 600; }
.nav-chevron { display: none; }

.main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 20px;
  background: var(--bg);
}

.topbar { min-height: auto; margin: 0 0 16px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.topbar h1,
.login-card h1 { margin: 0; color: var(--ink); font-size: 23px; font-weight: 400; line-height: 1.3; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { gap: 8px; }
.top-actions button { display: inline-flex; gap: 6px; align-items: center; }

.filters,
.search-platform-tabs { margin: 0 0 16px; border: 1px solid var(--border-subtle); border-radius: 4px; padding: 8px; background: #FFFFFF; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.ranges { gap: 4px; }
#app .ranges button,
#app .search-platform-tabs button { min-height: 30px; border: 0; border-radius: 0; padding: 0 12px; background: transparent; color: var(--ink); font-weight: 400; }
#app .ranges button:hover,
#app .search-platform-tabs button:hover { background: var(--sunken); }
#app .ranges button.active,
#app .search-platform-tabs button.is-active { border-bottom: 2px solid var(--orange); background: transparent; color: var(--ink); font-weight: 600; }

.view { gap: 16px; }
.grid { gap: 20px; margin: 0 0 20px; }
.grid.two,
.connections-grid { grid-template-columns: minmax(0, 1fr) 280px; }
.grid.three { grid-template-columns: minmax(0, 1fr); }
.view[data-panel="search"] .grid.two { grid-template-columns: minmax(0, 1fr); }
.module-controls-panel { display: none !important; }

.panel,
.overview-visual,
.dashboard-metric-card,
.dashboard-card,
.mini-card,
.integration-card,
.ai-summary-row article,
.ai-forecast-grid article,
.ai-item,
.ffl-signal-card {
  border: 1px solid var(--border-subtle) !important;
  border-radius: 4px !important;
  background: #FFFFFF !important;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04) !important;
  transform: none !important;
}

.panel,
.overview-visual { padding: 16px; }
.panel:hover,
.overview-visual:hover,
.dashboard-metric-card:hover { transform: none; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.panel h2,
.panel-head h2,
.panel-head h3,
.overview-visual .panel-head h3,
.ai-hero h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 20px; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { gap: 12px; align-items: center; margin-bottom: 12px; }

.dashboard-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-metric-card,
.dashboard-card,
.mini-card { min-height: 0; padding: 16px; border-radius: 6px !important; }
.dashboard-metric-card > span,
.dashboard-metric-card > small,
.dashboard-metric-head > span,
.mini-card span,
.metric-label,
.search-platform-stat span,
.search-platform-stat small { color: var(--muted); font-size: 12px !important; font-weight: 400 !important; text-transform: none !important; }
.dashboard-metric-card > strong,
.dashboard-card strong,
.metric-value,
.mini-card > strong { color: var(--ink); font-size: 23px; font-weight: 400; line-height: 1.3; }

.overview-intro,
.section-heading,
.overview-band-head { margin: 0 0 16px; padding: 0; border: 0; background: transparent; }
.view[data-panel="search"] > .section-heading { display: none; }
.overview-intro h2,
.section-heading h2,
.overview-band-head h2 { margin: 0; color: var(--ink); font-size: 23px; font-weight: 400; line-height: 1.3; }
.overview-intro span,
.section-heading span,
.overview-band-head span { color: var(--muted); font-size: 12px; font-weight: 400; text-transform: none; }
.overview-intro p,
.section-heading p { color: var(--muted); font-size: 13px; }

table,
.data-table,
.gunly-ai-chat-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border-subtle); background: #FFFFFF; color: var(--ink); font-size: 13px; }
th,
td,
.data-table th,
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
th,
.data-table th { background: var(--sunken); color: var(--ink); font-size: 12px; font-weight: 600; text-transform: none; }
tbody tr:hover { background: var(--sunken); }
code,
.mono,
td time { font: 400 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }

.notice,
.empty { border: 1px solid var(--border-subtle); border-left: 4px solid var(--info); border-radius: 0; padding: 8px 12px; background: #FFFFFF; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); color: var(--ink); font-size: 13px; }
.notice.error { border-left-color: var(--error); }
.empty { border-left-color: var(--info); text-align: left; }

.pill,
.status-chip,
.metric-status { display: inline; margin: 0; border: 0; border-radius: 0; padding: 0; background: transparent !important; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; }
.status-chip.good,
.metric-status.is-live { color: var(--success); }
.status-chip.bad { color: var(--error); }
.metric-status.is-ai,
.metric-status.is-watch { color: var(--warning); }

#app .domain-select-button {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 10px;
  background: #FFFFFF;
  box-shadow: none;
  color: var(--ink);
  font-weight: 400;
}
#app .domain-select-button:hover { border-color: var(--field-border); background: var(--sunken); color: var(--ink); }
.domain-select-button span,
.domain-select-button strong,
.domain-select-button em { color: inherit; font-size: 12px; font-style: normal; font-weight: 400; }

.chart-shell { min-height: 220px; border: 0; border-radius: 0; background: #FFFFFF; }
.chart-loader { display: none; }
.bar-track { border-radius: 0; background: var(--border-subtle); }
.bar-track i { border-radius: 0; background: var(--orange); }
.tree-cell { border-radius: 0 !important; }
.donut-wrap,
.donut { display: none !important; }

.dashboard-loader { background: rgba(240, 240, 241, .94); backdrop-filter: none; }
.loader-page { display: grid !important; }
.loader-card,
.loader-visual,
.loader-tags,
.loader-lines { display: none !important; }
.loader-copy span,
.loader-copy small { color: var(--muted); font-size: 12px; text-transform: none; }
.loader-copy strong { color: var(--ink); font-size: 14px; font-weight: 600; }

.login-shell { padding: 20px; background: var(--bg); }
.login-card { width: min(480px, 100%); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 20px; background: #FFFFFF; box-shadow: 0 3px 30px rgba(25, 30, 35, .2); }
.login-card label,
.settings-form label { gap: 4px; margin-bottom: 12px; color: var(--ink); font-size: 13px; font-weight: 600; }

.modal,
.gunly-ai-chat-modal { background: rgba(29, 35, 39, .45); backdrop-filter: none; }
.modal-card { width: min(480px, calc(100% - 40px)); border: 1px solid var(--border-subtle); border-radius: 4px; padding: 16px; background: #FFFFFF; box-shadow: 0 3px 30px rgba(25, 30, 35, .2); }

.gunly-ai-launcher {
  display: inline-flex;
  width: auto;
  height: 30px;
  min-height: 30px;
  gap: 6px;
  right: 20px;
  bottom: 20px;
  align-items: center;
  border: 1px solid var(--action);
  border-radius: 3px;
  padding: 0 12px;
  background: var(--action);
  box-shadow: 0 3px 30px rgba(25, 30, 35, .2);
  color: #FFFFFF;
  font-size: 13px;
  line-height: 28px;
  overflow: visible;
}
.gunly-ai-launcher::after { content: "AI assistant"; }
.gunly-ai-launcher-mark { display: none; }
.gunly-ai-launcher em { position: static; color: inherit; font-size: 12px; font-style: normal; }
.gunly-ai-launcher:hover { border-color: #A53A17; background: #A53A17; box-shadow: 0 3px 30px rgba(25, 30, 35, .2); }
.gunly-ai-chat-dialog { width: min(1100px, calc(100vw - 40px)); height: min(760px, calc(100vh - 40px)); border: 1px solid var(--border-subtle); border-radius: 4px; background: var(--bg); box-shadow: 0 3px 30px rgba(25, 30, 35, .2); }
.gunly-ai-chat-head,
.gunly-ai-chat-panel-head,
.gunly-ai-chat-form { border-color: var(--border-subtle); background: #FFFFFF; }
.gunly-ai-chat-body { gap: 12px; padding: 12px; background: var(--bg); }
.gunly-ai-chat-panel,
.gunly-ai-chat-block,
.gunly-ai-chat-thinking,
.gunly-ai-chat-metrics article,
.gunly-ai-tool-list button { border: 1px solid var(--border-subtle); border-radius: 4px; background: #FFFFFF; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.gunly-ai-chat-brand strong,
.gunly-ai-chat-panel-head h3,
.gunly-ai-chat-answer h3 { color: var(--ink); font-size: 14px; font-weight: 600; }
.gunly-ai-chat-brand small,
.gunly-ai-chat-panel-head p { color: var(--muted); font-size: 12px; text-transform: none; }
.gunly-ai-chat-empty strong { color: var(--ink); font-size: 23px; font-weight: 400; }
.gunly-ai-chat-empty p { color: var(--muted); font-size: 13px; }
.gunly-ai-chat-message.is-user > p { border-radius: 4px; background: var(--app-bar); box-shadow: none; font-size: 13px; }
.gunly-ai-chat-actions li { padding-left: 0; border-left: 0; }
.gunly-ai-chat-form textarea { min-height: 80px; border-radius: 3px; padding: 8px; font-size: 13px; }
.gunly-ai-chat-form .gunly-ai-chat-submit { min-height: 30px; border-radius: 3px; background: var(--action); box-shadow: none; }
.gunly-ai-chat-thinking span { background: var(--orange); animation: none; }

@media (max-width: 1080px) {
  .dashboard-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two,
  .connections-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 782px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .app-bar { position: static; grid-column: 1; grid-row: 1; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
  .app-search { grid-column: 1 / -1; grid-row: 2; }
  .sidebar { grid-column: 1; grid-row: 2; border-right: 0; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }
  .nav-menu { display: flex; flex-flow: row nowrap; gap: 4px; }
  .nav-section-label { display: none; }
  #app .nav { width: auto; min-width: max-content; }
  .main { grid-column: 1; grid-row: 3; padding: 16px; }
  .dashboard-card-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { overflow-x: auto; }
  .ranges { flex-wrap: nowrap; }
  .app-store { display: none; }
}

/* Client plugin design parity — authoritative admin component layer. */
:root {
  --admin-section-gap: 20px;
  --admin-card-gap: 16px;
  --admin-radius: 7px;
  --admin-shadow: 0 1px 2px rgba(29, 35, 39, .06);
  --admin-shadow-hover: 0 8px 24px rgba(29, 35, 39, .09);
  --admin-orange-soft: #fff4ee;
  --admin-blue: #386d9d;
}

#app button,
#app [role="button"],
#app .nav,
#app .metric-detail-button,
#app .text-link,
#app [data-range],
#app [data-search-platform-tab],
#app [data-settings-tab],
#app [data-ai-tab] {
  cursor: pointer;
}

#app button,
#app a,
#app input,
#app select,
#app textarea {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

#app button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.main {
  width: 100%;
  max-width: 1920px;
  min-width: 0;
  margin: 0 auto;
}

.view.active,
.overview-band,
.search-platform-panel.is-active,
.settings-panel.is-active,
.ai-workspace,
.ai-tab-panel.is-active {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--admin-section-gap);
}

.view.active > *,
.overview-band > *,
.search-platform-panel.is-active > *,
.settings-panel.is-active > *,
.ai-tab-panel.is-active > * {
  min-width: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.grid,
.dashboard-card-grid,
.integration-card-grid,
.overview-visual-grid,
.search-platform-stat-grid,
.metric-grid,
.ai-summary-row,
.ai-forecast-grid {
  gap: var(--admin-card-gap);
  margin-top: 0;
  margin-bottom: 0;
}

.grid.two,
.view[data-panel="search"] .grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

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

.connections-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.panel,
.overview-visual,
.dashboard-metric-card,
.dashboard-card,
.mini-card,
.integration-card,
.search-platform-stat,
.ai-summary-row article,
.ai-forecast-grid article,
.ai-item,
.ffl-signal-card {
  min-width: 0;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--admin-radius) !important;
  background: var(--panel) !important;
  box-shadow: var(--admin-shadow) !important;
}

.panel,
.overview-visual,
.dashboard-metric-card,
.dashboard-card,
.integration-card,
.search-platform-stat,
.ai-summary-row article,
.ai-forecast-grid article {
  padding: 18px;
}

.dashboard-metric-card,
.integration-card {
  display: flex;
  min-height: 208px;
  flex-direction: column;
  align-items: flex-start;
}

.dashboard-metric-card:hover,
.integration-card:hover,
.overview-visual:hover {
  border-color: #c9cdd1 !important;
  box-shadow: var(--admin-shadow-hover) !important;
  transform: translateY(-1px) !important;
}

.dashboard-metric-head,
.panel-head,
.ai-panel-head {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-metric-head > span:not(.integration-card-title),
.mini-card > span,
.search-platform-stat > span,
.ai-summary-row article > span,
.ffl-signal-card > span,
.metric-label {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  color: #59636e !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: .045em !important;
  line-height: 1.35;
  text-transform: uppercase !important;
  overflow-wrap: anywhere;
}

.dashboard-metric-card > strong,
.integration-card > strong,
.search-platform-stat > strong,
.ai-summary-row article > strong,
.ai-forecast-grid article > strong {
  display: block;
  max-width: 100%;
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 500;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.dashboard-metric-card > p,
.integration-card > p,
.search-platform-stat > small,
.ai-summary-row article > small,
.ai-forecast-grid article > small {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.metric-status,
.status-chip,
.pill,
.ai-panel-head > span,
.ai-forecast-grid em {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  max-width: 48%;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid #dce1e5;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f3f5f6 !important;
  color: #5f6872;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: .025em !important;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
}

.metric-status.is-live,
.metric-status.is-positive,
.status-chip.good,
.status-chip.is-positive {
  border-color: #b9d9bd;
  background: #edf7ed !important;
  color: #2f7437;
}

.metric-status.is-ai,
.metric-status.is-watch,
.metric-status.is-attention,
.status-chip.is-attention,
.ai-forecast-grid .is-watch em {
  border-color: #f2c9ad;
  background: #fff3ea !important;
  color: #a94006;
}

.metric-status.is-negative,
.status-chip.bad,
.status-chip.is-negative {
  border-color: #e4c4c4;
  background: #fff0f0 !important;
  color: #a12f2f;
}

.metric-status.is-neutral,
.status-chip.is-neutral {
  border-color: #dce1e5;
  background: #f3f5f6 !important;
  color: #5f6872;
}

.demo-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border: 1px solid #cbd0e6;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef0fb;
  color: #4a4fb0;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.ai-forecast-grid article {
  display: flex;
  min-height: 178px;
  flex-direction: column;
  align-items: flex-start;
}

.ai-forecast-grid em {
  max-width: 100%;
  margin-top: auto;
}

#app .metric-detail-button,
#app .text-link {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  border: 0 !important;
  border-radius: 0;
  padding: 12px 0 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #b94721;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

#app .metric-detail-button::after,
#app .text-link::after {
  content: "\2192";
  font-size: 16px;
  line-height: 1;
  transition: transform 160ms ease;
}

#app .metric-detail-button:hover,
#app .metric-detail-button:focus-visible,
#app .text-link:hover,
#app .text-link:focus-visible {
  border: 0 !important;
  background: transparent !important;
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#app .metric-detail-button:hover::after,
#app .text-link:hover::after {
  transform: translateX(3px);
}

.metric-page-link {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: var(--admin-blue);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-page-link:hover {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.metric-page-link.is-static {
  color: var(--muted);
}

.overview-intro,
.overview-band-head,
.section-heading {
  margin: 0;
}

.overview-intro h2,
.overview-band-head h2,
.section-heading h2 {
  margin-top: 4px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  line-height: 1.25;
}

.overview-intro span,
.overview-band-head span,
.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.filters,
.search-platform-tabs,
.settings-tabs,
.ai-tabs {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--admin-shadow);
}

.ranges,
.search-platform-tabs,
.settings-tabs,
.ai-tabs {
  gap: 6px;
}

#app .ranges button[data-range],
#app .search-platform-tabs button[data-search-platform-tab],
#app .settings-tabs button[data-settings-tab],
#app .ai-tabs button[data-ai-tab] {
  min-height: 38px;
  border: 1px solid transparent !important;
  border-radius: 6px;
  padding: 7px 12px;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-weight: 600;
  line-height: 1.25;
}

#app .ranges button[data-range]:hover,
#app .search-platform-tabs button[data-search-platform-tab]:hover,
#app .settings-tabs button[data-settings-tab]:hover,
#app .ai-tabs button[data-ai-tab]:hover {
  border-color: #dce2e7 !important;
  background: #f5f7f8 !important;
  color: #b94721 !important;
}

#app .ranges button[data-range].active,
#app .search-platform-tabs button[data-search-platform-tab].is-active,
#app .search-platform-tabs button[data-search-platform-tab][aria-selected="true"],
#app .settings-tabs button[data-settings-tab].is-active,
#app .settings-tabs button[data-settings-tab][aria-selected="true"],
#app .ai-tabs button[data-ai-tab].is-active,
#app .ai-tabs button[data-ai-tab][aria-selected="true"] {
  border-color: rgba(224, 87, 8, .32) !important;
  background: var(--admin-orange-soft) !important;
  box-shadow: inset 0 -2px 0 var(--orange) !important;
  color: #b94721 !important;
  font-weight: 700;
}

#app .ranges button[data-range]:focus-visible,
#app .search-platform-tabs button[data-search-platform-tab]:focus-visible,
#app .settings-tabs button[data-settings-tab]:focus-visible,
#app .ai-tabs button[data-ai-tab]:focus-visible {
  outline: 2px solid rgba(224, 87, 8, .36) !important;
  outline-offset: 2px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
}

.settings-panel.is-active > .panel,
.settings-panel.is-active .settings-form {
  gap: 16px;
}

.settings-form {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.settings-form > label,
.settings-form > .check-row {
  min-width: 0;
  margin: 0;
}

.settings-form > button,
.settings-form > .notice,
.settings-form > textarea,
.settings-form > .module-grid,
.settings-form > .runtime-grid,
.settings-form > .staged-status {
  grid-column: 1 / -1;
}

.settings-form > button {
  width: fit-content;
}

#app input,
#app select,
#app textarea,
#app .compact-select {
  width: 100%;
  min-height: 38px;
  border-radius: 5px;
  padding: 7px 10px;
}

#app textarea {
  min-height: 112px;
  resize: vertical;
}

.check-row {
  display: flex !important;
  min-height: 44px;
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
}

#app .check-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
}

.integration-card-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.integration-card-title b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.service-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
}

.service-logo {
  display: block;
  width: 24px;
  height: 24px;
}

.category-ranked {
  max-height: 390px;
  padding-right: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #8c8f94 #f0f0f1;
  scrollbar-width: thin;
}

.category-ranked::-webkit-scrollbar,
.ai-list::-webkit-scrollbar {
  width: 8px;
}

.category-ranked::-webkit-scrollbar-track,
.ai-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #f0f0f1;
}

.category-ranked::-webkit-scrollbar-thumb,
.ai-list::-webkit-scrollbar-thumb {
  border: 2px solid #f0f0f1;
  border-radius: 999px;
  background: #8c8f94;
}

.panel table,
.connections-table table,
.recent-events-table table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.connections-table .col-status {
  min-width: 96px;
}

.connections-table .status-chip {
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
}

.panel canvas,
.overview-visual canvas,
.chart-shell {
  max-width: 100%;
}

.notice,
.empty {
  border-radius: 5px;
  line-height: 1.5;
}

#app .nav {
  position: relative;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

#app .nav:hover {
  background: #f5f7f8;
  color: #b94721;
}

#app .nav.active {
  background: var(--admin-orange-soft);
  color: #b94721;
}

#app .nav.active::before {
  content: "";
  position: absolute;
  inset: 5px auto 5px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--orange);
}

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

.ai-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.ai-tabs {
  position: sticky;
  top: 56px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  backdrop-filter: blur(10px);
}

#app .ai-tabs .ai-tab {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-tab em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: #edf0f2;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.ai-tab.is-active em {
  background: #fde2d5;
  color: #b94721;
}

.ai-tab-panel[hidden] {
  display: none !important;
}

.ai-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

.ai-panel-head {
  margin: 0;
}

.ai-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: 520px;
  gap: 10px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: #8c8f94 #f0f0f1;
  scrollbar-width: thin;
}

.ai-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-left: 3px solid #8c8f94 !important;
}

.ai-item.medium {
  border-left-color: #dba617 !important;
}

.ai-item.high {
  border-left-color: var(--orange) !important;
}

.ai-item-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ai-item > div > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-priority {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: #edf0f2;
  color: #646970;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.ai-item.medium .ai-priority {
  background: #fff1cf;
  color: #8a5c00;
}

.ai-item.high .ai-priority {
  background: #fde2d5;
  color: #a94006;
}

.ai-item > em {
  align-self: start;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.gunly-ai-launcher {
  display: grid !important;
  width: 58px !important;
  height: 58px !important;
  min-height: 58px !important;
  right: 24px;
  bottom: 140px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  border-radius: 50% !important;
  padding: 0 !important;
  background: #10191e !important;
  box-shadow: 0 14px 34px rgba(16, 25, 30, .28), 0 0 0 5px rgba(224, 87, 8, .08) !important;
  color: #fff !important;
  font-size: 0 !important;
  line-height: 1;
  overflow: visible;
}

.gunly-ai-launcher::after {
  content: none !important;
}

.gunly-ai-launcher-icon {
  display: block;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gunly-ai-launcher:hover {
  border-color: rgba(224, 87, 8, .72) !important;
  background: #17242a !important;
  box-shadow: 0 18px 38px rgba(16, 25, 30, .34), 0 0 0 6px rgba(224, 87, 8, .12) !important;
  transform: translateY(-2px) !important;
}

[data-export] {
  display: none !important;
}

@media (max-width: 1180px) {
  .dashboard-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  :root {
    --admin-section-gap: 16px;
  }

  .dashboard-card-grid,
  .grid.three,
  .ai-summary-row,
  .ai-forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-form {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 782px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .ai-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .search-platform-tabs,
  .settings-tabs,
  .ai-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    overflow: visible;
  }

  .filters .range-wrap,
  .filters .ranges,
  .filters .domain-filter {
    width: 100%;
    min-width: 0;
  }

  .filters .ranges {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  #app .filters .domain-select-button {
    width: 100%;
  }

  .ai-tabs {
    top: 8px;
  }

  #app .ranges button[data-range],
  #app .search-platform-tabs button[data-search-platform-tab],
  #app .settings-tabs button[data-settings-tab],
  #app .ai-tabs button[data-ai-tab] {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
  }

  #app .ai-tabs button[data-ai-tab] {
    min-width: min(210px, 74vw);
  }

  .gunly-ai-launcher {
    right: 18px;
    bottom: 130px;
  }
}

@media (max-width: 620px) {
  .dashboard-card-grid,
  .grid.two,
  .grid.three,
  .overview-visual-grid,
  .integration-card-grid,
  .search-platform-stat-grid,
  .ai-summary-row,
  .ai-forecast-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .dashboard-metric-card,
  .integration-card {
    min-height: 184px;
  }

  .panel,
  .overview-visual,
  .dashboard-metric-card,
  .dashboard-card,
  .integration-card,
  .search-platform-stat,
  .ai-summary-row article,
  .ai-forecast-grid article {
    padding: 16px;
  }

  .category-ranked,
  .ai-list {
    max-height: 320px;
  }

  .ai-item {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #app *,
  #app *::before,
  #app *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Every table on the dashboard is rendered by one helper, so sorting is styled
   once here: the header is the control, the arrow shows the active direction. */
.sortable-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-table th.sortable:hover,
.sortable-table th.sortable:focus-visible {
  color: var(--action);
}

.sortable-table th.sortable:focus-visible {
  outline: 2px solid rgba(244, 90, 39, .36);
  outline-offset: -2px;
}

.sortable-table th .sort-indicator {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
  border-left: 4px solid transparent;
  opacity: .22;
  vertical-align: middle;
}

.sortable-table th[aria-sort="ascending"] .sort-indicator {
  opacity: 1;
}

.sortable-table th[aria-sort="descending"] .sort-indicator {
  border-top: 5px solid currentColor;
  border-bottom: 0;
  opacity: 1;
}

.sortable-table th[aria-sort="ascending"],
.sortable-table th[aria-sort="descending"] {
  color: var(--action);
}

/* Live block — same shape as the client plugin's "Current Active Users", plus a
   per-store breakdown, which only the central admin needs. */
.live-users {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--orange);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}

.live-users-head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}

.live-users-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-users-head span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: live-pulse 2.4s ease-in-out infinite;
}

.live-users.is-quiet .live-users-head span::before,
.live-users.is-day .live-users-head span::before {
  animation: none;
}

.live-users.is-quiet .live-users-head span::before {
  background: var(--muted);
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 90, 39, .55); opacity: 1; }
  70% { box-shadow: 0 0 0 7px rgba(244, 90, 39, 0); opacity: .75; }
}

@media (prefers-reduced-motion: reduce) {
  .live-users-head span::before { animation: none; }
}

.live-users-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.live-users-head p {
  max-width: 560px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.live-users-aside {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.live-users-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--sunken);
}

#app .live-users-tabs button[data-live-range] {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 12px;
}

#app .live-users-tabs button[data-live-range]:hover {
  border-color: var(--border-subtle);
  background: var(--panel);
  color: var(--action);
}

#app .live-users-tabs button[data-live-range].is-active {
  border-color: rgba(244, 90, 39, .32);
  background: #FFF4EE;
  box-shadow: inset 0 -2px 0 var(--orange);
  color: var(--action);
  font-weight: 650;
}

.live-users-count {
  text-align: right;
}

.live-users-count b {
  display: block;
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.live-users-count em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.live-users-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  margin-top: 18px;
}

.live-users-map {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--sunken);
}

.live-users-map-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.us-map {
  width: 100%;
  max-height: 420px;
}

.us-state {
  fill: #e7e9eb;
  stroke: #fff;
  stroke-width: 1;
  stroke-linejoin: round;
  transition: fill .2s ease;
}

.us-state[data-level="1"] { fill: #fbd9c8; }
.us-state[data-level="2"] { fill: #f7b797; }
.us-state[data-level="3"] { fill: #f4956a; }
.us-state[data-level="4"] { fill: #ef7440; }
.us-state[data-level="5"] { fill: #d94d15; }

.us-bubble circle {
  fill: #7a2c08;
  fill-opacity: .92;
  stroke: #fff;
  stroke-width: 1.5;
}

.us-bubble text {
  fill: #fff;
  font-size: 14px;
  font-weight: 700;
  text-anchor: middle;
}

.live-users-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.live-users-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-users-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--sunken);
}

.live-users-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.live-users-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.live-users-stat small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.live-users-states h3,
.live-users-stores h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.live-users-states ul,
.live-users-stores ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-users-rank {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 56px 30px;
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
}

.live-users-rank-code {
  font-weight: 700;
}

.live-users-rank-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-users-rank i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: var(--orange);
}

.live-users-rank.is-muted .live-users-rank-code,
.live-users-rank.is-muted b {
  color: var(--muted);
}

.live-users-rank.is-muted i {
  background: transparent;
}

.live-users-rank b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.live-users-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.live-users-foot {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.live-users-trend span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.live-users-trend svg {
  width: 100%;
  max-width: 280px;
  height: 34px;
}

.live-users-trend polyline {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.live-users-updated {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1180px) {
  .live-users-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-users-side {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .live-users-stats,
  .live-users-states,
  .live-users-stores {
    flex: 1 1 260px;
  }
}

/* Channel cards and the status line above them — ported from the client plugin
   so a store looks the same here and in its own dashboard. */
.channel-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.channel-metric-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--panel);
}

.channel-metric-card.is-idle {
  background: var(--sunken);
}

.channel-metric-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.channel-metric-head strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.channel-metric-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.channel-metric-card b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.channel-metric-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.channel-status {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

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

.channel-status small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.channel-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--sunken);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.channel-status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.channel-status-chip.is-connected {
  border-color: #b9d9bd;
  background: #edf7ed;
  color: #2f7437;
}

.channel-status-chip.is-connected::before { background: #4b8f50; }

.channel-status-chip.is-partial {
  border-color: #efc09f;
  background: #FFF4EE;
  color: var(--action);
}

.channel-status-chip.is-partial::before { background: var(--orange); }

.panel-note {
  color: var(--muted);
  font-size: 12px;
}

/* Status chips inside tables must not wrap per character: the column is narrow
   and overflow-wrap: anywhere turned "Needs attention" into a vertical stack. */
td .status-chip {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* A tick box is not a text field.
   The shared sizing for inputs above — full width, a text field's height and
   padding — applies to every input, checkboxes included, which stretched each
   one into a large orange rectangle and pushed its label to the far side of
   the row. Every filter in the hub draws its options as checkboxes, so they
   are sized here once, for all of them. */
#app input[type="checkbox"],
#app input[type="radio"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--orange);
  vertical-align: middle;
}

#app input[type="radio"] {
  border-radius: 50%;
}

/* An option row reads as one line: box, then name, aligned left. */
#app .domain-options label,
#app .module-grid label,
#app .demo-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  cursor: pointer;
}

#app .domain-options label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Two actions of equal weight: selecting everything is not more important
   than clearing it, and two solid orange buttons side by side said it was. */
#app .domain-select-actions button {
  flex: 1;
  border-color: var(--field-border);
  background: #FFFFFF;
  box-shadow: none;
  color: var(--ink);
  font-weight: 600;
}

#app .domain-select-actions button:hover,
#app .domain-select-actions button:focus-visible {
  border-color: var(--orange);
  background: var(--sunken);
  color: var(--ink);
}

#app .domain-search {
  min-height: 30px;
  margin-bottom: 8px;
}

/* A status pill is as wide as its word.
   The pill was capped at 48% of its cell while its text was told never to
   wrap, so anything longer than that cap — SCANNING, ATTENTION — hung out
   over both edges of the shape meant to contain it. */
#app .metric-status,
#app .status-chip,
#app .pill {
  max-width: 100%;
  padding: 3px 9px;
  font-size: 10px;
  letter-spacing: .04em !important;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
}

/* In a table the pill sits with the row's text, not centred in the column. */
#app td .metric-status,
#app td .status-chip {
  justify-content: flex-start;
}

/* What follows a shortened table: the button that lengthens it, and how much
   of the list is on screen. */
#app .table-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

#app .table-more span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* A select standing next to a heading is a control, not a field in a form:
   the shared full width made it push the heading aside and fill the panel. */
#app .panel-head select,
#app .filters select,
#app .top-actions select,
#app .compact-select {
  width: auto;
  min-width: 150px;
  max-width: 100%;
}

/* Every dropdown gets the same arrow and room for it, so a select never reads
   as a plain box the way an unstyled one does next to the styled ones. */
#app select {
  padding-right: 26px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23646970' d='M1.4 1.6 6 6.2l4.6-4.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px 7px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

#app select::-ms-expand {
  display: none;
}
