:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --text: #182026;
  --muted: #65717b;
  --line: #dfe4e8;
  --line-strong: #c8d0d6;
  --teal: #0f766e;
  --teal-ink: #0b4f4a;
  --green: #22863a;
  --amber: #b26a00;
  --red: #c43c32;
  --indigo: #3f5f9b;
  --shadow: 0 8px 22px rgba(24, 32, 38, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.brand-block {
  display: grid;
  gap: 4px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.brand-block strong {
  font-size: 18px;
  font-weight: 820;
  letter-spacing: 0;
}

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

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

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

.backend-nav {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.backend-nav summary {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 7px;
  color: #8a949d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  list-style: none;
}

.backend-nav summary::-webkit-details-marker {
  display: none;
}

.backend-nav summary:hover {
  background: #f8fafb;
  color: var(--muted);
}

.backend-nav[open] summary {
  margin-bottom: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.nav-item span {
  font-size: 13px;
  font-weight: 730;
}

.nav-item strong {
  min-width: 28px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.nav-item:hover {
  background: #f8fafb;
  border-color: var(--line);
}

.nav-item.active {
  background: #eefaf7;
  border-color: #badbd6;
  color: var(--teal-ink);
}

.nav-item.active strong {
  background: var(--teal);
  color: #ffffff;
}

.nav-item-secondary {
  min-height: 36px;
  color: #596670;
}

.nav-item-secondary span {
  font-size: 12px;
  font-weight: 650;
}

.nav-item-secondary strong {
  height: 20px;
  min-width: 24px;
  opacity: 0.76;
  font-size: 11px;
}

.side-status {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.side-status > span,
.side-status small,
.side-status-grid span {
  color: var(--muted);
  font-size: 12px;
}

.side-status > strong {
  font-size: 18px;
  font-weight: 820;
}

.side-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.side-status-grid div {
  display: grid;
  gap: 3px;
}

.side-status-grid strong {
  font-size: 13px;
}

.supporting-status {
  display: none !important;
}

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

.workspace-body {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.workspace-topbar {
  min-height: 64px;
}

.view-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.view-meta-chip {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.view-meta-chip em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.view-meta-chip strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

.view-meta-chip.meta-strong {
  border-color: #badbd6;
  background: #eefaf7;
}

.view-meta-chip.meta-strong strong {
  color: var(--teal-ink);
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  font-weight: 760;
}

h1 {
  font-size: 23px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  line-height: 1.25;
}

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

.timestamp {
  display: grid;
  gap: 2px;
  min-width: 168px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.timestamp span,
.panel-header span,
.metric-card span,
.metric-card small,
.event-meta,
.source-meta,
.product-note {
  color: var(--muted);
  font-size: 12px;
}

.timestamp strong {
  font-size: 13px;
  font-weight: 650;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--teal-ink);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ghost-button {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

.ghost-button:hover {
  border-color: var(--line-strong);
}

.primary-button svg,
.ghost-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

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

.monitor-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) minmax(220px, 1.4fr);
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

.metric-card,
.panel,
.monitor-card,
.monitor-baseline {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
}

.metric-card strong {
  font-size: 26px;
  line-height: 1;
}

.health-card {
  border-left: 4px solid var(--line-strong);
}

.health-card small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-height: 1.25;
}

.health-status-text {
  font-size: 20px !important;
  overflow-wrap: anywhere;
}

.health-ready {
  color: var(--green);
}

.health-warning {
  color: var(--amber);
}

.health-blocked {
  color: var(--red);
}

.health-unknown {
  color: var(--indigo);
}

.health-notice {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.health-notice.has-warning,
.health-notice.has-blocker {
  display: flex;
}

.health-notice.has-warning {
  border-color: #efd3a2;
  background: #fffaf0;
}

.health-notice.has-blocker {
  border-color: #f1bbb5;
  background: #fff5f4;
}

.health-notice strong {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 780;
}

.health-notice span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notice-chip-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.notice-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid rgba(178, 106, 0, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.notice-chip em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}

.notice-chip strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

.decision-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.8fr) minmax(240px, 0.85fr);
  gap: 10px;
  margin-bottom: 10px;
}

.decision-summary-main,
.decision-summary-card {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.decision-summary-main {
  border-left: 5px solid var(--teal);
}

.decision-summary span,
.decision-summary small {
  color: var(--muted);
  font-size: 12px;
}

.decision-summary strong {
  font-size: 18px;
  font-weight: 820;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.decision-summary-main strong {
  font-size: 25px;
  letter-spacing: 0;
}

.decision-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.monitor-card,
.monitor-baseline {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px 14px;
  box-shadow: none;
}

.monitor-card span,
.monitor-baseline span {
  color: var(--muted);
  font-size: 12px;
}

.monitor-card strong {
  font-size: 22px;
  line-height: 1;
}

.monitor-card.risk strong {
  color: var(--amber);
}

.monitor-baseline strong {
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.monitor-panel {
  margin-bottom: 10px;
  box-shadow: none;
}

.monitor-summary-line {
  min-height: 48px;
}

.monitor-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.monitor-inline span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfd;
}

.monitor-inline strong {
  color: var(--text);
  font-size: 13px;
}

.panel {
  min-width: 0;
}

.panel-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  letter-spacing: 0;
}

.panel-summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

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

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

.summary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfd;
  font-weight: 720;
}

.panel-header.compact {
  min-height: 58px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 3px;
  gap: 2px;
}

.segment {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  min-height: 30px;
  padding: 0 10px;
  cursor: pointer;
}

.segment.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(24, 32, 38, 0.12);
}

.event-list,
.source-list {
  display: grid;
}

.event-list {
  max-height: none;
  overflow: auto;
}

.event-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.event-row:last-child,
.source-row:last-child {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.badge.high {
  background: #e8f5ee;
  color: var(--green);
}

.badge.medium {
  background: #fff3dc;
  color: var(--amber);
}

.badge.low {
  background: #eef2f7;
  color: var(--indigo);
}

.event-title {
  overflow-wrap: anywhere;
  font-weight: 650;
  line-height: 1.35;
}

.event-meta {
  margin-top: 4px;
}

.event-link {
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.session-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.session-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tiny-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
}

.tiny-button:hover {
  border-color: var(--line-strong);
}

.tiny-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.primary-tiny {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.source-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
}

.source-map-count {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.status-ok,
.status-reachable {
  background: #e8f5ee;
  color: var(--green);
}

.status-blocked,
.status-challenge,
.status-stale {
  background: #fff3dc;
  color: var(--amber);
}

.status-failed {
  background: #fdecea;
  color: var(--red);
}

.status-uncertain,
.status-pending {
  background: #eef2f7;
  color: var(--indigo);
}

.products-panel {
  margin-top: 10px;
}

.recommendations-panel {
  margin-bottom: 10px;
}

.events-panel,
.raw-data-panel {
  margin-bottom: 10px;
}

.candidate-panel,
.verification-panel {
  margin-bottom: 10px;
}

.raw-data-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-width: 0;
  border-top: 1px solid var(--line);
}

.raw-data-grid .sources-panel,
.raw-data-grid .products-panel {
  min-width: 0;
  margin: 0;
}

.raw-data-grid .sources-panel {
  border-right: 1px solid var(--line);
}

.candidate-panel .candidate-table-wrap,
.verification-panel .verification-table-wrap {
  border-top: 1px solid var(--line);
}

.styles-panel {
  margin-bottom: 10px;
}

.style-config-body {
  padding: 12px 14px 0;
  border-top: 1px solid var(--line);
}

.style-form {
  display: grid;
  grid-template-columns: 150px 110px 150px minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  flex: 1;
  max-width: 840px;
}

.source-map-fields {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.source-map-fields summary {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
}

.source-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.style-form input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

.style-form input:focus {
  border-color: #93c7bf;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.styles-table {
  min-width: 980px;
}

.styles-table-wrap {
  margin: 12px -14px 0;
  width: calc(100% + 28px);
}

.styles-table th,
.styles-table td {
  padding: 10px 16px;
}

.formula-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.table-pagination {
  border-top: 1px solid var(--line);
  padding: 8px 14px;
  background: #fbfcfd;
}

.table-pagination:empty {
  display: none;
}

.compact-pagination {
  padding: 8px 12px;
}

.candidate-table-wrap {
  max-height: 300px;
}

.verification-table-wrap {
  max-height: 340px;
}

.recommendation-table-wrap {
  max-height: 420px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  background: #fbfcfd;
}

.candidate-table th,
.recommendation-table th,
.verification-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  line-height: 1.35;
}

.pagination-bar {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pagination-left,
.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-left {
  min-width: 0;
  flex-wrap: wrap;
}

.pagination-controls {
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(24, 32, 38, 0.04);
}

.pagination-extra {
  display: inline-flex;
  align-items: center;
}

.pagination-range {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.page-button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 720;
  line-height: 1;
}

.page-button:hover:not(:disabled) {
  background: #eefaf7;
  color: var(--teal-ink);
}

.page-button:disabled {
  cursor: default;
  color: #a8b1b9;
}

.pagination-current {
  min-width: 88px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pagination-current em {
  font-style: normal;
}

.pagination-current strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
}

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

.candidate-table {
  min-width: 1040px;
}

.verification-table {
  min-width: 980px;
}

.recommendation-row {
  cursor: pointer;
}

.recommendation-row:hover,
.recommendation-row.selected {
  background: #f2fbf9;
}

.recommendation-row.selected {
  box-shadow: inset 3px 0 0 var(--teal);
}

.recommendation-row:focus {
  outline: 2px solid rgba(15, 118, 110, 0.28);
  outline-offset: -2px;
}

.product-title {
  font-weight: 700;
}

.compact-text {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.candidate-table .compact-text,
.recommendation-table .compact-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.size-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 340px;
}

.size-chip {
  min-width: 38px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--text);
  font-size: 12px;
}

.size-chip.tiered {
  min-width: 58px;
  border-color: #badbd6;
  background: #eefaf7;
  color: var(--teal-ink);
  font-weight: 720;
}

.price-chip,
.risk-chip,
.tier-pill,
.confidence-pill,
.verify-pill,
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
}

.score-badge {
  min-width: 42px;
  height: 32px;
  background: #edf7f5;
  color: var(--teal-ink);
}

.tier-pill,
.confidence-pill {
  min-width: 64px;
  height: 26px;
  padding: 0 10px;
}

.confidence-stack {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.tier-focus {
  background: #e8f5ee;
  color: var(--green);
}

.tier-trial {
  background: #fff3dc;
  color: var(--amber);
}

.tier-avoid {
  background: #fdecea;
  color: var(--red);
}

.confidence-high {
  background: #e8f5ee;
  color: var(--green);
}

.confidence-medium {
  background: #eef2f7;
  color: var(--indigo);
}

.confidence-low {
  background: #fdecea;
  color: var(--red);
}

.verify-pill {
  min-width: 66px;
  height: 26px;
  padding: 0 10px;
}

.verify-verified {
  background: #e8f5ee;
  color: var(--green);
}

.verify-partial {
  background: #fff3dc;
  color: var(--amber);
}

.verify-depth,
.verify-review {
  background: #eef2f7;
  color: var(--indigo);
}

.risk-chip {
  max-width: 220px;
  height: 26px;
  padding: 0 9px;
  margin: 0 4px 4px 0;
  background: #fff3dc;
  color: var(--amber);
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-chip {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--text);
}

.recommendation-detail {
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
  background: #fbfcfd;
}

.recommendation-detail:empty {
  display: none;
}

.detail-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 6px;
  text-transform: uppercase;
}

h3,
h4 {
  margin: 0;
  color: var(--text);
}

h3 {
  font-size: 20px;
  line-height: 1.25;
}

h4 {
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.decision-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 16px;
  align-items: stretch;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.detail-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.detail-close-button:hover {
  color: var(--text);
  border-color: #cbd5e1;
  background: #f8fafc;
}

.detail-close-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.decision-copy {
  display: grid;
  align-content: center;
  min-width: 0;
}

.decision-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.decision-sentence {
  max-width: 920px;
  margin: 0;
  color: var(--teal-ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.detail-score {
  min-width: 104px;
  min-height: 90px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid #badbd6;
  border-radius: 8px;
  background: #eefaf7;
  color: var(--teal-ink);
}

.detail-score.score-watch {
  border-color: #efd3a2;
  background: #fff6e6;
  color: #714700;
}

.detail-score.score-weak {
  border-color: #f1bbb5;
  background: #fff0ef;
  color: #8d2f28;
}

.detail-score span {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.detail-score small,
.signal-card small,
.signal-card p,
.source-note {
  color: var(--muted);
  font-size: 12px;
}

.decision-strip {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 1fr 1.05fr;
  gap: 10px;
  margin: 10px 0;
}

.decision-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  min-height: 118px;
}

.decision-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 8px;
}

.action-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-size-chip {
  min-width: 72px;
  height: 40px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid #badbd6;
  border-radius: 8px;
  background: #eefaf7;
  color: var(--teal-ink);
}

.action-size-chip strong {
  font-size: 13px;
  line-height: 1;
}

.action-size-chip small {
  margin-top: 4px;
  color: var(--teal-ink);
  font-size: 12px;
  font-weight: 760;
}

.action-note,
.action-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-note {
  margin-top: 8px;
}

.action-empty {
  min-height: 40px;
  display: grid;
  align-content: center;
  color: var(--text);
  font-weight: 760;
}

.reason-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.reason-list li {
  padding-left: 2px;
  line-height: 1.35;
  font-size: 13px;
}

.risk-card {
  background: #fffaf0;
  border-color: #f2d2a5;
}

.risk-clear {
  min-height: 40px;
  display: grid;
  align-content: center;
  color: var(--green);
  font-size: 13px;
  font-weight: 760;
}

.risk-summary-list {
  display: grid;
  gap: 6px;
}

.risk-summary-list div {
  color: #714700;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.evidence-card {
  background: #f8fbff;
  border-color: #d8e8f6;
}

.evidence-list {
  display: grid;
  gap: 6px;
}

.evidence-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
  line-height: 1.35;
}

.evidence-item strong {
  color: var(--text);
  font-size: 12px;
}

.evidence-item span {
  color: var(--muted);
}

.evidence-item.evidence-ok span {
  color: var(--green);
  font-weight: 700;
}

.evidence-item.evidence-gap span {
  color: #805514;
  font-weight: 650;
}

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

.detail-block {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.signal-block {
  grid-column: 1 / -1;
}

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

.signal-card {
  min-height: 84px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

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

.signal-head strong {
  font-size: 20px;
}

.signal-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}

.signal-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.signal-meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.signal-card p {
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mini-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-table {
  min-width: 560px;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 9px 10px;
}

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

.risk-item {
  padding: 9px 10px;
  border: 1px solid #f2d2a5;
  border-radius: 8px;
  background: #fffaf0;
  color: #714700;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.source-note {
  margin-top: 4px;
  line-height: 1.35;
}

.source-meta,
.source-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.source-meta {
  -webkit-line-clamp: 1;
}

.source-note {
  -webkit-line-clamp: 2;
}

.products-panel .size-strip {
  max-width: 280px;
}

.empty-state {
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  padding: 18px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

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

  .sidebar {
    position: static;
    height: auto;
    grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr);
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 12px;
  }

  .brand-block {
    border-bottom: 0;
    padding: 8px;
  }

  .side-nav {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    overflow: auto;
    padding-bottom: 2px;
  }

  .nav-group {
    display: flex;
    gap: 8px;
    overflow: auto;
  }

  .nav-item {
    flex: 0 0 148px;
  }

  .nav-item-secondary {
    flex-basis: 126px;
  }

  .side-status {
    align-self: stretch;
  }

  .workspace {
    padding: 14px;
  }

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

  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

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

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

  .monitor-summary-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .monitor-inline {
    justify-content: flex-start;
  }

  .monitor-baseline {
    grid-column: 1 / -1;
  }

  .raw-data-grid {
    grid-template-columns: 1fr;
  }

  .raw-data-grid .sources-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .style-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: none;
  }

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

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

  .decision-strip {
    grid-template-columns: 1fr;
  }

  .event-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .event-link {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 12px;
  }

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

  .side-nav {
    grid-column: auto;
  }

  h1 {
    font-size: 24px;
  }

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

  .health-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .formula-label {
    white-space: normal;
  }

  .decision-hero {
    grid-template-columns: 1fr;
  }

  .detail-score {
    width: 100%;
    min-width: 0;
    height: 54px;
  }

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

  .segmented {
    width: 100%;
    overflow: auto;
  }

  .segment {
    flex: 1 0 auto;
  }

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

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

  .pagination-controls {
    width: 100%;
  }

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

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

  .tiny-button {
    flex: 1 0 auto;
  }

  .style-form {
    grid-template-columns: 1fr;
  }

  .source-map-grid {
    grid-template-columns: 1fr;
  }

  .event-link {
    grid-column: 1;
  }
}
