:root {
  font-family: var(--jm-font-sans);
  background: var(--jm-color-bg);
  color: var(--jm-color-text);
}

html {
  min-height: 100%;
  background: var(--jm-color-bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(
      circle at top left,
      color-mix(in srgb, var(--jm-color-accent) 24%, transparent),
      transparent 34rem
    ),
    linear-gradient(
      135deg,
      var(--jm-color-bg) 0%,
      var(--jm-color-bg-elevated) 100%
    );
}

.shell {
  width: min(var(--jm-desktop-content), 100%);
  margin: 0 auto;
}

.workbench-shell {
  min-height: 100dvh;
  padding: calc(var(--jm-space-shell-block) + var(--jm-safe-area-top)) 0;
  padding-inline: calc(var(--jm-space-shell-inline) + var(--jm-safe-area-left))
    calc(var(--jm-space-shell-inline) + var(--jm-safe-area-right));
  padding-bottom: calc(
    var(--jm-space-shell-block) + var(--jm-safe-area-bottom)
  );
}

.panel {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-panel);
  background: var(--jm-color-surface);
  box-shadow: var(--jm-shadow-panel);
}

.panel-strong {
  background: var(--jm-color-surface-strong);
}

.hero {
  display: grid;
  gap: var(--jm-layout-gap);
  margin-bottom: var(--jm-layout-gap);
  padding: var(--jm-space-panel);
}

.hero-copy {
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 var(--jm-space-sm);
  color: var(--jm-color-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 920px;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: var(--jm-space-sm);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.lede {
  max-width: 760px;
  color: var(--jm-color-muted);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.65;
}

.canonical-domain {
  display: inline-flex;
  margin-bottom: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-pill);
  padding: 8px 12px;
  color: var(--jm-color-muted);
  font-family: var(--jm-font-mono);
  font-size: 0.78rem;
}

.dashboard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav-link {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-pill);
  padding: 10px 14px;
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 76%,
    transparent
  );
  color: var(--jm-color-text);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
  border-color: color-mix(in srgb, var(--jm-color-accent) 68%, transparent);
  color: var(--jm-color-accent-strong);
  outline: none;
  box-shadow: var(--jm-focus-ring);
}

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(
      var(--jm-desktop-rail-min),
      var(--jm-desktop-rail-max)
    );
  gap: var(--jm-layout-gap);
}

.primary-column,
.safety-rail,
.empty-state-card {
  padding: var(--jm-space-panel);
}

.section-heading {
  max-width: 680px;
}

.primary-column p,
.safety-rail p,
.empty-state-card p {
  color: var(--jm-color-muted);
  line-height: 1.55;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-space-sm);
  margin-top: var(--jm-space-lg);
}

.metric-row > div {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: 16px;
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 82%,
    transparent
  );
}

.metric-label {
  display: block;
  margin-bottom: var(--jm-space-xs);
  color: var(--jm-color-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.safety-rail {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: flex-start;
}

.empty-state-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--jm-layout-gap);
  margin-top: var(--jm-layout-gap);
}

.private-dashboard-shell {
  margin-top: var(--jm-layout-gap);
  padding: var(--jm-space-panel);
}

.private-dashboard-shell .section-heading {
  margin-bottom: var(--jm-space-md);
}

.identity-card {
  border: 1px solid
    color-mix(in srgb, var(--jm-color-accent) 34%, var(--jm-color-border));
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: color-mix(
    in srgb,
    var(--jm-color-surface) 76%,
    var(--jm-color-accent) 8%
  );
}

.verified-badge {
  display: inline-flex;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--jm-color-accent) 70%, transparent);
  border-radius: var(--jm-radius-pill);
  padding: 8px 12px;
  background: color-mix(in srgb, var(--jm-color-accent) 14%, transparent);
  color: var(--jm-color-accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--jm-space-sm);
}

.identity-grid > div {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: 14px;
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 82%,
    transparent
  );
}

.identity-grid strong {
  overflow-wrap: anywhere;
}

.private-empty-state-grid {
  margin-top: var(--jm-layout-gap);
}

.empty-state-safety {
  border-left: 3px solid
    color-mix(in srgb, var(--jm-color-accent) 64%, transparent);
  padding-left: var(--jm-space-sm);
  font-size: 0.9rem;
}

.empty-state-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  align-items: flex-start;
}

.empty-state-card h2 {
  margin-bottom: 10px;
}

.empty-state-card p:last-of-type {
  margin-bottom: var(--jm-space-md);
}

