:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-soft: #fafafa;
  --panel: #ffffff;
  --panel-hover: #f7f7f8;
  --panel-strong: #f0f1f3;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --text: #1d1d1f;
  --text-soft: #3a3a3c;
  --text-dim: #6e6e73;
  --emerald: #0071e3;
  --emerald-soft: #eaf3ff;
  --blue: #0071e3;
  --blue-soft: #eaf3ff;
  --amber: #9a6700;
  --amber-soft: #fff8e6;
  --coral: #d70015;
  --coral-soft: #fff0f1;
  --violet: #7057d9;
  --violet-soft: #f2efff;
  --danger: #d70015;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --sidebar-width: 228px;
  --topbar-height: 60px;
  --ease: 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
[tabindex] {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.24);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

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

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--emerald);
  color: #ffffff;
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 14px;
  border-right: 1px solid var(--line);
  background: #fbfbfd;
  z-index: 60;
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: var(--accent, #0071e3);
  color: #ffffff;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-ring,
.brand-core {
  display: none;
}

.brand-ring-one {
  inset: 1px;
  border: 1px solid rgba(83, 214, 165, 0.7);
}

.brand-ring-two {
  inset: 6px;
  border: 1px solid rgba(108, 168, 255, 0.8);
}

.brand-core {
  inset: 11px;
  background: var(--emerald);
  box-shadow: 0 0 15px rgba(83, 214, 165, 0.65);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 16px;
  font-weight: 670;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid #ead8ad;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.mode-dot,
.truth-pulse,
.status-dot,
.nav-signal {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mode-dot {
  background: var(--amber);
}

.workspace-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.workspace-avatar,
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef0f4;
  color: #3a3a3c;
  font-weight: 800;
}

.workspace-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.workspace-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.workspace-copy small {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chevron {
  color: var(--text-dim);
}

.nav-groups {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-group-spaced {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.nav-label {
  margin: 0 0 7px 11px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #4f4f54;
  font-size: 13px;
  font-weight: 560;
  transition: color var(--ease), background var(--ease), transform var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: #f1f1f3;
}

.nav-link.active {
  color: #0058b0;
  background: var(--blue-soft);
}

.nav-link.active::before {
  display: none;
}

.nav-count {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ececef;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
}

.nav-signal {
  margin-left: auto;
  background: var(--coral);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.api-state {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
}

.api-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #f0f1f3;
  color: var(--text-dim);
}

.api-state span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.2;
}

.api-state small {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
}

.api-state strong {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 12px;
}

.status-dot-off {
  background: var(--text-dim);
}

.status-dot-on {
  background: #1d9b5f;
}

.sidebar-footer > p {
  margin: 4px 8px 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}

.sidebar-legal-links {
  display: flex;
  gap: 10px;
  padding: 8px 8px 0;
  color: var(--text-dim);
  font-size: 11px;
}

.sidebar-legal-links a:hover {
  color: var(--blue);
}

.app-column {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  min-height: var(--topbar-height);
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.global-search-trigger {
  display: flex;
  align-items: center;
  width: min(560px, 52vw);
  min-height: 40px;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f5f5f7;
  color: var(--text-dim);
  cursor: pointer;
  text-align: left;
  transition: border var(--ease), background var(--ease);
}

.global-search-trigger:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.global-search-trigger > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-glyph {
  color: var(--text-soft);
  font-size: 19px;
  line-height: 1;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-bottom-color: #b9b9bf;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
}

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

.truth-button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.truth-pulse {
  background: var(--amber);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--ease), border var(--ease), color var(--ease);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #f4f4f6;
  color: var(--text);
}

.user-avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.mobile-menu-button {
  display: none;
}

.truth-strip {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 9px;
  padding: 7px 24px;
  border-bottom: 1px solid #f0e2bd;
  background: #fffaf0;
  color: #765f2a;
  font-size: 12px;
  font-weight: 520;
  letter-spacing: 0;
}

.truth-strip-tag {
  color: var(--amber);
  font-weight: 850;
  letter-spacing: 0;
}

.truth-strip strong {
  color: #664c12;
}

.truth-strip a {
  margin-left: auto;
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: rgba(245, 189, 104, 0.35);
  text-underline-offset: 3px;
}

.truth-divider {
  width: 1px;
  height: 12px;
  background: #ead8ad;
}

.etsy-api-notice {
  margin: 0;
  padding: 9px 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}

.hosted-connection {
  margin-bottom: 16px;
}

.hosted-connection .panel-header {
  align-items: center;
}

.oauth-connect-form,
.authorization-gate {
  display: grid;
  gap: 9px;
  justify-items: start;
}

.oauth-connect-form p,
.authorization-gate p,
.hosted-empty,
.connection-footnote {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
}

.oauth-connect-form a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.authorization-gate {
  padding: 14px;
  border: 1px solid #ead8ad;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
}

.hosted-facts,
.live-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hosted-facts > span,
.live-summary-grid > span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.hosted-facts small,
.live-summary-grid small {
  color: var(--text-dim);
  font-size: 11px;
}

.hosted-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.button-danger {
  border-color: #efc6cb;
  color: var(--danger);
}

.live-loading,
.hosted-empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.live-summary {
  display: grid;
  gap: 14px;
}

.live-summary-grid {
  margin-top: 0;
}

.live-listings {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.live-listings h3 {
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 13px;
}

.live-listings article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.live-listings article:last-child {
  border-bottom: 0;
}

.live-listings article > div {
  display: grid;
  min-width: 0;
}

.live-listings strong,
.live-listings small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-listings small,
.live-listings article > span {
  color: var(--text-dim);
  font-size: 11px;
}

.connection-footnote {
  margin-top: 14px;
}

#main-content {
  width: min(1480px, 100%);
  min-height: calc(100vh - var(--topbar-height) - 34px);
  padding: 28px 32px 80px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.page-heading {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--emerald);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
}

.eyebrow::before {
  display: none;
}

.page-header h1 {
  margin-bottom: 8px;
  font-size: clamp(29px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.page-header p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), border var(--ease), color var(--ease);
}

.button:hover {
  transform: translateY(-1px);
  border-color: #b9b9bf;
  background: #f7f7f8;
  color: var(--text);
}

.button-primary {
  border-color: var(--blue);
  background: var(--emerald);
  color: #ffffff;
}

.button-primary:hover {
  border-color: #0058b0;
  background: #0058b0;
  color: #ffffff;
}

.button-ghost {
  border-color: transparent;
  background: transparent;
}

.button-small {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
}

.button[disabled] {
  opacity: 0.42;
  pointer-events: none;
}

.research-launcher {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: 0;
  max-width: 980px;
  min-height: 54px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.research-launcher select,
.research-launcher input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.research-launcher select {
  padding: 0 15px;
  border-right: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 620;
}

.research-launcher input {
  padding: 0 16px;
  font-size: 14px;
}

.research-launcher input::placeholder,
.filter-input::placeholder {
  color: var(--text-dim);
}

.research-launcher .button {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  padding-inline: 20px;
}

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

.kpi-card {
  position: relative;
  min-height: 118px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.kpi-card::after {
  display: none;
}

.kpi-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 720;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #f3f3f5;
  color: var(--text-soft);
}

.kpi-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 14px;
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}

.kpi-detail {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin-bottom: 3px;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 12px;
}

.panel-link {
  color: var(--emerald);
  font-size: 12px;
  font-weight: 730;
}

.panel-body {
  padding: 18px;
}

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

.data-table {
  min-width: 720px;
}

.data-table th {
  height: 36px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  background: #fafafa;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background var(--ease);
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.record-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f0f5fb;
  color: #0058b0;
  font-size: 12px;
  font-weight: 800;
}

.record-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.record-open-button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.record-open-button:hover strong,
.record-open-button:focus-visible strong {
  color: var(--emerald);
}

.record-open-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 5px;
}

.metric-unknown {
  color: var(--text-dim);
}

.record-copy strong {
  overflow: hidden;
  max-width: 290px;
  color: var(--text);
  font-size: 10px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-copy small {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 9px;
}

.metric-pair {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.metric-pair strong {
  color: var(--text);
  font-size: 11px;
}

.metric-pair small {
  color: var(--text-dim);
  font-size: 8px;
}

.trend-up {
  color: var(--emerald);
  font-weight: 760;
}

.trend-down {
  color: var(--coral);
  font-weight: 760;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(83, 214, 165, 0.2);
  border-radius: 8px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 10px;
  font-weight: 820;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-observed,
.badge-active,
.badge-own {
  border-color: rgba(83, 214, 165, 0.18);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.badge-estimated,
.badge-ready,
.badge-warning {
  border-color: rgba(245, 189, 104, 0.18);
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-partial,
.badge-draft {
  border-color: rgba(108, 168, 255, 0.18);
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-closed,
.badge-neutral {
  color: var(--text-dim);
}

.badge-notable,
.badge-review {
  border-color: rgba(255, 139, 121, 0.18);
  background: var(--coral-soft);
  color: var(--coral);
}

.sparkline {
  display: block;
  width: 84px;
  height: 28px;
  overflow: visible;
}

.sparkline .spark-area {
  fill: rgba(83, 214, 165, 0.07);
}

.sparkline .spark-line {
  fill: none;
  stroke: var(--emerald);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.change-list {
  display: grid;
}

.change-item {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--ease);
}

.change-item:last-child {
  border-bottom: 0;
}

.change-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.change-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
}

.change-copy {
  min-width: 0;
}

.change-copy strong,
.change-copy span,
.change-copy small {
  display: block;
}

.change-copy strong {
  overflow: hidden;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-copy span {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-copy small {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 9px;
}

.change-time {
  color: var(--text-dim);
  font-size: 8px;
  white-space: nowrap;
}

.insight-list {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.insight-card {
  display: block;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  transition: border var(--ease), background var(--ease), transform var(--ease);
}

.insight-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.insight-kind {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--emerald);
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  line-height: 1.4;
}

.insight-card p {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 9px;
  line-height: 1.45;
}

.insight-card small {
  color: var(--emerald);
  font-size: 9px;
  font-weight: 720;
}

.section-tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  overflow-x: auto;
}

.section-tab {
  min-width: max-content;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  transition: color var(--ease), background var(--ease);
}

.section-tab:hover {
  color: var(--text-soft);
}

.section-tab.active {
  background: rgba(83, 214, 165, 0.11);
  color: var(--emerald);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
  flex-wrap: wrap;
}

.filter-search {
  position: relative;
  flex: 1 1 260px;
}

.filter-search .search-glyph {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 16px;
  pointer-events: none;
}

.filter-input,
.filter-select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 10px;
}

.filter-input {
  width: 100%;
  padding: 0 11px 0 34px;
}

.filter-select {
  min-width: 125px;
  padding: 0 28px 0 10px;
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 9px;
}

.filter-summary strong {
  color: var(--text-soft);
}

.selection-cell {
  width: 34px;
  text-align: center;
}

.check-control {
  width: 14px;
  height: 14px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.table-action {
  width: 27px;
  height: 27px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.table-action:hover,
.table-action.active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--emerald);
}

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

.shop-card,
.connection-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  transition: transform var(--ease), border var(--ease), background var(--ease);
}

.shop-card {
  cursor: pointer;
}

.shop-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: #fafafa;
}

.shop-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.shop-card-header .record-symbol {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 12px;
}

.shop-card-title {
  flex: 1;
  min-width: 0;
}

.shop-card-title strong,
.shop-card-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-card-title strong {
  font-size: 11px;
}

.shop-card-title small {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 8px;
}

.shop-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.shop-metric small,
.shop-metric strong {
  display: block;
}

.shop-metric small {
  color: var(--text-dim);
  font-size: 8px;
}

.shop-metric strong {
  margin-top: 4px;
  font-size: 11px;
}

.shop-categories,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.shop-categories {
  margin-top: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 8px;
}

.gauge {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.gauge progress,
.experiment-progress progress {
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: #e9eaed;
  overflow: hidden;
}

.gauge progress::-webkit-progress-bar,
.experiment-progress progress::-webkit-progress-bar {
  background: #e9eaed;
  border-radius: 999px;
}

.gauge progress::-webkit-progress-value,
.experiment-progress progress::-webkit-progress-value {
  background: var(--blue);
  border-radius: 999px;
}

.gauge progress::-moz-progress-bar,
.experiment-progress progress::-moz-progress-bar {
  background: var(--blue);
  border-radius: 999px;
}

.gauge span {
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 750;
  text-align: right;
}

.keyword-term {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text);
  font-size: 10px;
}

.basis-note {
  color: var(--text-dim);
  font-size: 8px;
}

.change-feed-grid {
  display: grid;
  gap: 10px;
}

.change-group-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.023);
  cursor: pointer;
  transition: border var(--ease), background var(--ease), transform var(--ease);
}

.change-group-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.034);
}

.change-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 17px;
}

.change-group-main h3 {
  margin-bottom: 2px;
  font-size: 11px;
}

.change-group-main > p {
  margin-bottom: 10px;
  color: var(--text-dim);
  font-size: 9px;
}

.change-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.change-field {
  display: block;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 8px;
}

.change-field-values {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.change-field-values > small {
  flex-basis: 100%;
  color: var(--text-dim);
  line-height: 1.45;
}

.change-field s {
  color: var(--text-dim);
  text-decoration-color: var(--coral);
}

.change-field strong {
  color: var(--emerald);
}

.change-array-delta {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.change-array-delta small {
  display: block;
  margin-bottom: 5px;
  color: var(--text-dim);
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag-added {
  border-color: rgba(72, 196, 151, 0.28);
  color: var(--emerald);
}

.tag-removed {
  border-color: rgba(240, 117, 103, 0.3);
  color: var(--coral);
}

.tag-muted {
  color: var(--text-dim);
}

.field-warning {
  color: var(--coral) !important;
}

.change-group-meta {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
  color: var(--text-dim);
  font-size: 8px;
  white-space: nowrap;
}

.experiment-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.experiment-preview,
.data-warning {
  margin-bottom: 18px;
}

.experiment-preview .panel-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.data-warning {
  padding: 18px;
  border-color: rgba(255, 184, 107, 0.32);
}

.experiment-column {
  min-width: 220px;
}

.experiment-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 0 2px;
}

.experiment-column-header h2 {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 760;
}

.experiment-column-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-dim);
  font-size: 8px;
}

.experiment-cards {
  display: grid;
  gap: 9px;
}

.experiment-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: transform var(--ease), border var(--ease), background var(--ease);
}

