:root {
  color-scheme: light;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-muted: #f5f3f4;
  --ink: #1b1c1d;
  --primary: #041627;
  --secondary: #505f76;
  --muted: #667085;
  --border: #e2e8f0;
  --border-strong: #c4c6cd;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #ba1a1a;
  --success: #059669;
  --panel-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px rgba(15, 23, 42, 0.04);
  --focus-ring: rgba(37, 99, 235, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f4f6f9;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 20px;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
}

input {
  min-height: 44px;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 3px solid var(--focus-ring);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--primary);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 40px;
}

h2 {
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

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

.side-nav {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  left: 0;
  padding: 16px;
  position: fixed;
  top: 0;
  width: 256px;
  z-index: 20;
}

.sidebar-collapsed .side-nav {
  align-items: center;
  width: 76px;
}

.brand {
  align-items: center;
  color: #0f172a;
  display: flex;
  justify-content: center;
  width: 100%;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
}

.sidebar-collapsed .brand-logo {
  max-width: 44px;
}

.top-title {
  color: #0f172a;
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 22px;
}

.nav-links {
  display: grid;
  gap: 6px;
}

.nav-footer {
  margin-top: auto;
}

.sidebar-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  color: #334155;
  display: flex;
  font-size: 12px;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 8px;
  min-height: 40px;
  padding: 8px 12px;
  width: 100%;
}

.sidebar-toggle:hover {
  background: #ffffff;
  color: #0f172a;
}

.nav-link {
  align-items: center;
  border-left: 4px solid transparent;
  border-radius: 0 6px 6px 0;
  color: #334155;
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  text-decoration: none;
}

.sidebar-collapsed .nav-links,
.sidebar-collapsed .nav-footer {
  width: 100%;
}

.sidebar-collapsed .nav-link,
.sidebar-collapsed .sidebar-toggle {
  border-left-width: 0;
  border-radius: 6px;
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

.sidebar-collapsed .nav-link {
  font-size: 0;
  gap: 0;
}

.sidebar-collapsed .nav-link .material-symbols-outlined,
.sidebar-collapsed .sidebar-toggle .material-symbols-outlined {
  font-size: 22px;
}

.sidebar-collapsed .sidebar-toggle-label {
  display: none;
}

.nav-link:hover {
  background: #ffffff;
  color: #0f172a;
}

.nav-link.is-active {
  background: #ffffff;
  border-left-color: #0f172a;
  color: #0f172a;
  font-weight: 800;
}

.nav-link-small {
  color: #64748b;
  font-size: 13px;
  min-height: 36px;
}

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

.app-frame {
  min-height: 100vh;
  padding-left: 256px;
}

.sidebar-collapsed .app-frame {
  padding-left: 76px;
}

.top-bar {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.top-bar > :first-child {
  min-width: 0;
}

.shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 28px 32px 32px;
  width: 100%;
}

.real-time-fb-shell {
  max-width: none;
}

.real-time-fb-shell > .page-heading,
.real-time-fb-shell > .search-controls-layout,
.real-time-fb-shell > .loading-state,
.real-time-fb-shell > .error,
.real-time-fb-shell > .metric-grid {
  margin-left: 0;
  margin-right: auto;
  max-width: 1440px;
}

.page-heading {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-heading p {
  color: #44474c;
  font-size: 14px;
  line-height: 20px;
  margin-top: 2px;
}

.login-body {
  background: var(--background);
}

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

.login-view {
  width: min(100%, 440px);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  padding: 28px;
  width: 100%;
}

.eyebrow {
  color: var(--secondary);
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 16px;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.auth-status {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  text-align: right;
}

.session-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.user-menu {
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.user-menu-trigger {
  align-items: center;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--secondary);
  display: inline-flex;
  gap: 4px;
  max-width: min(100%, 280px);
  min-height: 36px;
  padding: 0 8px 0 12px;
}

#user-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus-visible,
.user-menu:focus-within .user-menu-trigger {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--primary);
}

.user-menu-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  opacity: 0;
  padding: 6px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 30;
}

.user-menu:hover .user-menu-panel,
.user-menu:focus-within .user-menu-panel,
.user-menu.is-open .user-menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu:hover .user-menu-trigger,
.user-menu:focus-within .user-menu-trigger,
.user-menu.is-open .user-menu-trigger {
  border-color: var(--border);
}

.menu-item {
  background: transparent;
  border-radius: 6px;
  color: var(--primary);
  display: block;
  font-weight: 700;
  min-height: 36px;
  padding: 0 10px;
  text-align: left;
  width: 100%;
}

.menu-item:hover:not(:disabled),
.menu-item:focus-visible {
  background: var(--surface-soft);
  color: var(--danger);
}

.auth-button {
  min-height: 36px;
  padding: 0 12px;
  width: auto;
}

.secondary-button,
.preset-button {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--secondary);
  min-height: 36px;
  padding: 0 12px;
}

.secondary-button:hover:not(:disabled),
.preset-button:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--primary);
}