.safe-cta {
  display: inline-flex;
  margin-top: auto;
  border: 1px solid color-mix(in srgb, var(--jm-color-accent) 62%, transparent);
  border-radius: var(--jm-radius-pill);
  padding: 10px 14px;
  background: color-mix(in srgb, var(--jm-color-accent) 12%, transparent);
  color: var(--jm-color-accent-strong);
  font-size: 0.86rem;
  font-weight: 900;
}

.report-shell {
  margin-top: var(--jm-layout-gap);
  padding: var(--jm-space-panel);
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: var(--jm-layout-gap);
  align-items: flex-start;
  margin-bottom: var(--jm-space-md);
}

.report-header .section-heading > p:last-child,
.fixture-banner p,
.report-state p {
  color: var(--jm-color-muted);
  line-height: 1.55;
}

.report-honesty-labels {
  flex: 0 0 auto;
  align-items: flex-end;
}

.report-root {
  min-height: 220px;
}

.report-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-lg);
  background: color-mix(in srgb, var(--jm-color-surface) 78%, transparent);
  text-align: center;
}

.report-state p {
  max-width: 560px;
  margin: 0;
}

.fixture-banner {
  display: grid;
  gap: var(--jm-space-xs);
  margin-bottom: var(--jm-space-md);
  border: 1px solid
    color-mix(in srgb, var(--jm-color-warning) 70%, var(--jm-color-border));
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: color-mix(
    in srgb,
    var(--jm-color-warning) 10%,
    var(--jm-color-surface)
  );
}

.fixture-banner__kicker {
  color: var(--jm-color-warning);
  font-family: var(--jm-font-mono);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fixture-banner p {
  margin: 0;
}

.report-context-grid,
.report-metrics-grid,
.report-provenance-grid {
  display: grid;
  gap: var(--jm-space-sm);
}

.report-context-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-metrics-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: var(--jm-space-sm);
}

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

.report-field {
  min-width: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: 14px;
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 82%,
    transparent
  );
}

.report-field strong {
  display: block;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.report-metrics-grid .report-field strong {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
}

.report-field--positive strong {
  color: var(--jm-color-accent-strong);
}

.report-field--negative strong {
  color: var(--jm-color-warning);
}

.report-provenance {
  margin-top: var(--jm-space-md);
  border-top: 1px solid var(--jm-color-border);
  padding-top: var(--jm-space-md);
}

.report-export-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--jm-layout-gap);
  align-items: center;
  margin-top: var(--jm-space-md);
  border-top: 1px solid var(--jm-color-border);
  padding-top: var(--jm-space-md);
}

.report-export-shell[hidden],
.report-checkpoint-link[hidden] {
  display: none;
}

.report-export-shell h3 {
  margin: 0 0 var(--jm-space-xs);
  font-size: 1.1rem;
}

.report-export-note {
  max-width: 680px;
  margin: 0;
  color: var(--jm-color-muted);
  line-height: 1.55;
}

.report-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jm-space-sm);
  justify-content: flex-end;
}

.report-export-trigger,
.report-checkpoint-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--jm-color-accent) 62%, transparent);
  border-radius: var(--jm-radius-pill);
  padding: 10px 14px;
  background: color-mix(in srgb, var(--jm-color-accent) 12%, transparent);
  color: var(--jm-color-accent-strong);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.report-checkpoint-link {
  border-color: var(--jm-color-border);
  background: var(--jm-color-surface);
  color: var(--jm-color-text);
}

.report-export-trigger:hover,
.report-export-trigger:focus-visible,
.report-checkpoint-link:hover,
.report-checkpoint-link:focus-visible {
  border-color: var(--jm-color-accent);
  outline: none;
  box-shadow: var(--jm-focus-ring);
}

.address-profile-shell {
  margin-top: var(--jm-layout-gap);
  padding: var(--jm-space-panel);
}

.address-profile-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: var(--jm-layout-gap);
  align-items: end;
  margin-bottom: var(--jm-space-md);
}

.address-profile-intro .section-heading p:last-child,
.address-profile-header p,
.profile-coverage-note,
.profile-detail-empty,
.address-profile-state p {
  color: var(--jm-color-muted);
  line-height: 1.55;
}

.address-profile-form label {
  display: block;
  margin-bottom: var(--jm-space-xs);
  color: var(--jm-color-subtle);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.address-profile-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--jm-space-xs);
}

.address-profile-input-row input,
.address-profile-input-row button,
.profile-window {
  min-height: 44px;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-pill);
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 86%,
    transparent
  );
  color: var(--jm-color-text);
  font: inherit;
}