.experiment-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.037);
}

.experiment-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.variable-token {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 760;
}

.experiment-card h3 {
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.4;
}

.experiment-target {
  overflow: hidden;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experiment-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.experiment-progress span {
  color: var(--text-dim);
  font-size: 8px;
}

.experiment-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 8px;
}

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

.connection-card {
  min-height: 150px;
}

.connection-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.connection-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 15px;
}

.connection-card h2 {
  margin-bottom: 4px;
  font-size: 12px;
}

.connection-card p {
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 10px;
}

.connection-card small {
  color: var(--text-dim);
  font-size: 8px;
}

.truth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 20px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(245, 189, 104, 0.18);
  border-radius: var(--radius-lg);
  background: #fffaf0;
}

.truth-card h2 {
  margin-bottom: 8px;
  font-size: 16px;
}

.truth-card p {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 10px;
}

.truth-facts {
  display: grid;
  gap: 7px;
}

.truth-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(245, 189, 104, 0.11);
  color: var(--text-dim);
  font-size: 9px;
}

.truth-fact:last-child {
  border-bottom: 0;
}

.truth-fact strong {
  color: var(--text-soft);
}

.empty-state,
.error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.014);
  text-align: center;
}

.empty-state-inner,
.error-state-inner {
  max-width: 420px;
}