.icon-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.control-stepper {
  align-items: center;
  align-content: center;
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 116px;
}

.control-stepper.is-compact {
  display: inline-grid;
  min-width: 0;
  width: 100%;
}

.control-stepper.is-compact .control-stepper-buttons {
  justify-content: center;
  width: 100%;
}

.control-stepper-value {
  color: var(--primary);
  display: block;
  font-weight: 400;
  line-height: 16px;
}

.control-stepper-buttons {
  display: inline-flex;
  gap: 3px;
}

.control-stepper-button {
  align-items: center;
  border-color: #e2e8f0;
  border-radius: 4px;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-height: 24px;
  padding: 0;
  width: 24px;
}

.control-stepper-button.is-increase {
  border-color: rgba(5, 150, 105, 0.32);
  color: var(--success);
}

.control-stepper-button.is-increase:hover:not(:disabled) {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.5);
  color: var(--success);
}

.control-stepper-button.is-decrease {
  border-color: rgba(186, 26, 26, 0.28);
  color: var(--danger);
}

.control-stepper-button.is-decrease:hover:not(:disabled) {
  background: rgba(186, 26, 26, 0.1);
  border-color: rgba(186, 26, 26, 0.45);
  color: var(--danger);
}

.control-stepper-button .material-symbols-outlined {
  font-size: 16px;
}

.control-stepper-status {
  color: var(--muted);
  display: block;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  min-height: 14px;
  white-space: normal;
}

.control-stepper-status:empty {
  display: none;
  min-height: 0;
}

.badge {
  background: #eef1f5;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
}

.badge-ok {
  background: #e8f5ef;
  border-color: #b9dbc9;
  color: var(--success);
}

.status-detail,
.panel p {
  color: var(--muted);
  font-size: 14px;
}

.endpoint-note {
  color: var(--muted);
  font-size: 14px;
  margin: -8px 0 16px;
}

.endpoint-note code {
  color: var(--ink);
  font-size: 0.9em;
  font-weight: 700;
}

.panel {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
}

.controls {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) minmax(150px, 190px) minmax(190px, auto) auto;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
}

.date-presets {
  align-items: center;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
}

.preset-button {
  font-size: 13px;
}

.preset-button.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.preset-button.is-selected:hover:not(:disabled) {
  background: var(--accent-dark);
  color: #ffffff;
}

.search-controls-layout {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  margin-bottom: 18px;
}

.input-section {
  background: #ffffff;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  display: grid;
  gap: 0;
  margin-bottom: 0;
  max-width: none;
  overflow: hidden;
  padding: 0;
}

.latest-searches-panel {
  background: #ffffff;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  display: grid;
  gap: 12px;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  padding: 14px 14px 40px;
  position: relative;
}

.searches-panel {
  order: 2;
}

.searches-panel-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.searches-tabs {
  align-items: center;
  background: #eef2f7;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
}

.searches-tab {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #475569;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 4px;
  justify-content: center;
  line-height: 18px;
  min-height: 32px;
  padding: 7px 8px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.searches-tab.is-active {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: var(--primary);
}

.searches-tab:hover:not(:disabled),
.searches-tab:focus-visible {
  color: var(--accent-dark);
}

.searches-tab:active {
  color: var(--primary);
}

.searches-tab:focus:not(:focus-visible) {
  outline: 0;
}

.searches-tab-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.searches-tab-panel[hidden] {
  display: none;
}

.latest-searches-toggle-icon {
  color: #64748b;
  display: none;
  font-size: 22px;
  transition: transform 0.16s ease;
}

.latest-searches-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.latest-searches-status:empty {
  display: none;
}

.latest-searches-list {
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 224px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.latest-search-button {
  background: #fbfdff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: var(--primary);
  display: block;
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  min-height: 40px;
  overflow-wrap: anywhere;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.latest-search-button:hover:not(:disabled),
.latest-search-button:focus-visible {
  background: #f8fafc;
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--accent-dark);
}

.latest-search-button:active {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--primary);
}

.latest-search-button:focus:not(:focus-visible) {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--primary);
  outline: 0;
}