.address-profile-input-row input {
  min-width: 0;
  padding: 10px 14px;
  font-family: var(--jm-font-mono);
}

.address-profile-input-row button,
.profile-window {
  padding: 10px 14px;
  color: var(--jm-color-accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.address-profile-input-row input:focus-visible,
.address-profile-input-row button:focus-visible,
.profile-window:focus-visible {
  border-color: var(--jm-color-accent);
  outline: none;
  box-shadow: var(--jm-focus-ring);
}

.address-profile-root {
  min-height: 260px;
}

.address-profile-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-lg);
  background: color-mix(in srgb, var(--jm-color-surface) 78%, transparent);
  text-align: center;
}

.address-profile-state p {
  max-width: 620px;
  margin: 0;
}

.address-profile-view {
  display: grid;
  gap: var(--jm-space-md);
}

.address-profile-header {
  display: flex;
  justify-content: space-between;
  gap: var(--jm-layout-gap);
  align-items: flex-start;
}

.address-profile-header h3 {
  margin: var(--jm-space-sm) 0 var(--jm-space-xs);
  overflow-wrap: anywhere;
  font-family: var(--jm-font-mono);
  font-size: clamp(1rem, 2.3vw, 1.35rem);
}

.address-profile-header p {
  margin: 0;
}

[data-address-profile-label="observed"] {
  border-color: color-mix(in srgb, var(--jm-color-accent) 64%, transparent);
  background: color-mix(in srgb, var(--jm-color-accent) 12%, transparent);
  color: var(--jm-color-accent-strong);
}

.profile-window-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jm-space-xs);
  justify-content: flex-end;
}

.profile-window--active {
  border-color: var(--jm-color-accent);
  background: color-mix(
    in srgb,
    var(--jm-color-accent) 20%,
    var(--jm-color-surface)
  );
}

.profile-curve-shell {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: color-mix(in srgb, var(--jm-color-surface) 80%, transparent);
}

.profile-curve {
  display: block;
  width: 100%;
  height: clamp(180px, 30vw, 300px);
  overflow: visible;
}

.profile-curve polyline {
  fill: none;
  stroke: var(--jm-color-accent-strong);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.profile-curve-empty,
.profile-coverage-note {
  margin: 0;
}

.profile-coverage-note {
  margin-top: var(--jm-space-xs);
  font-size: 0.88rem;
}

.profile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--jm-space-sm);
}

.profile-metric {
  min-width: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: 14px;
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 82%,
    transparent
  );
}

.profile-metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1.08rem, 2vw, 1.4rem);
  font-variant-numeric: tabular-nums;
}

.profile-metric--positive strong {
  color: var(--jm-color-accent-strong);
}

.profile-metric--negative strong,
.profile-metric--unavailable strong {
  color: var(--jm-color-warning);
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-layout-gap);
}

.profile-detail-panel {
  min-width: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
}

.profile-detail-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--jm-space-xs);
  padding: var(--jm-space-sm) 0;
  border-top: 1px solid var(--jm-color-border);
}

.profile-detail-row strong,
.profile-detail-row time {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .dashboard-nav {
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .workbench-shell {
    width: min(var(--jm-mini-app-content), 100%);
    padding-top: calc(var(--jm-space-lg) + var(--jm-safe-area-top));
    padding-inline: calc(var(--jm-space-sm) + var(--jm-safe-area-left))
      calc(var(--jm-space-sm) + var(--jm-safe-area-right));
    padding-bottom: calc(var(--jm-space-lg) + var(--jm-safe-area-bottom));
  }

  .dashboard-nav,
  .nav-link {
    width: 100%;
  }

  .workbench-layout,
  .metric-row,
  .identity-grid,
  .empty-state-grid,
  .address-profile-intro,
  .profile-metrics-grid,
  .profile-detail-grid,
  .profile-detail-row,
  .report-context-grid,
  .report-metrics-grid,
  .report-provenance-grid {
    grid-template-columns: 1fr;
  }

  .address-profile-header,
  .address-profile-input-row,
  .report-header,
  .report-export-shell {
    display: grid;
    grid-template-columns: 1fr;
  }

  .profile-window-controls {
    justify-content: flex-start;
  }

  .address-profile-input-row button {
    width: 100%;
  }

  .report-export-actions {
    width: 100%;
    flex-direction: column;
  }

  .report-export-trigger,
  .report-checkpoint-link {
    width: 100%;
  }

  .report-honesty-labels {
    align-items: flex-start;
  }

  .canonical-domain {
    display: flex;
    width: 100%;
    overflow-wrap: anywhere;
  }
}

/* —— J2 —— */

.j2-shell {
  padding: var(--jm-space-panel);
}

.j2-intro,
.j2-result-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--jm-layout-gap);
  align-items: flex-start;
  margin-bottom: var(--jm-space-md);
}