.empty-icon,
.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 15px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 22px;
}

.empty-state h2,
.error-state h2 {
  margin-bottom: 7px;
  font-size: 15px;
}

.empty-state p,
.error-state p {
  color: var(--text-dim);
  font-size: 10px;
}

.empty-state .button,
.error-state .button {
  margin-top: 8px;
}

.loading-view {
  padding-top: 18px;
}

.loading-view > p {
  color: var(--text-dim);
  font-size: 10px;
}

.skeleton {
  position: relative;
  border-radius: 9px;
  background: #e9eaed;
  overflow: hidden;
}

.skeleton::after {
  display: none;
}

.loading-heading {
  width: 370px;
  max-width: 80%;
  height: 38px;
  margin-bottom: 12px;
}

.loading-subhead {
  width: 560px;
  max-width: 94%;
  height: 16px;
  margin-bottom: 13px;
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.loading-card {
  height: 120px;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(460px, 94vw);
  border-left: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.16);
  transform: translateX(102%);
  transition: transform 240ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 86px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  max-width: 340px;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.drawer-body {
  height: calc(100vh - 86px);
  padding: 20px;
  overflow-y: auto;
}

.drawer-hero {
  padding: 17px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
}

.drawer-hero .sparkline {
  width: 100%;
  height: 70px;
  margin-top: 16px;
}

.drawer-score-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

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

.drawer-score-row small {
  color: var(--text-dim);
  font-size: 8px;
}

.drawer-score-row strong {
  margin-top: 4px;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.drawer-section {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section h3 {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-section p {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.65;
}

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.drawer-metric {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.drawer-metric small,
.drawer-metric strong {
  display: block;
}

.drawer-metric small {
  color: var(--text-dim);
  font-size: 8px;
}

.drawer-metric strong {
  margin-top: 5px;
  font-size: 12px;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.drawer-scrim,
.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
}

.drawer-scrim {
  z-index: 90;
}

.sidebar-scrim {
  z-index: 50;
}

.compare-tray {
  position: fixed;
  left: calc(var(--sidebar-width) + 50%);
  bottom: 18px;
  z-index: 80;
  display: flex;
  align-items: center;
  width: min(720px, calc(100vw - var(--sidebar-width) - 40px));
  gap: 13px;
  padding: 11px 12px 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.compare-tray[hidden] {
  display: none;
}

.compare-tray > div:first-child {
  display: flex;
  min-width: 110px;
  flex-direction: column;
}

.compare-tray small {
  color: var(--text-dim);
  font-size: 8px;
  text-transform: uppercase;
}

.compare-tray strong {
  font-size: 10px;
}

.compare-chips {
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 0;
}

.compare-chip {
  overflow: hidden;
  max-width: 145px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #f0f1f3;
  color: var(--text-soft);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  padding: 11vh 20px 20px;
  background: rgba(3, 8, 10, 0.78);
}

.search-dialog[hidden] {
  display: none;
}

.search-dialog-card {
  width: min(680px, 100%);
  height: fit-content;
  max-height: 70vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.search-dialog-input-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.search-dialog-input-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-results {
  max-height: calc(70vh - 58px);
  padding: 10px;
  overflow-y: auto;
}

.search-empty-state {
  padding: 48px 20px;
  color: var(--text-dim);
  text-align: center;
}

.search-empty-state span {
  font-size: 30px;
}

.search-empty-state p {
  margin: 9px 0 0;
  font-size: 10px;
}

.search-group + .search-group {
  margin-top: 8px;
}

.search-group-title {
  padding: 7px 9px;
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  background: rgba(255, 255, 255, 0.045);
}

.search-result .record-symbol {
  width: 29px;
  height: 29px;
  flex-basis: 29px;
}

.search-result-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.search-result-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-copy small {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 8px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  width: min(340px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  animation: toast-in 220ms ease-out;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 11px;
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 10px;
}

.toast small {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 8px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

.compare-table th,
.compare-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  text-align: left;
}

.compare-table th {
  color: var(--text-dim);
  font-weight: 700;
}

.compare-table td {
  color: var(--text-soft);
}

.noscript-message {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

@media (max-width: 1199px) {
  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .experiment-board {
    grid-template-columns: repeat(4, 240px);
  }
}

@media (max-width: 1199px) {
  :root {
    --sidebar-width: 220px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    transform: translateX(-102%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .app-column {
    width: 100%;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .truth-button {
    display: none;
  }

  .compare-tray {
    left: 50%;
    width: calc(100vw - 28px);
  }

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

  .connection-grid,
  .truth-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .topbar {
    padding: 0 14px;
  }

  .global-search-trigger {
    width: auto;
    flex: 1;
  }

  .global-search-trigger > span:nth-child(2) {
    max-width: 180px;
  }

  .topbar-actions .icon-button,
  .topbar-actions .user-avatar {
    display: none;
  }

  .truth-strip {
    padding-inline: 14px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .truth-strip a {
    margin-left: 0;
  }

  #main-content {
    padding: 24px 14px 90px;
  }

  .page-header {
    flex-direction: column;
    margin-bottom: 20px;
  }

  .page-actions {
    width: 100%;
  }

  .research-launcher {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .research-launcher .button {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    min-height: 105px;
    padding: 13px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .dashboard-stack {
    grid-template-columns: 1fr;
  }

  .shop-grid,
  .connection-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-select {
    flex: 1 1 130px;
  }

  .change-group-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .change-group-icon {
    width: 36px;
    height: 36px;
  }

  .change-group-meta {
    grid-column: 2;
    align-items: flex-start;
    flex-direction: row;
  }

  .compare-tray {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .compare-chips {
    order: 4;
    flex-basis: 100%;
  }

  .search-dialog {
    padding: 5vh 10px 10px;
  }
}

.badge,
.tag,
.variable-token,
.compare-chip {
  background-color: #f3f4f6;
}

.change-item:hover,
.search-result:hover,
.search-result:focus-visible,
.table-action:hover,
.table-action.active {
  background: #f7f7f8;
}

.insight-card,
.section-tabs,
.filter-bar,
.change-group-card,
.experiment-card,
.empty-state,
.drawer-metric {
  background: #ffffff;
}

.insight-card:hover,
.change-group-card:hover,
.experiment-card:hover {
  background: #fafafa;
}

.filter-select,
.change-group-icon,
.experiment-column-count,
.empty-icon,
.api-state-icon {
  background: #f1f2f4;
}

.loading-view > p,
.toast small,
.search-result-copy small,
.compare-table th,
.compare-table td {
  font-size: 12px;
}

.toast strong,
.search-result-copy strong {
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* NicheSeer light workspace */
.analysis-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  gap: 20px;
  padding: 10px 14px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.analysis-bar-title,
.analysis-bar-facts {
  display: flex;
  align-items: center;
}

.analysis-bar-title {
  gap: 8px;
  white-space: nowrap;
}

.analysis-bar-title strong {
  font-size: 13px;
  font-weight: 640;
}

.analysis-bar-title > span:last-child {
  color: var(--text-dim);
  font-size: 12px;
}

.analysis-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.analysis-bar-facts {
  justify-content: flex-end;
  gap: 18px;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.analysis-bar-facts strong {
  color: var(--text);
  font-weight: 650;
}

.content-section {
  margin-top: 26px;
}

.listing-section {
  margin-top: 0;
}

.content-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.content-section-header h2 {
  margin-bottom: 3px;
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.content-section-header p {
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 12px;
}

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

.listing-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.listing-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #f2f3f5;
  color: var(--text);
  cursor: pointer;
}

.listing-media:nth-child(1) {
  background-color: #f1f4f8;
}

.listing-media-label,
.listing-media-state {
  position: absolute;
  top: 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
}

.listing-media-label {
  left: 13px;
}

.listing-media-state {
  right: 13px;
  text-transform: capitalize;
}

.listing-media-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid #d9dde3;
  border-radius: 14px;
  background: #ffffff;
  color: #536273;
  font-size: 18px;
  font-weight: 650;
}

.listing-card-body {
  padding: 14px 15px 13px;
}

.listing-card-context {
  display: flex;
  gap: 5px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.listing-card-context span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-title {
  display: -webkit-box;
  min-height: 40px;
  padding: 0;
  margin: 7px 0 10px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 620;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.listing-card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.listing-card-price-row > strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.listing-card-price-row .badge {
  padding: 4px 7px;
  font-size: 10px;
}

.listing-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 11px 0;
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.listing-card-metrics > div {
  min-width: 0;
  padding: 0 8px;
  border-right: 1px solid var(--line);
}

.listing-card-metrics > div:first-child {
  padding-left: 0;
}

.listing-card-metrics > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.listing-card-metrics dt {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.listing-card-metrics dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 630;
}

.listing-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
}

.text-action,
.watch-action {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
}

.watch-action {
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #ffffff;
  color: var(--text-soft);
}

.watch-action.active {
  border-color: #b8d9f8;
  background: var(--blue-soft);
  color: #0058b0;
}

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

.niche-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.niche-row:hover {
  border-color: var(--line-strong);
}

.niche-row-copy,
.niche-row-metric,
.niche-row-score {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.niche-row-copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.niche-row-copy small,
.niche-row-metric small,
.niche-row-score small {
  color: var(--text-dim);
  font-size: 10px;
}

.niche-row-copy small {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.niche-row-metric strong,
.niche-row-score strong {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 630;
}

.niche-row-score {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.niche-row-score strong {
  color: #0058b0;
}

.overview-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 26px;
}

/* Visual contract hardening */
.brand-copy small,
.mode-pill,
.workspace-copy small,
.nav-label,
.nav-count,
.api-state small,
.sidebar-footer > p,
.sidebar-legal-links,
.data-table th,
.record-copy strong,
.record-copy small,
.metric-pair strong,
.metric-pair small,
.score,
.badge,
.change-copy strong,
.change-copy span,
.change-copy small,
.change-time,
.insight-kind,
.insight-card strong,
.insight-card p,
.insight-card small,
.section-tab,
.filter-input,
.filter-select,
.filter-summary,
.shop-card-title strong,
.shop-card-title small,
.shop-metric small,
.shop-metric strong,
.tag,
.gauge span,
.keyword-term,
.basis-note,
.change-group-main h3,
.change-group-main > p,
.change-field,
.change-group-meta,
.experiment-column-header h2,
.experiment-column-header span,
.variable-token,
.experiment-card h3,
.experiment-target,
.experiment-progress span,
.experiment-date,
.connection-card p,
.connection-card small,
.truth-card p,
.truth-fact,
.empty-state p,
.error-state p,
.drawer-score-row small,
.drawer-section h3,
.drawer-section p,
.drawer-metric small,
.compare-tray small,
.compare-tray strong,
.compare-chip,
.search-empty-state p,
.search-group-title,
.listing-media-label,
.listing-media-state,
.listing-card-context,
.listing-card-price-row .badge,
.listing-card-metrics dt,
.niche-row-copy small,
.niche-row-metric small,
.niche-row-score small {
  font-size: 12px;
  line-height: 16px;
}

.listing-card-metrics dt {
  min-height: 32px;
}

.page-header h1 {
  font-size: 32px;
  line-height: 38px;
}

.content-section-header h2 {
  line-height: 26px;
}

.listing-card-price-row > strong {
  line-height: 22px;
}

.truth-button,
.button,
.button-small,
.section-tab,
.record-open-button,
.text-action,
.watch-action,
.search-result,
.search-dialog-input-row input {
  min-height: 40px;
}

.section-tab {
  display: inline-flex;
  align-items: center;
}

.filter-input,
.filter-select {
  height: 40px;
}

.icon-button,
.table-action {
  width: 40px;
  height: 40px;
}

.check-control {
  appearance: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.check-control::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #ffffff;
}

.check-control:checked::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.listing-card-price-row,
.listing-card-actions {
  flex-wrap: wrap;
}

.listing-card-price-row > strong,
.listing-card-price-row .badge {
  min-width: 0;
  overflow-wrap: anywhere;
}

.listing-card-price-row .badge {
  white-space: normal;
}

.listing-card-actions > button {
  flex: 1 1 104px;
  white-space: normal;
}

@media (max-width: 1199px) {
  .listing-grid,
  .niche-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .analysis-bar-facts {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .overview-secondary,
  .overview-secondary .dashboard-stack {
    grid-template-columns: 1fr;
  }

  .hosted-facts,
  .live-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .research-launcher {
    grid-template-columns: 1fr;
  }

  .research-launcher select {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .research-launcher .button {
    grid-column: 1;
  }

  .detail-drawer {
    width: 100vw;
    max-width: none;
    border-left: 0;
  }

  .global-search-trigger,
  .nav-link,
  .truth-button,
  .button,
  .button-small,
  .section-tab,
  .record-open-button,
  .listing-title,
  .text-action,
  .watch-action,
  .search-result,
  .search-dialog-input-row input,
  .research-launcher select,
  .research-launcher input,
  .research-launcher .button {
    min-height: 44px;
  }

  .filter-input,
  .filter-select {
    height: 44px;
  }

  .icon-button,
  .table-action,
  .check-control {
    width: 44px;
    height: 44px;
  }

  .analysis-bar,
  .content-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .analysis-bar-facts {
    gap: 8px 14px;
    white-space: normal;
  }

  .listing-grid,
  .niche-row-grid {
    grid-template-columns: 1fr;
  }

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

  .niche-row-metric {
    display: none;
  }

  .research-launcher select,
  .research-launcher input,
  .research-launcher .button {
    min-height: 44px;
  }

  .hosted-facts,
  .live-summary-grid {
    grid-template-columns: 1fr;
  }

  .live-listings article {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .etsy-api-notice {
    padding-inline: 16px;
    text-align: left;
  }
}