.favorite-search-item {
  align-items: start;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.favorite-search-delete {
  appearance: none;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  min-height: 40px;
  padding: 0 2px;
  width: auto;
  -webkit-tap-highlight-color: transparent;
}

.favorite-search-delete:hover:not(:disabled),
.favorite-search-delete:focus-visible {
  background: transparent;
  color: #dc2626;
}

.favorite-search-delete:active {
  background: transparent;
  color: #94a3b8;
}

.favorite-search-delete:focus:not(:focus-visible) {
  background: transparent;
  color: #94a3b8;
  outline: 0;
}

.latest-searches-footer {
  display: flex;
  justify-content: flex-end;
  position: absolute;
  right: 18px;
  bottom: 18px;
}

.latest-searches-clear {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  min-height: 0;
  padding: 0;
  width: auto;
}

.latest-searches-clear:hover:not(:disabled),
.latest-searches-clear:focus-visible {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  width: auto;
}

@media (hover: none) {
  .searches-tab:hover:not(:disabled),
  .searches-tab:active,
  .searches-tab:focus:not(:focus-visible) {
    color: #475569;
  }

  .searches-tab.is-active:hover:not(:disabled),
  .searches-tab.is-active:active,
  .searches-tab.is-active:focus:not(:focus-visible) {
    background: #ffffff;
    color: var(--primary);
  }

  .latest-search-button:hover:not(:disabled),
  .latest-search-button:active,
  .latest-search-button:focus:not(:focus-visible) {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: var(--primary);
  }

  .favorite-search-delete:hover:not(:disabled),
  .favorite-search-delete:active,
  .favorite-search-delete:focus:not(:focus-visible) {
    background: transparent;
    color: #94a3b8;
  }
}

.save-search-control {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.save-search-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  min-height: 0;
  padding: 0;
  width: auto;
}

.save-search-toggle:hover:not(:disabled),
.save-search-toggle:focus-visible {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  width: auto;
}

.save-search-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 260px) auto auto;
}

.save-search-form label {
  display: grid;
  gap: 4px;
}

.save-search-form label span {
  color: #44474c;
  font-size: 12px;
  font-weight: 700;
}

.save-search-form input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--primary);
  font: inherit;
  min-height: 36px;
  padding: 7px 10px;
}

#save-search-submit {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#save-search-submit:hover:not(:disabled),
#save-search-submit:focus-visible {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #ffffff;
}

#save-search-cancel {
  align-self: center;
}

.input-panel-main {
  display: grid;
  gap: 12px;
  padding: 18px 20px 16px;
}

.textarea-label {
  display: grid;
  gap: 8px;
}

.input-mode-control {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 4px;
  width: fit-content;
}

.input-mode-control label {
  align-items: center;
  border-radius: 4px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
  line-height: 20px;
  min-height: 30px;
  padding: 5px 8px;
}

.input-mode-control label:has(input:checked) {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: var(--primary);
}

.input-mode-control input {
  accent-color: var(--accent);
  height: 14px;
  margin: 0;
  width: 14px;
}

.input-panel-footer {
  align-items: end;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-top: 0;
  padding: 14px 20px;
}

.date-range-control {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.date-range-control label {
  display: grid;
  gap: 4px;
}

.date-range-control label span {
  color: var(--muted);
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 16px;
  text-transform: uppercase;
}

.date-range-control input {
  min-height: 38px;
  min-width: 160px;
}

.date-presets {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.input-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-button {
  font-size: 13px;
  min-height: 38px;
  padding: 9px 14px;
}

.textarea-label > span {
  color: var(--primary);
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 16px;
  text-transform: uppercase;
}

#campaign-count {
  color: var(--muted);
  font: inherit;
}

#campaign-ids {
  background: #fbfdff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  line-height: 20px;
  min-height: 132px;
  resize: vertical;
}

.market-value {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.market-flag {
  font-size: 14px;
  line-height: 1;
}

.keyword-value {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.25;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  white-space: normal;
}

.keyword-original,
.keyword-translation {
  overflow-wrap: anywhere;
}

.keyword-translation {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.metric-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(128px, 1fr));
  margin-bottom: 16px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
  padding: 10px 14px 12px;
}

.metric-card:nth-child(1) {
  border-top-color: #64748b;
}

.metric-card:nth-child(2) {
  border-top-color: #0ea5e9;
}

.metric-card:nth-child(3) {
  border-top-color: #059669;
}

.metric-card:nth-child(4) {
  border-top-color: #7c3aed;
}

.metric-card p {
  color: #44474c;
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 14px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--primary);
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
}

.metric-card strong.positive {
  color: var(--success);
}

.metric-card strong.negative {
  color: var(--danger);
}

.metric-card span {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 14px;
  margin-top: 6px;
}

.error {
  background: #fff0f1;
  border: 1px solid #f0bdc2;
  border-radius: 8px;
  color: var(--danger);
  font-weight: 700;
  margin: 0 0 16px;
  padding: 12px 14px;
}

.loading-state {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #dbe7f5;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
  color: #1e3a8a;
  display: grid;
  font-weight: 700;
  gap: 6px;
  margin: 0 0 16px;
  padding: 10px 12px 10px 10px;
  width: min(100%, 1440px);
}