.j2-intro .section-heading > p:last-child,
.j2-hint,
.j2-state p,
.j2-models p,
.j2-models li,
.j2-filter-count,
.j2-chart-empty {
  color: var(--jm-color-muted);
  line-height: 1.55;
}

.j2-form {
  display: grid;
  gap: var(--jm-space-md);
  margin-bottom: var(--jm-space-md);
}

.j2-fieldset {
  margin: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: color-mix(in srgb, var(--jm-color-surface) 78%, transparent);
}

.j2-fieldset legend {
  padding: 0 8px;
  color: var(--jm-color-accent-strong);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.j2-fieldset--disabled {
  opacity: 0.72;
}

.j2-badge {
  display: inline-flex;
  margin-left: 8px;
  border: 1px solid color-mix(in srgb, var(--jm-color-warning) 56%, transparent);
  border-radius: var(--jm-radius-pill);
  padding: 4px 8px;
  background: var(--jm-color-warning-surface);
  color: var(--jm-color-warning);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.j2-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-space-sm);
}

.j2-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.j2-control--wide {
  grid-column: 1 / -1;
}

.j2-control label,
.j2-table-filters label {
  color: var(--jm-color-subtle);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.j2-control input,
.j2-control select,
.j2-table-filters select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-pill);
  padding: 10px 14px;
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 86%,
    transparent
  );
  color: var(--jm-color-text);
  font: inherit;
}

.j2-control input[readonly] {
  opacity: 0.85;
  cursor: not-allowed;
}

.j2-control input:focus-visible,
.j2-control select:focus-visible,
.j2-table-filters select:focus-visible,
.j2-run:focus-visible {
  border-color: var(--jm-color-accent);
  outline: none;
  box-shadow: var(--jm-focus-ring);
}

.j2-control input[aria-invalid="true"],
.j2-control select[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--jm-color-warning) 72%, transparent);
}

.j2-hint {
  margin: 0;
  font-size: 0.86rem;
}

.j2-field-error,
.j2-error-summary {
  margin: 0;
  color: var(--jm-color-warning);
  font-size: 0.88rem;
  font-weight: 700;
}

.j2-error-summary {
  border: 1px solid color-mix(in srgb, var(--jm-color-warning) 56%, transparent);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-sm) var(--jm-space-md);
  background: var(--jm-color-warning-surface);
}

.j2-checkbox {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--jm-color-text);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.j2-asset-fields {
  margin-top: var(--jm-space-sm);
}

.j2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jm-space-sm);
  align-items: center;
}

.j2-run {
  min-height: 48px;
  border: 1px solid color-mix(in srgb, var(--jm-color-accent) 70%, transparent);
  border-radius: var(--jm-radius-pill);
  padding: 12px 20px;
  background: color-mix(in srgb, var(--jm-color-accent) 18%, transparent);
  color: var(--jm-color-accent-strong);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
}

.j2-run:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.j2-result-root {
  min-height: 240px;
}

.j2-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  border: 1px dashed var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-lg);
  background: color-mix(in srgb, var(--jm-color-surface) 78%, transparent);
  text-align: center;
}

.j2-state p {
  max-width: 640px;
  margin: 0;
}

.j2-result {
  display: grid;
  gap: var(--jm-space-md);
}

.j2-safety-banner {
  position: sticky;
  top: 12px;
  z-index: 2;
}

.j2-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-layout-gap);
}

.j2-sim-card {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: color-mix(
    in srgb,
    var(--jm-color-surface-strong) 84%,
    transparent
  );
}

.j2-sim-card__header h3 {
  margin: 0 0 var(--jm-space-sm);
  font-size: 1.15rem;
}

.j2-sim-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-space-sm);
}

.j2-field {
  min-width: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--jm-color-surface) 80%, transparent);
}

