@font-face {
  font-family: "Geist Mono";
  src:
    url("/assets/fonts/GeistMono-VariableFont_wght.ttf")
      format("truetype-variations"),
    url("/assets/fonts/GeistMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --surface: #0d0d0d;
  --surface-hover: #242424;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #888;
  --accent: #7c5cfc;
  --accent-light: #a78bfa;
  --green: #34c759;
  --orange: #ff9f0a;
  --red: #ff453a;
  --blue: #0a84ff;
  --pink: #ff375f;
  --radius: 12px;
}

body {
  font-family:
    "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco,
    Consolas, monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #000000;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.dashboard-menu-toggle {
  position: absolute;
  top: 14px;
  left: max(16px, calc((100vw - 1280px) / 2 - 52px));
  z-index: 12;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(13, 13, 13, 0.94);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.dashboard-menu-toggle span {
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  display: block;
}

.dashboard-menu-toggle:hover,
.dashboard-menu-toggle[aria-expanded="true"] {
  background: rgba(36, 36, 36, 0.98);
  border-color: rgba(167, 139, 250, 0.45);
  transform: translateY(-1px);
}

.dashboard-menu-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(13, 13, 13, 0.95),
    0 0 0 4px rgba(124, 92, 252, 0.75);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  height: 32px;
  width: auto;
  display: block;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

#admin-auth-btn,
#refresh-btn,
.dashboard-auth-btn,
.dashboard-refresh-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#admin-auth-btn,
.dashboard-auth-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

#admin-auth-btn.is-authenticated,
.dashboard-auth-btn.is-authenticated {
  border-color: rgba(52, 199, 89, 0.35);
  color: var(--green);
}

#refresh-btn:hover,
.dashboard-refresh-btn:hover {
  background: var(--surface-hover);
}

#admin-auth-btn:hover,
.dashboard-auth-btn:hover {
  background: var(--surface-hover);
}

#refresh-btn,
.dashboard-refresh-btn {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

#admin-auth-status {
  max-width: 240px;
  overflow-wrap: anywhere;
}

.header-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 18px;
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  background: transparent;
  color: #b8b8c2;
  border-radius: 12px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.15s,
    border-color 0.15s,
    transform 0.15s ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.nav-tab:focus-visible {
  box-shadow:
    0 0 0 2px rgba(13, 13, 13, 0.95),
    0 0 0 4px rgba(124, 92, 252, 0.75);
}

.nav-tab.is-active {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.95), #5d3ef3);
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow:
    0 10px 24px rgba(124, 92, 252, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-tab.is-active:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.dashboard-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 11;
  width: min(320px, calc(100vw - 44px));
  height: 100vh;
  padding: 72px 14px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(13, 13, 13, 0.98);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow-y: auto;
  pointer-events: none;
  transform: translateX(-104%);
  transition:
    transform 0.24s ease,
    box-shadow 0.24s ease;
  box-shadow:
    0 0 0 rgba(0, 0, 0, 0),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-menu.is-open {
  pointer-events: auto;
  transform: translateX(0);
  box-shadow:
    24px 0 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-menu-header {
  padding: 0 12px 14px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-tab {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #b8b8c2;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.menu-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  transform: translateX(2px);
}

.menu-tab.is-active {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.95), #5d3ef3);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-tab {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

/* Summary Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cards--compact {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.cards--compact .card {
  padding: 12px 14px;
  gap: 4px;
}

.cards--compact .card-label {
  font-size: 11px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cards--compact .card-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.onboarding-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}

.onboarding-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
}

.onboarding-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 220px);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.onboarding-breakdown-row strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

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

.onboarding-breakdown-meter {
  display: grid;
  grid-template-columns: minmax(60px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.onboarding-debug-panel {
  margin-top: 12px;
  border-color: rgba(124, 92, 252, 0.28);
  background: rgba(124, 92, 252, 0.08);
}

.onboarding-debug-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.onboarding-debug-panel pre {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.card-subtitle {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.offer-rate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.offer-rate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
}

.offer-rate-card--control {
  border-color: rgba(10, 132, 255, 0.5);
}

.offer-rate-card--control::before {
  background: radial-gradient(circle at top right, #0a84ff, transparent 55%);
}

.offer-rate-card--treatment {
  border-color: rgba(52, 199, 89, 0.5);
}

.offer-rate-card--treatment::before {
  background: radial-gradient(circle at top right, #34c759, transparent 55%);
}

.offer-rate-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.offer-rate-note {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}

.offer-rate-conversions {
  min-width: 112px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: right;
}

.offer-rate-conversions span {
  display: block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.offer-rate-conversions small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.offer-rate-value {
  position: relative;
  z-index: 1;
  font-size: clamp(48px, 8vw, 78px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.offer-rate-track {
  position: relative;
  z-index: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.offer-rate-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.offer-rate-card--control .offer-rate-fill {
  background: var(--blue);
}

.offer-rate-card--treatment .offer-rate-fill {
  background: var(--green);
}

.offer-snapshot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.offer-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.offer-snapshot-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.offer-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  min-width: 0;
}

.offer-metric-row strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
  min-width: 0;
}

.offer-snapshot-panel--config .offer-metric-row {
  align-items: flex-start;
}

.offer-snapshot-panel--config .offer-metric-row strong {
  max-width: 68%;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.offer-metric-row small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.offer-mini-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.offer-mini-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.offer-mini-fill--control {
  background: var(--blue);
}

.offer-mini-fill--treatment {
  background: var(--green);
}

.offer-snapshot-large {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
}

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

.offer-decision-card .subtitle {
  margin-top: 6px;
  max-width: 900px;
}

.offer-decision-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.offer-decision-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.offer-decision-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.offer-decision-stat .card-label {
  font-size: 10px;
  line-height: 1.25;
}

.offer-decision-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-top: 8px;
}

.offer-decision-delta,
.metric-delta {
  color: var(--text-muted);
}

.offer-decision-delta {
  font-size: 12px;
  margin-top: 6px;
}

.offer-decision-value.is-positive,
.offer-decision-delta.is-positive,
.metric-delta.is-positive {
  color: var(--green);
}

.offer-decision-value.is-negative,
.offer-decision-delta.is-negative,
.metric-delta.is-negative {
  color: var(--red);
}

.metric-delta {
  font-weight: 700;
}

.secondary-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  white-space: nowrap;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.notification-section-title {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--text) !important;
}

.notification-section-header {
  align-items: flex-end;
}

.notification-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.notification-status {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 18px;
}

.notification-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
}

.notification-window-field select {
  height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  min-width: 170px;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-hover);
}

.icon-btn--lg {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border-radius: 10px;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.charts-grid--stacked .chart-card canvas {
  max-height: 320px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-card-header h2 {
  margin-bottom: 0;
}

.chart-card-status {
  font-size: 13px;
  color: var(--text-muted);
}

.chart-card-status--ok {
  color: #34c759;
}

.chart-card-status--warn {
  color: #ff9f0a;
}

.chart-card--full {
  width: 100%;
}

.chart-card--full canvas {
  max-height: 320px;
}

.onboarding-dropoff-chart-card {
  overflow: hidden;
}

.onboarding-dropoff-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.onboarding-dropoff-header-actions .creator-form-field {
  margin: 0;
  min-width: 170px;
}

.onboarding-dropoff-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: -4px 0 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.onboarding-dropoff-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot--main {
  background: #a78bfa;
}

.legend-dot--conditional {
  background: #64d2ff;
}

.legend-dot--nutrition {
  background: #6fdd87;
}

.onboarding-dropoff-chart-frame {
  height: 370px;
  min-width: 0;
}

.onboarding-dropoff-chart-frame canvas {
  display: block;
  max-height: none;
}

.notification-iteration-health-card {
  margin-top: 16px;
}

.sub-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.sub-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(124, 92, 252, 0.06);
  border-radius: 6px;
  font-size: 13px;
}

.sub-breakdown-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text);
  word-break: break-all;
  margin-right: 12px;
}

.sub-breakdown-value {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.sub-breakdown-row--bar {
  position: relative;
  background: rgba(124, 92, 252, 0.06);
  overflow: hidden;
}

.sub-breakdown-bar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(
    90deg,
    rgba(124, 92, 252, 0.32),
    rgba(124, 92, 252, 0.18)
  );
  border-radius: 6px;
  transition: width 0.3s ease;
  z-index: 0;
}

.sub-breakdown-row--bar .sub-breakdown-label,
.sub-breakdown-row--bar .sub-breakdown-value {
  position: relative;
  z-index: 1;
}

.sub-breakdown-value-percent {
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

.sub-breakdown-value-count {
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sub-empty-row {
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.col-reason--warn {
  color: #d8385e;
}

.notification-errors-card {
  margin-top: 16px;
}

.notification-errors-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.notification-errors-header h2 {
  margin: 0;
}

.notification-errors-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.notification-errors-count {
  font-size: 12px;
  color: var(--text-muted);
}

.notification-errors-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.notification-errors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.notification-errors-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.notification-errors-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.notification-errors-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: var(--text);
}

.notification-errors-table tbody tr:last-child td {
  border-bottom: none;
}

.notification-errors-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.notification-errors-table .col-time {
  width: 110px;
  white-space: nowrap;
}

.notification-errors-table .col-reason {
  word-break: break-word;
}

.notification-errors-table .col-user {
  width: 160px;
}

.notification-errors-table .col-job {
  width: 180px;
}

.error-time-absolute {
  display: block;
  font-weight: 500;
}

.error-time-relative {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.error-kind-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(124, 92, 252, 0.18);
  color: var(--accent-light);
  border-radius: 4px;
}

.copyable-cell {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.copyable-cell:hover {
  color: var(--text);
}

.copyable-cell--copied {
  color: var(--green);
}

.notification-errors-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.ai-inquiry-list {
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow-y: auto;
}

.ai-inquiry-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.ai-inquiry-row:last-child {
  border-bottom: none;
}

.ai-inquiry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.ai-inquiry-time {
  color: var(--text);
  font-weight: 500;
}

.ai-inquiry-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.ai-inquiry-status--success {
  background: rgba(52, 199, 89, 0.15);
  color: #6fdd87;
}

.ai-inquiry-status--warn {
  background: rgba(255, 159, 10, 0.15);
  color: #ffb547;
}

.ai-inquiry-status--error {
  background: rgba(255, 69, 58, 0.15);
  color: #ff7a72;
}

.ai-inquiry-status--neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.ai-inquiry-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.ai-inquiry-feedback {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 7px;
}

.ai-inquiry-feedback--helpful {
  background: rgba(52, 199, 89, 0.15);
  color: #6fdd87;
}

.ai-inquiry-feedback--unhelpful {
  background: rgba(255, 69, 58, 0.15);
  color: #ff7a72;
}

.ai-inquiry-user {
  margin-left: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.ai-inquiry-toggle {
  margin-left: auto;
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(124, 92, 252, 0.35);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ai-inquiry-toggle:hover {
  background: rgba(124, 92, 252, 0.28);
}

.ai-inquiry-preview {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-inquiry-expanded {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.ai-inquiry-block-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ai-inquiry-classifier {
  font-size: 12px;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.ai-inquiry-block-body {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
}

.chart-card canvas {
  width: 100% !important;
  max-height: 280px;
}

/* Tables */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.table-card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.offer-projects-card {
  padding: 0;
  overflow: hidden;
}

.offer-projects-summary {
  width: 100%;
  min-height: 56px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
}

.offer-projects-summary::-webkit-details-marker {
  display: none;
}

.offer-projects-summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.offer-projects-card[open] .offer-projects-summary {
  border-bottom: 1px solid var(--border);
}

.offer-projects-card[open] .offer-projects-summary::after {
  content: "-";
}

.offer-projects-summary-hint {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.offer-projects-content {
  padding: 20px;
}

.offer-projects-content .notification-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 10px;
}

.offer-project-action-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.offer-project-action-btn:hover {
  background: var(--surface-hover);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active {
  background: rgba(52, 199, 89, 0.15);
  color: var(--green);
}

.badge-other {
  background: rgba(136, 136, 136, 0.15);
  color: var(--text-muted);
}

.code-cell {
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--accent-light);
}

.uid-cell {
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* Section headers */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header-row h2 {
  margin-bottom: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

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

.stat-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.15);
  color: var(--orange);
}

.table-search {
  min-width: 240px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.table-search::placeholder {
  color: var(--text-muted);
}

.table-search:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.notice-banner {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(10, 132, 255, 0.25);
  background: rgba(10, 132, 255, 0.08);
  color: #b7d6ff;
  font-size: 13px;
}

.notice-banner.notice-warning {
  border-color: rgba(255, 159, 10, 0.25);
  background: rgba(255, 159, 10, 0.08);
  color: #ffd9a3;
}

.creator-form {
  margin-top: 16px;
  margin-bottom: 16px;
}

.creator-form fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.creator-form fieldset[disabled] {
  opacity: 0.65;
}

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

.creator-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.creator-form-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.creator-form-field input,
.creator-form-field textarea,
.creator-form-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.creator-form-field textarea {
  resize: vertical;
  min-height: 92px;
}

.creator-form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.creator-form-field input:focus,
.creator-form-field textarea:focus,
.creator-form-field select:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.creator-form-field-wide {
  grid-column: 1 / -1;
}

.creator-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.creator-form-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.creator-form-actions button:hover {
  background: var(--surface-hover);
}

.creator-form-actions .button-danger {
  border-color: rgba(255, 69, 58, 0.25);
  color: #ff9b90;
}

.creator-form-status {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.creator-form-status.is-error {
  color: #ff9b90;
}

.creator-form-status.is-success {
  color: var(--green);
}

.action-button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.action-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

a.action-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 26px;
}

.section-toggle-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.lifetime-access-form {
  margin-top: 16px;
  margin-bottom: 16px;
}

.lifetime-access-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.lifetime-access-form fieldset[disabled] {
  opacity: 0.6;
}

.signin-wall {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 32px 20px;
}

.signin-wall[hidden],
#dashboard-content[hidden],
#creator-dashboard-content[hidden] {
  display: none !important;
}

.signin-card {
  width: 100%;
  max-width: 440px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.signin-card h2 {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 600;
}

.signin-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.signin-card button {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.signin-card button:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

.signin-card button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.signin-wall-status {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--red);
}

.signin-wall-status.is-info {
  color: var(--text-muted);
}

.signin-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.lifetime-access-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.lifetime-access-field {
  flex: 1 1 280px;
  min-width: 220px;
}

.lifetime-access-row button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.lifetime-access-row button:hover:not(:disabled) {
  background: var(--surface-hover);
}

.lifetime-access-row button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.lifetime-history-header {
  margin-top: 20px;
}

.creator-feedback-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.creator-feedback-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.creator-feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.creator-feedback-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.creator-feedback-title {
  font-weight: 600;
  color: var(--text);
}

.creator-feedback-subtext {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.creator-feedback-message {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 600;
  color: var(--text);
}

.user-subtext {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.badge-yes {
  background: rgba(52, 199, 89, 0.15);
  color: var(--green);
}

.badge-no {
  background: rgba(255, 69, 58, 0.12);
  color: #ff9b90;
}

/* Variant tags */
.variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.variant-tag .variant-count {
  font-weight: 700;
  color: var(--orange);
}

.variant-tag.is-canonical {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-light);
}

.variant-tag.is-canonical .variant-count {
  color: var(--accent-light);
}

.creator-profile-card {
  gap: 12px;
}

.creator-code-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.creator-approval-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.creator-approval-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.creator-approval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.mistype-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
}

/* Responsive */
@media (max-width: 900px) {
  .cards:not(.cards--compact) {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards--compact {
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .offer-rate-grid,
  .offer-decision-hero {
    grid-template-columns: 1fr;
  }
  .header-inner {
    align-items: flex-start;
    gap: 12px;
  }
  .header-meta {
    flex-shrink: 0;
  }
  .header-nav {
    padding: 0 24px 16px;
  }
}

@media (max-width: 520px) {
  .cards:not(.cards--compact) {
    grid-template-columns: 1fr;
  }
  .cards--compact {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
  main {
    padding: 12px;
    gap: 16px;
  }
  .header-inner {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .header-nav {
    padding: 0 16px 12px;
    gap: 8px;
  }
  header h1 {
    font-size: 22px;
    line-height: 1.25;
  }
  .header-meta {
    justify-content: space-between;
    width: 100%;
  }
  .card,
  .chart-card,
  .table-card {
    padding: 16px;
    border-radius: 10px;
  }
  .card-value {
    font-size: 28px;
  }
  .chart-card h2,
  .table-card h2 {
    font-size: 14px;
    line-height: 1.35;
  }
  .chart-card canvas {
    max-height: 220px;
  }
  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .creator-form-grid {
    grid-template-columns: 1fr;
  }
  .nav-tab {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
  .table-actions,
  .table-search {
    width: 100%;
    min-width: 0;
  }
  .table-scroll {
    overflow: visible;
  }
  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }
  thead {
    display: none;
  }
  tbody {
    display: grid;
    gap: 10px;
  }
  tbody tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 0;
    background: rgba(255, 255, 255, 0.02);
  }
  tbody tr:last-child td {
    border-bottom: 1px solid var(--border);
  }
  tbody tr:last-child td:last-child {
    border-bottom: none;
  }
  tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }
  tbody td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
  }
  .variant-list {
    justify-content: flex-end;
    gap: 4px;
  }
  .uid-cell,
  .code-cell {
    overflow-wrap: anywhere;
  }
  .variant-list {
    gap: 4px;
  }
  .variant-tag {
    font-size: 10px;
    padding: 2px 6px;
  }
}