.loading-steps {
  --loading-step-gap: 6px;
  --loading-step-row-height: 22px;
  display: grid;
  gap: var(--loading-step-gap);
  max-height: calc(var(--loading-step-row-height) * 5 + var(--loading-step-gap) * 4);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.loading-step {
  align-items: center;
  display: grid;
  font-size: 12px;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 16px;
  min-height: var(--loading-step-row-height);
}

.loading-step-icon {
  align-items: center;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.loading-step-icon .material-symbols-outlined {
  font-size: 17px;
}

.loading-step-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-step.is-complete .loading-step-icon {
  color: var(--success);
}

.loading-step.is-error .loading-step-icon {
  color: var(--danger);
}

.loader,
.loading-step-spinner {
  animation: loader-spin 800ms linear infinite;
  border: 3px solid rgba(37, 99, 235, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  height: 20px;
  width: 20px;
}

.loading-step-spinner {
  border-width: 2px;
  height: 14px;
  width: 14px;
}

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

.results {
  background: var(--surface);
  border: 1px solid #d8dee8;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin-top: 18px;
  overflow: hidden;
}

.results-header {
  align-items: flex-start;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px 16px;
}

.results-header > div:first-child {
  min-width: 0;
}

.results-warning {
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  margin-top: 6px;
}

.results-warning-with-details {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.results-warning-with-details:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

.endpoint-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.results-actions {
  align-items: flex-end;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.results-action-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.compact-results-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.export-status {
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.collapse-button {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  width: auto;
}

.collapse-button .material-symbols-outlined {
  font-size: 18px;
}

dl {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 0;
  min-width: 132px;
  padding: 10px 12px;
}

dt {
  color: var(--muted);
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

dd {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0 0;
}

.table-wrap {
  background: #ffffff;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  table-layout: auto;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: #f8fafc;
  color: #44474c;
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.table-wrap table th:first-child,
.table-wrap table td:first-child {
  background: #ffffff;
  box-shadow: 1px 0 0 var(--border);
  left: 0;
  max-width: 220px;
  min-width: 112px;
  overflow: hidden;
  position: sticky;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
}

.table-wrap table thead th:first-child {
  background: #f8fafc;
  z-index: 3;
}

.table-wrap table tbody tr:nth-child(even) th:first-child,
.table-wrap table tbody tr:nth-child(even) td:first-child {
  background: #fcfdff;
}

.table-wrap table tbody tr:hover th:first-child,
.table-wrap table tbody tr:hover td:first-child {
  background: #f1f5f9;
}

.table-wrap table .totals-row th:first-child,
.table-wrap table .totals-row td:first-child {
  background: #f8fafc;
}

thead th[aria-sort] {
  padding: 0;
}

.sort-button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 4px;
  justify-content: center;
  letter-spacing: inherit;
  min-height: 100%;
  padding: 12px 14px;
  text-align: inherit;
  text-transform: inherit;
  width: 100%;
}

.sort-button::after {
  color: var(--muted);
  content: "unfold_more";
  direction: ltr;
  display: inline-block;
  font-family: "Material Symbols Outlined";
  font-size: 16px;
  font-feature-settings: "liga";
  font-style: normal;
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1;
  opacity: 0.65;
  text-transform: none;
  white-space: nowrap;
}

thead th[aria-sort="ascending"] .sort-button::after {
  content: "arrow_upward";
  opacity: 1;
}

thead th[aria-sort="descending"] .sort-button::after {
  content: "arrow_downward";
  opacity: 1;
}

.sort-button:hover:not(:disabled),
.sort-button:focus-visible {
  color: inherit;
  background: #edf2f7;
}

tbody {
  color: var(--primary);
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

tbody th {
  font-size: 13px;
}

tbody tr:nth-child(even) {
  background: #fcfdff;
}

tbody tr:hover {
  background: #f1f5f9;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.positive {
  color: var(--success);
  font-weight: 800;
}

.negative {
  color: var(--danger);
  font-weight: 800;
}

.muted-cell {
  color: var(--muted);
}

.daily-section,
.hourly-section,
.raw-json-section {
  border-top: 1px solid var(--border);
}

.daily-heading,
.section-heading {
  padding: 18px 18px 4px;
}

.daily-section table {
  min-width: 1120px;
}

.hourly-breakdown-table {
  min-width: 1120px;
}

.raw-json-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 18px 18px;
}

.raw-json-block {
  min-width: 0;
}

.raw-json-block h3 {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
  line-height: 20px;
  margin: 0 0 8px;
}

.raw-json-block h3 code {
  white-space: normal;
}

.raw-json-block pre {
  background: #0f172a;
  border-radius: 8px;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 18px;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
}

.hourly-raw-json {
  padding: 0 18px 18px;
}

.hourly-table {
  min-width: 0;
  table-layout: auto;
}

.hourly-table th,
.hourly-table td {
  padding: 10px 8px;
  width: 1%;
}

.hourly-table thead th {
  font-size: 10px;
  line-height: 13px;
  white-space: normal;
}

.hourly-table .sort-button {
  padding: 10px 8px;
}

.hourly-table tbody th,
.hourly-table tbody td {
  font-size: 12px;
}

.estimated-revenue-info {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  height: 16px;
  justify-content: center;
  line-height: 1;
  margin-left: 4px;
  min-height: 16px;
  padding: 0;
  vertical-align: text-bottom;
  width: 16px;
}

.estimated-revenue-info:hover:not(:disabled),
.estimated-revenue-info:focus-visible {
  background: var(--surface-soft);
  color: var(--primary);
}

.estimated-revenue-tooltip {
  background: var(--primary);
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
  color: var(--surface);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  max-width: 240px;
  opacity: 0;
  padding: 7px 9px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  visibility: hidden;
  white-space: pre-line;
  width: max-content;
  z-index: 1000;
}

.estimated-revenue-tooltip[data-variant="warning-details"] {
  max-width: min(520px, calc(100vw - 16px));
}

.estimated-revenue-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.estimated-revenue-tooltip[data-placement="top"] {
  transform: translateY(2px);
}

.estimated-revenue-tooltip[data-placement="top"].is-visible {
  transform: translateY(0);
}

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

#campaign-table-panel .campaign-table {
  min-width: 960px;
  table-layout: fixed;
}

#campaign-table-panel .campaign-table th:nth-child(1),
#campaign-table-panel .campaign-table td:nth-child(1) {
  width: 31%;
}

#campaign-table-panel .campaign-table th:nth-child(2),
#campaign-table-panel .campaign-table td:nth-child(2) {
  width: 15%;
}

#campaign-table-panel .campaign-table th:nth-child(3),
#campaign-table-panel .campaign-table td:nth-child(3) {
  width: 15%;
}

#campaign-table-panel .campaign-table th:nth-child(4),
#campaign-table-panel .campaign-table td:nth-child(4) {
  width: 10%;
}

#campaign-table-panel .campaign-table th:nth-child(5),
#campaign-table-panel .campaign-table td:nth-child(5) {
  width: 21%;
}

#campaign-table-panel .campaign-table th:nth-child(6),
#campaign-table-panel .campaign-table td:nth-child(6) {
  width: 8%;
}