.j2-field strong,
.j2-decimal,
.j2-mono {
  display: block;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.j2-mono,
.j2-decimal {
  font-family: var(--jm-font-mono);
  font-size: 0.9rem;
}

.j2-charts,
.j2-decisions,
.j2-coverage,
.j2-provenance {
  border-top: 1px solid var(--jm-color-border);
  padding-top: var(--jm-space-md);
}

.j2-chart-shell {
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: color-mix(in srgb, var(--jm-color-surface) 80%, transparent);
}

.j2-chart-shell--observed {
  margin-top: var(--jm-space-sm);
}

.j2-chart {
  display: block;
  width: 100%;
  height: clamp(160px, 28vw, 240px);
}

.j2-chart-series {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.j2-chart-series--baseline {
  stroke: var(--jm-color-accent-strong);
}

.j2-chart-series--filtered {
  stroke: var(--jm-color-warning);
  stroke-dasharray: 8 5;
}

.j2-chart-series--observed {
  stroke: #64d8ff;
}

.j2-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jm-space-sm);
  margin: var(--jm-space-sm) 0 0;
  padding: 0;
  list-style: none;
  color: var(--jm-color-muted);
  font-size: 0.88rem;
}

.j2-swatch {
  display: inline-block;
  width: 18px;
  height: 4px;
  margin-right: 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.j2-swatch--baseline {
  background: var(--jm-color-accent-strong);
}

.j2-swatch--filtered {
  background: repeating-linear-gradient(
    90deg,
    var(--jm-color-warning) 0 8px,
    transparent 8px 12px
  );
}

.j2-observed-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 var(--jm-space-sm);
  color: var(--jm-color-muted);
  font-size: 0.9rem;
}

.j2-table-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--jm-space-sm);
  margin-bottom: var(--jm-space-sm);
}

.j2-table-filters label {
  display: grid;
  gap: 6px;
}

.j2-table-wrap,
.j2-chart-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  background: color-mix(in srgb, var(--jm-color-surface) 80%, transparent);
}

.j2-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.j2-table--compact {
  min-width: 480px;
}

.j2-table caption {
  padding: 12px 14px;
  color: var(--jm-color-subtle);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.j2-table th,
.j2-table td {
  border-bottom: 1px solid var(--jm-color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.j2-table th {
  color: var(--jm-color-subtle);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.j2-table tbody tr[data-j2-action-row] {
  cursor: pointer;
}

.j2-table tbody tr[data-j2-action-row]:hover,
.j2-table tbody tr[data-j2-action-row]:focus-visible {
  background: color-mix(in srgb, var(--jm-color-accent) 10%, transparent);
  outline: none;
}

.j2-status {
  display: inline-flex;
  border-radius: var(--jm-radius-pill);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.j2-status--retained {
  border: 1px solid color-mix(in srgb, var(--jm-color-accent) 58%, transparent);
  background: color-mix(in srgb, var(--jm-color-accent) 12%, transparent);
  color: var(--jm-color-accent-strong);
}

.j2-status--removed {
  border: 1px solid color-mix(in srgb, var(--jm-color-warning) 56%, transparent);
  background: var(--jm-color-warning-surface);
  color: var(--jm-color-warning);
}

.j2-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-space-sm);
  margin: 0;
}

.j2-detail-grid dt {
  color: var(--jm-color-subtle);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.j2-detail-grid dd {
  margin: 4px 0 0;
}

.j2-coverage-warning {
  margin-bottom: var(--jm-space-sm);
  border: 1px solid color-mix(in srgb, var(--jm-color-warning) 60%, transparent);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-md);
  background: var(--jm-color-warning-surface);
}

.j2-coverage-warning strong {
  color: var(--jm-color-warning);
}

.j2-coverage-warning p {
  margin: 8px 0 0;
  color: var(--jm-color-muted);
}

.j2-policy-details {
  margin-top: var(--jm-space-md);
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-sm) var(--jm-space-md);
  background: color-mix(in srgb, var(--jm-color-surface) 80%, transparent);
}

.j2-policy-details summary {
  cursor: pointer;
  font-weight: 800;
}

.j2-policy-json {
  overflow-x: auto;
  margin: var(--jm-space-sm) 0 0;
  color: var(--jm-color-muted);
  font-family: var(--jm-font-mono);
  font-size: 0.78rem;
  white-space: pre;
}

.j2-models ul {
  margin: var(--jm-space-xs) 0 0;
  padding-left: 1.2rem;
}

.j2-filter-count {
  margin: var(--jm-space-xs) 0 0;
  font-size: 0.88rem;
}

/* Integration fixes found during the supplied desktop demo review. */
.j2-shell {
  margin-top: var(--jm-layout-gap);
}

.j2-checkbox input {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
}

.j2-result,
.j2-summary,
.j2-charts,
.j2-decisions,
.j2-coverage,
.j2-provenance {
  min-width: 0;
}

.pine-import-shell {
  display: grid;
  gap: var(--jm-space-md);
  margin-top: var(--jm-layout-gap);
  padding: var(--jm-space-panel);
}

.pine-import-intro,
.pine-review-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--jm-layout-gap);
  align-items: start;
}