#campaign-table-panel .tonic-campaign-id-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.breakdown-table {
  min-width: 1280px;
  table-layout: fixed;
  width: 100%;
}

.breakdown-table th,
.breakdown-table td {
  padding: 9px 7px;
  vertical-align: middle;
}

.breakdown-table thead th {
  line-height: 14px;
  white-space: normal;
}

.breakdown-table tbody th,
.breakdown-table tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-table .campaign-id-cell,
.breakdown-table .tonic-campaign-id-cell {
  overflow: visible;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

.campaign-id-wrapper {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.campaign-id-wrapper a,
.tonic-campaign-id-cell a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  vertical-align: bottom;
  white-space: nowrap;
}

.campaign-id-wrapper a {
  text-overflow: ellipsis;
}

.tonic-campaign-id-cell a {
  text-overflow: ellipsis;
}

.campaign-copy-button {
  border-color: #e2e8f0;
  flex: 0 0 auto;
  min-height: 24px;
  min-width: 24px;
  padding: 0 4px;
}

.campaign-copy-button .material-symbols-outlined {
  font-size: 16px;
}

.breakdown-table tbody th {
  font-weight: 400;
}

.breakdown-table .sort-button {
  gap: 2px;
  min-height: 40px;
  padding: 9px 7px;
}

.breakdown-table .sort-button::after {
  font-size: 13px;
}

.inspect-column,
.inspect-cell {
  text-align: center;
  width: 36px;
}

.inspect-button {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: var(--accent);
  display: inline-flex;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  width: 30px;
}

.inspect-button:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}

.inspect-button .material-symbols-outlined {
  font-size: 18px;
}

.table-wrap table.tag-breakdown-table .inspect-column,
.table-wrap table.tag-breakdown-table .inspect-cell {
  max-width: 36px;
  min-width: 36px;
  overflow: visible;
  text-overflow: clip;
}

.inline-preview-row > td {
  background: #f8fafc;
  padding: 10px 12px 14px;
  white-space: normal;
}

.inline-preview-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.03);
  overflow-x: auto;
}

.inline-preview-table {
  background: #ffffff;
  min-width: 980px;
  width: 100%;
}

.inline-preview-table th,
.inline-preview-table td {
  padding: 8px 7px;
}

.breakdown-table tbody td:nth-child(11) {
  overflow-wrap: anywhere;
  overflow: visible;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

.breakdown-table tbody td:nth-child(13),
.breakdown-table tbody td:nth-child(14) {
  overflow: visible;
  vertical-align: middle;
}

/* Campaign breakdown column weights total 100%; keep IDs readable while compacting secondary fields. */
.breakdown-table th:nth-child(1),
.breakdown-table td:nth-child(1) {
  width: 3%;
}

.breakdown-table th:nth-child(2),
.breakdown-table td:nth-child(2) {
  width: 12%;
}

.breakdown-table th:nth-child(3),
.breakdown-table td:nth-child(3) {
  width: 7.5%;
}

.breakdown-table th:nth-child(4),
.breakdown-table td:nth-child(4) {
  width: 7%;
}

.breakdown-table th:nth-child(5),
.breakdown-table td:nth-child(5) {
  width: 4%;
}

.breakdown-table th:nth-child(6),
.breakdown-table td:nth-child(6),
.breakdown-table th:nth-child(8),
.breakdown-table td:nth-child(8),
.breakdown-table th:nth-child(10),
.breakdown-table td:nth-child(10),
.breakdown-table th:nth-child(13),
.breakdown-table td:nth-child(13),
.breakdown-table th:nth-child(14),
.breakdown-table td:nth-child(14) {
  width: 6%;
}

.breakdown-table th:nth-child(10),
.breakdown-table td:nth-child(10) {
  width: 5%;
}

.breakdown-table th:nth-child(7),
.breakdown-table td:nth-child(7) {
  width: 7.5%;
}

.breakdown-table th:nth-child(9),
.breakdown-table td:nth-child(9) {
  width: 4.5%;
}

.breakdown-table th:nth-child(11),
.breakdown-table td:nth-child(11) {
  width: 21%;
}

.breakdown-table th:nth-child(12),
.breakdown-table td:nth-child(12) {
  width: 4.5%;
}

.breakdown-table .control-stepper {
  min-width: 0;
  width: 100%;
}

.breakdown-table .control-stepper-status,
.breakdown-table .control-stepper-value {
  overflow-wrap: anywhere;
  white-space: normal;
}

.tag-breakdown-table {
  min-width: 1180px;
  table-layout: fixed;
  width: 100%;
}

.tag-breakdown-table tbody th {
  font-weight: 400;
}

.tag-breakdown-table tbody th {
  overflow-wrap: anywhere;
  white-space: normal;
}

.tag-breakdown-table tbody .tag-label-cell {
  text-align: left;
}

.tag-breakdown-table tbody td:nth-child(11),
.tag-breakdown-table tbody td:nth-child(12) {
  text-align: center;
  vertical-align: middle;
}

/* Tag breakdown column weights total 100%; keep compact metrics and reserve more room for custom tag. */
.tag-breakdown-table th:nth-child(1),
.tag-breakdown-table td:nth-child(1) {
  width: 3%;
}

.tag-breakdown-table th:nth-child(2),
.tag-breakdown-table td:nth-child(2) {
  width: 31%;
}

.tag-breakdown-table th:nth-child(3),
.tag-breakdown-table td:nth-child(3),
.tag-breakdown-table th:nth-child(8),
.tag-breakdown-table td:nth-child(8),
.tag-breakdown-table th:nth-child(10),
.tag-breakdown-table td:nth-child(10),
.tag-breakdown-table th:nth-child(12),
.tag-breakdown-table td:nth-child(12) {
  width: 7%;
}

.tag-breakdown-table th:nth-child(4),
.tag-breakdown-table td:nth-child(4),
.tag-breakdown-table th:nth-child(7),
.tag-breakdown-table td:nth-child(7) {
  width: 8%;
}

.tag-breakdown-table th:nth-child(5),
.tag-breakdown-table td:nth-child(5),
.tag-breakdown-table th:nth-child(9),
.tag-breakdown-table td:nth-child(9) {
  width: 4.5%;
}

.tag-breakdown-table th:nth-child(6),
.tag-breakdown-table td:nth-child(6) {
  width: 7%;
}

.tag-breakdown-table th:nth-child(11),
.tag-breakdown-table td:nth-child(11) {
  width: 6%;
}

.tag-breakdown-table .inline-preview-table th,
.tag-breakdown-table .inline-preview-table td {
  width: auto;
}

.tag-breakdown-table .inline-preview-table th:first-child,
.tag-breakdown-table .inline-preview-table td:first-child {
  white-space: nowrap;
  width: 52px;
}

#tag-campaign-breakdown-table-panel .tag-breakdown-table {
  max-width: none;
  min-width: 1180px;
  table-layout: fixed;
  width: 100%;
}

.tag-breakdown-table .inline-campaign-table {
  max-width: none;
  min-width: 1280px;
  table-layout: fixed;
  width: 100%;
}

#tag-campaign-breakdown-table-panel .tag-breakdown-table thead th,
#tag-campaign-breakdown-table-panel .tag-breakdown-table .sort-button,
#tag-campaign-breakdown-table-panel .inline-campaign-table thead th {
  white-space: nowrap;
}

#tag-campaign-breakdown-table-panel .split-column-label {
  align-items: center;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: normal;
}

#tag-campaign-breakdown-table-panel .split-column-label span {
  white-space: nowrap;
}