.pine-import-truth,
.pine-review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--jm-space-xs);
  justify-content: flex-end;
}

.pine-review-status,
.pine-review-verification {
  display: inline-flex;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-pill);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 850;
}

.pine-review-status {
  border-color: color-mix(in srgb, var(--jm-color-accent) 58%, transparent);
  color: var(--jm-color-accent-strong);
}

.pine-review-verification {
  border-color: color-mix(in srgb, var(--jm-color-warning) 58%, transparent);
  color: var(--jm-color-warning);
}

.pine-review-safety,
.pine-review-unverified {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--jm-color-warning) 56%, transparent);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-sm) var(--jm-space-md);
  background: var(--jm-color-warning-surface);
  color: var(--jm-color-warning);
  font-weight: 750;
}

.pine-import-form,
.pine-review {
  display: grid;
  min-width: 0;
  gap: var(--jm-space-md);
}

.pine-import-form > label {
  font-weight: 800;
}

.pine-import-form textarea,
.pine-import-file input,
.pine-review-setting input {
  width: 100%;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--jm-color-surface) 82%, transparent);
  color: var(--jm-color-text);
  font: inherit;
}

.pine-import-form textarea {
  min-height: 260px;
  resize: vertical;
  font-family: var(--jm-font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
}

.pine-import-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--jm-space-md);
  align-items: end;
}

.pine-import-file {
  display: grid;
  gap: var(--jm-space-xs);
  color: var(--jm-color-muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.pine-import-actions button {
  min-height: 48px;
  border: 1px solid color-mix(in srgb, var(--jm-color-accent) 70%, transparent);
  border-radius: var(--jm-radius-pill);
  padding: 12px 20px;
  background: color-mix(in srgb, var(--jm-color-accent) 18%, transparent);
  color: var(--jm-color-accent-strong);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.pine-import-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pine-import-form textarea:focus-visible,
.pine-import-file input:focus-visible,
.pine-import-actions button:focus-visible {
  border-color: var(--jm-color-accent);
  outline: none;
  box-shadow: var(--jm-focus-ring);
}

.pine-import-hint {
  margin: 0;
  color: var(--jm-color-muted);
  font-size: 0.86rem;
}

.pine-review-root,
.pine-review {
  min-width: 0;
}

.pine-review-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-lg);
  background: color-mix(in srgb, var(--jm-color-surface) 78%, transparent);
  text-align: center;
}

.pine-review-state p {
  max-width: 640px;
  margin: 0;
}

.pine-review-identity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-space-sm);
  margin: 0;
}

.pine-review-identity > div,
.pine-review-setting {
  min-width: 0;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
  padding: var(--jm-space-sm);
  background: color-mix(in srgb, var(--jm-color-surface) 80%, transparent);
}

.pine-review-identity dt {
  color: var(--jm-color-subtle);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pine-review-identity dd {
  overflow-wrap: anywhere;
  margin: 6px 0 0;
}

.pine-review-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--jm-space-sm);
}

.pine-review-setting {
  display: grid;
  gap: var(--jm-space-xs);
}

.pine-review-setting span {
  font-weight: 800;
}

.pine-review-setting small {
  color: var(--jm-color-muted);
}

.pine-review-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--jm-color-border);
  border-radius: var(--jm-radius-card);
}

.pine-review-rules {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.pine-review-rules th,
.pine-review-rules td {
  border-bottom: 1px solid var(--jm-color-border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.pine-review-rules code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pine-review-line {
  color: var(--jm-color-accent-strong);
  font-family: var(--jm-font-mono);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .j2-intro,
  .j2-form-grid,
  .j2-summary,
  .j2-sim-grid,
  .j2-table-filters,
  .j2-result-header,
  .j2-detail-grid {
    grid-template-columns: 1fr;
  }

  .pine-import-intro,
  .pine-review-header,
  .pine-import-actions,
  .pine-review-identity,
  .pine-review-settings {
    grid-template-columns: 1fr;
  }

  .pine-import-truth,
  .pine-review-badges {
    justify-content: flex-start;
  }

  .pine-import-actions button {
    width: 100%;
  }

  .j2-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .j2-run {
    width: 100%;
  }
}