.tag-breakdown-table .inline-campaign-table th,
.tag-breakdown-table .inline-campaign-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.tag-breakdown-table .inline-campaign-table th:first-child,
.tag-breakdown-table .inline-campaign-table td:first-child {
  white-space: nowrap;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(1),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(1) {
  width: 12%;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(2),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(2),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(4),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(4),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(11),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(11),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(12),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(12) {
  width: 5%;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(3),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(3),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(6),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(6) {
  width: 8%;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(5),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(5),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(7),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(7) {
  width: 7%;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(8),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(8),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(9),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(9),
#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(13),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(13) {
  width: 6%;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table th:nth-child(10),
#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(10) {
  width: 20%;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table td:nth-child(10) {
  overflow: hidden;
  text-align: left;
  white-space: normal;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table .keyword-value {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table .keyword-original,
#tag-campaign-breakdown-table-panel .inline-campaign-table .keyword-translation {
  display: block;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tag-campaign-breakdown-table-panel .inline-campaign-table .keyword-translation {
  margin-left: 0;
}

.table-pagination {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 14px 0 0;
}

#breakdown-pagination {
  padding-bottom: 16px;
  padding-right: 16px;
}

.pagination-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.delivery-actions {
  align-items: center;
  display: inline-flex;
  gap: 4px;
}

.delivery-action-buttons {
  display: inline-flex;
  gap: 4px;
}

.delivery-action-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  min-height: 18px;
  padding: 0;
  transition: opacity 0.2s;
  width: 18px;
}

.delivery-action-button .material-symbols-outlined {
  font-size: 16px;
}

.delivery-action-button.is-pause {
  background: transparent;
  color: #92400e;
}

.delivery-action-button.is-pause:hover:not(:disabled) {
  background: transparent;
  opacity: 0.8;
}

.delivery-action-button.is-activate {
  background: transparent;
  color: #166534;
}

.delivery-action-button.is-activate:hover:not(:disabled) {
  background: transparent;
  opacity: 0.8;
}

.delivery-action-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  min-height: 14px;
  overflow-wrap: anywhere;
}

.campaign-status-control {
  align-items: center;
  display: inline-flex;
  gap: 5px;
}

.campaign-status-control .delivery-actions {
  justify-items: start;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  min-height: 22px;
  padding: 4px 8px;
  white-space: nowrap;
}

.status-pill.is-active {
  background: #dcfce7;
  color: #166534;
}

.status-pill.is-paused {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.is-other {
  background: #e0f2fe;
  color: #075985;
}

.status-pill.is-unknown {
  background: #f1f5f9;
  color: #475569;
}

.status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.totals-row th,
.totals-row td {
  background: #f8fafc;
  border-top: 2px solid var(--border);
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
  font-weight: 700;
  padding: 28px 18px;
  text-align: center !important;
}

.changelog-shell {
  max-width: 1060px;
}

.changelog-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 176px minmax(0, 1fr);
}

.changelog-day-nav {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  position: sticky;
  top: 82px;
}

.changelog-day-nav-title {
  color: var(--muted);
  font-family: "Public Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.changelog-day-list {
  display: grid;
  gap: 4px;
}

.changelog-day-link {
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  padding: 8px 10px;
  text-decoration: none;
}

.changelog-day-link:hover,
.changelog-day-link.is-active {
  background: var(--surface-soft);
  border-left-color: var(--primary);
  color: var(--primary);
}

.changelog-day-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.changelog-content {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
}

.changelog-content h1,
.changelog-content h2,
.changelog-content h3,
.changelog-content h4 {
  color: var(--primary);
  letter-spacing: 0;
}

.changelog-content h1 {
  font-size: 26px;
  line-height: 34px;
  margin-bottom: 20px;
}

.changelog-content h2 {
  border-top: 1px solid var(--border);
  font-size: 22px;
  line-height: 30px;
  margin-top: 28px;
  padding-top: 24px;
}

.changelog-content h1 + h2 {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.changelog-content h3 {
  font-size: 16px;
  line-height: 24px;
  margin-top: 22px;
}

.changelog-content h4 {
  font-size: 14px;
  line-height: 20px;
  margin-top: 18px;
}

.changelog-content p,
.changelog-content li {
  color: #334155;
  font-size: 14px;
  line-height: 22px;
}

.changelog-content p {
  margin-top: 10px;
}

.changelog-content ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 22px;
}

.changelog-content a {
  color: var(--accent);
  font-weight: 700;
}

.changelog-content code {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #0f172a;
  font-size: 0.92em;
  padding: 1px 4px;
}

@media (max-width: 920px) {
  .side-nav {
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
    gap: 24px;
    max-width: 320px;
    overflow-y: auto;
    padding: 72px 16px 16px;
    width: min(82vw, 320px);
  }

  .sidebar-collapsed .side-nav {
    background: transparent;
    border-right: 0;
    box-shadow: none;
    overflow: visible;
    padding: 0;
    pointer-events: none;
    width: 0;
  }

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

  .brand-logo {
    max-width: 132px;
  }

  .nav-links {
    display: grid;
  }

  .nav-footer {
    display: grid;
    gap: 8px;
    margin-top: auto;
  }

  .sidebar-toggle {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
    left: 12px;
    margin-bottom: 0;
    position: fixed;
    top: 12px;
    width: 44px;
    z-index: 40;
  }

  .sidebar-toggle-label {
    display: none;
  }

  .sidebar-collapsed .nav-link {
    font-size: 0;
    gap: 0;
  }

  .sidebar-collapsed .nav-links,
  .sidebar-collapsed .brand,
  .sidebar-collapsed .user-menu {
    display: none;
  }

  .sidebar-collapsed .nav-footer {
    display: block;
  }

  .sidebar-collapsed .nav-footer > :not(.sidebar-toggle) {
    display: none;
  }

  .sidebar-collapsed .sidebar-toggle {
    display: inline-flex;
    justify-content: center;
    pointer-events: auto;
  }

  .app-frame {
    padding-left: 0;
    padding-top: 0;
  }

  .sidebar-collapsed .app-frame {
    padding-left: 0;
  }

  .top-bar {
    padding-left: 68px;
    position: sticky;
  }

  .shell {
    padding: 24px 16px;
  }

  .page-heading,
  .results-header,
  .controls,
  .search-controls-layout,
  .input-section,
  .changelog-layout,
  .raw-json-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .input-section {
    order: 1;
  }

  .latest-searches-panel {
    gap: 8px;
    order: 2;
    padding: 14px;
  }

  .latest-searches-toggle-icon {
    display: none;
  }

  .latest-searches-panel.is-collapsed {
    gap: 0;
  }

  .searches-tab.is-active .latest-searches-toggle-icon {
    display: inline-block;
  }

  .latest-searches-panel.is-collapsed .searches-tab-panel:not([hidden]) {
    display: none;
  }

  .latest-searches-panel.is-collapsed .searches-tab.is-active .latest-searches-toggle-icon {
    transform: rotate(180deg);
  }

  .latest-searches-list {
    gap: 4px;
  }

  .latest-search-button {
    font-size: 12px;
    line-height: 16px;
    min-height: 32px;
    padding: 5px 8px;
  }

  .favorite-search-item {
    gap: 4px;
  }

  .favorite-search-delete {
    min-height: 32px;
  }

  .latest-searches-footer {
    bottom: auto;
    margin-top: 2px;
    position: static;
    right: auto;
  }

  .changelog-day-nav {
    position: static;
  }

  .changelog-day-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .changelog-day-link {
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    flex: 0 0 auto;
  }

  .changelog-day-link:hover,
  .changelog-day-link.is-active {
    border-bottom-color: var(--primary);
  }

  .input-actions {
    justify-content: flex-start;
  }

  .auth-status {
    align-items: flex-start;
    text-align: left;
  }

  .session-actions:empty {
    display: none;
  }

  .nav-links .user-menu {
    margin-top: 8px;
    width: 100%;
  }

  .nav-links .user-menu-trigger {
    border-color: var(--border);
    justify-content: space-between;
    max-width: none;
    width: 100%;
  }

  .nav-links .user-menu-panel {
    background: #fee2e2;
    border: 0;
    border-radius: 6px;
    display: none;
    left: 0;
    margin-top: 6px;
    opacity: 1;
    padding: 0;
    pointer-events: auto;
    position: static;
    right: 0;
    transform: none;
    transition: none;
    width: 100%;
  }

  .nav-links .user-menu-panel .menu-item {
    background: #fee2e2;
    color: var(--danger);
    font-size: 13px;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    width: 100%;
  }

  .nav-links .user-menu-panel .menu-item:hover:not(:disabled),
  .nav-links .user-menu-panel .menu-item:focus-visible {
    background: #fecaca;
    color: #991b1b;
  }

  .nav-links .user-menu:hover .user-menu-panel,
  .nav-links .user-menu:focus-within .user-menu-panel,
  .nav-links .user-menu.is-open .user-menu-panel {
    display: block;
  }

  .endpoint-counts {
    justify-content: stretch;
  }

  .endpoint-counts dl {
    flex: 1;
  }

  .results-actions {
    justify-items: stretch;
  }
}

@media (max-width: 1200px) {
  .controls,
  .raw-json-grid,
  .sidebar-collapsed .controls,
  .sidebar-collapsed .raw-json-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .results-header,
  .sidebar-collapsed .results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .endpoint-counts,
  .compact-results-actions,
  .sidebar-collapsed .endpoint-counts,
  .sidebar-collapsed .compact-results-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1120px) {
  .sidebar-collapsed .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .top-bar {
    align-items: center;
  }

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

  .brand-logo {
    max-width: 110px;
  }

  .login-shell {
    align-items: start;
    padding: 16px;
  }

  .login-card {
    gap: 14px;
    padding: 20px;
  }

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

  .input-panel-footer,
  .date-range-control,
  .input-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .date-range-control input {
    min-width: 0;
  }

  .table-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .pagination-status {
    grid-column: 1 / -1;
    order: -1;
    text-align: center;
  }

  .save-search-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  button:not(.auth-button):not(.secondary-button):not(.preset-button):not(.sidebar-toggle):not(.latest-searches-clear):not(.save-search-toggle):not(.favorite-search-delete) {
    width: 100%;
  }
}

@media (max-height: 440px) and (orientation: landscape) {
  .login-shell {
    align-items: start;
    min-height: 100svh;
    padding: 10px 16px;
  }

  .login-card {
    gap: 10px;
    padding: 14px 18px;
  }

  .login-card h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .login-card input,
  .login-card button {
    min-height: 38px;
  }
}

@media (max-width: 430px) {
  .side-nav {
    max-height: none;
  }

  .nav-link {
    font-size: 12px;
    min-height: 36px;
    padding: 6px 8px;
  }

  .sidebar-toggle {
    min-height: 36px;
    padding: 6px 8px;
  }

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