:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-muted: #f0eee8;
  --text: #242424;
  --muted: #69675f;
  --line: #d8d4c9;
  --accent: #176b65;
  --accent-strong: #0f4f4a;
  --amber: #b7791f;
  --red: #b42318;
  --green: #247a42;
  --blue: #2c5aa0;
  --shadow: 0 18px 50px rgba(37, 34, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
input[type="number"],
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fbfaf7;
  overflow-y: auto;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
  margin-bottom: 28px;
}

.brand-block > div {
  min-width: 0;
}

.dashboard-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.dashboard-nav a,
.dashboard-nav button {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-nav a[aria-current="page"],
.dashboard-nav button[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(37, 34, 28, 0.1);
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.2rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.1rem;
  line-height: 1.3;
}

h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.brand-block p,
.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#modelStatus {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.setup-form,
.field {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.static-campaign-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.review-skill-panel {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid #b9d8d2;
  border-radius: 8px;
  background: #eef7f4;
}

.review-skill-panel div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.review-skill-panel span,
.review-skill-panel small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.review-skill-panel strong {
  font-size: 0.86rem;
}

.skill-status-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.criteria-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.criteria-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.pillar-toggle {
  position: relative;
  min-width: 0;
}

.pillar-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pillar-toggle span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.pillar-toggle input:checked + span {
  border-color: #9ccbc4;
  color: var(--accent-strong);
  background: #eef7f4;
}

.pillar-toggle input:focus-visible + span {
  outline: 3px solid rgba(23, 107, 101, 0.24);
  outline-offset: 1px;
}

.pillar-toggle input:disabled + span {
  cursor: not-allowed;
  opacity: 0.54;
}

.campaign-constraints-fieldset {
  grid-column: 1 / -1;
}

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

.constraint-toggle {
  position: relative;
  min-width: 0;
}

.constraint-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.constraint-toggle span {
  display: grid;
  min-height: 38px;
  place-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.constraint-toggle input:checked + span {
  border-color: #d9a441;
  color: #77510a;
  background: #fff8e8;
}

.constraint-toggle input:focus-visible + span {
  outline: 3px solid rgba(189, 126, 17, 0.22);
  outline-offset: 1px;
}

.constraint-toggle input:disabled + span {
  cursor: not-allowed;
  opacity: 0.54;
}

.evaluation-mode-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.evaluation-mode-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented-control label {
  position: relative;
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 36px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control input:checked + span {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(37, 34, 28, 0.1);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(23, 107, 101, 0.24);
  outline-offset: 1px;
}

.review-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.review-settings summary {
  padding: 12px 14px;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.review-settings[open] summary {
  border-bottom: 1px solid var(--line);
}

.review-settings-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.settings-inline {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.think-control {
  display: flex;
  min-height: 44px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.think-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.context-field {
  gap: 7px;
}

.settings-refresh {
  width: 100%;
}

.field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

select {
  min-height: 44px;
  padding: 0 12px;
}

input[type="number"] {
  min-height: 44px;
  padding: 0 10px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

select:focus,
textarea:focus,
button:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid rgba(23, 107, 101, 0.24);
  outline-offset: 2px;
}

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

.primary-button,
.secondary-button {
  min-height: 42px;
  min-width: 0;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 800;
}

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

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--accent);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.main-panel {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
}

.dashboard-panel {
  display: grid;
  gap: 22px;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 8px 0 36px;
}

.dashboard-panel[hidden],
#reviewerWorkspace[hidden] {
  display: none;
}

.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 4px;
}

.workspace-header > div {
  display: grid;
  gap: 4px;
}

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

.dashboard-summary-grid article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-summary-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-summary-grid strong {
  overflow-wrap: anywhere;
  font-size: 1.45rem;
  line-height: 1.15;
}

.history-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.review-history-list {
  display: grid;
  gap: 10px;
}

.review-history-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fcfcfa;
}

.review-history-card.status-completed {
  border-left-color: var(--green);
}

.review-history-card.status-running,
.review-history-card.status-queued {
  border-left-color: var(--amber);
}

.review-history-card.status-failed {
  border-left-color: var(--red);
}

.history-card-heading,
.history-card-footer,
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-card-heading > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-card-heading strong,
.history-card-heading span,
.history-card-footer span {
  overflow-wrap: anywhere;
}

.history-card-heading span,
.history-card-footer span,
.history-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.history-meta strong {
  color: var(--text);
}

.history-status-chip,
.priority-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.history-status-chip.status-completed {
  color: #176b35;
  background: #e8f5e9;
}

.history-status-chip.status-running,
.history-status-chip.status-queued {
  color: #8a5508;
  background: #fff4d8;
}

.history-status-chip.status-failed {
  color: #9c2018;
  background: #fff0ee;
}

.history-empty-state,
.asset-preview-fallback {
  display: grid;
  min-height: 112px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfaf7;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.history-empty-state {
  padding: 22px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.upload-band,
.asset-section,
.panel-block,
.score-card,
.status-panel,
.error-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.upload-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 42%);
  gap: 20px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 22px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.drop-zone {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: #eef7f4;
  text-align: center;
}

.drop-zone.dragging {
  background: #dff0ed;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-action {
  color: var(--accent-strong);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.drop-meta {
  color: var(--muted);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.asset-section,
.results-panel {
  width: 100%;
  max-width: 100%;
  margin-top: 22px;
}

.asset-section {
  padding: 20px;
}

.loaded-campaign-banner {
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--accent-strong);
  background: #eef7f4;
  font-size: 0.88rem;
  font-weight: 800;
}

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

.section-header.compact {
  margin-bottom: 12px;
}

.counter,
.small-score,
.rating-badge,
.tag,
.decision {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.counter,
.small-score {
  border: 1px solid var(--line);
  background: var(--surface-muted);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.empty-state {
  display: grid;
  min-height: 126px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.asset-card {
  display: grid;
  grid-template-rows: 132px auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.asset-preview {
  position: relative;
  display: grid;
  place-items: baseline;
  background: #e9e4d8;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.asset-id {
  position: absolute;
  left: 8px;
  top: 8px;
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  font-weight: 900;
}

.asset-remove-button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(45, 42, 36, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(45, 42, 36, 0.12);
}

.asset-remove-button:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}

.asset-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.asset-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.asset-name {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.asset-status {
  font-size: 0.8rem;
  font-weight: 800;
}

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

.status-pending {
  color: var(--amber);
}

.status-error {
  color: var(--red);
}

.status-panel {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 22px;
  padding: 18px;
}

.status-copy {
  min-width: 0;
  flex: 1;
}

.status-estimate {
  margin: 5px 0 0;
  color: var(--accent-strong);
  font-size: 0.77rem;
  font-weight: 800;
  line-height: 1.35;
}

.elapsed-timer {
  min-width: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.evaluation-path {
  display: grid;
  grid-column: 2 / -1;
  gap: 8px;
  margin: 2px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.evaluation-step {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 2px 0;
}

.evaluation-step-state {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border: 2px solid #b9b5aa;
  border-radius: 50%;
  background: var(--surface);
}

.evaluation-step.status-running .evaluation-step-state {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px #d7eee8;
}

.evaluation-step.status-completed .evaluation-step-state {
  border-color: #23804c;
  background: #23804c;
}

.evaluation-step.status-skipped .evaluation-step-state {
  border-color: #9a9589;
  background: #dedbd3;
}

.evaluation-step.status-failed .evaluation-step-state {
  border-color: #b42318;
  background: #b42318;
}

.evaluation-step p {
  margin: 2px 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.evaluation-step-meta,
.ledger-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.evaluation-step-meta {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.71rem;
}

.evaluation-step-assets {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-panel[hidden],
.error-panel[hidden],
.results-panel[hidden] {
  display: none;
}

.loader {
  width: 32px;
  height: 32px;
  border: 4px solid #d4eee7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-panel {
  margin-top: 22px;
  padding: 16px;
  border-color: rgba(180, 35, 24, 0.35);
  color: #7a2018;
  background: #fff4f2;
}

.score-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 16px;
}

.score-card,
.panel-block {
  padding: 18px;
}

.score-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.rating-badge {
  color: #ffffff;
  background: var(--accent);
}

.rating-poor,
.rating-weak {
  background: var(--red);
}

.rating-fair {
  background: var(--amber);
}

.rating-good,
.rating-strong,
.rating-excellent {
  background: var(--green);
}

.final-score {
  display: block;
  margin: 6px 0 0;
  font-size: 4rem;
  line-height: 0.9;
}

.score-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.model-tag {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.score-computation {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.processing-meta {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

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

.pillar-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.pillar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e2d5;
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.pillar-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.campaign-panel,
.entity-panel {
  margin-top: 16px;
}

.campaign-summary {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.campaign-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.campaign-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fbfaf7;
}

.campaign-group-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.campaign-evidence {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.entity-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.entity-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fbfaf7;
}

.entity-group-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.entity-group p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.risk-high {
  border-left-color: var(--red);
}

.risk-medium {
  border-left-color: var(--amber);
}

.risk-low {
  border-left-color: var(--green);
}

.hero-tag {
  color: #ffffff;
  background: var(--blue);
}

.panel-block {
  min-width: 0;
}

.results-panel > .panel-block {
  margin-top: 16px;
}

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

.diversity-check {
  display: grid;
  min-height: 78px;
  gap: 8px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.diversity-check span {
  width: max-content;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
}

.diversity-check strong {
  font-size: 0.82rem;
  line-height: 1.35;
}

.check-fail {
  border-color: rgba(180, 35, 24, 0.35);
  background: #fff5f3;
}

.check-fail span {
  color: var(--red);
}

.asset-metadata-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.asset-metadata-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.asset-metadata-heading {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.asset-metadata-heading div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.asset-metadata-heading span:not(.tag) {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-metadata-item dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.asset-metadata-item dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.asset-metadata-item dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.asset-metadata-item dd {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.route-tag {
  display: inline-block;
  margin: 0 6px 3px 0;
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--accent-strong);
  background: #e4f1ee;
  font-size: 0.65rem;
  font-weight: 850;
}

.generation-table {
  min-width: 760px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.decision {
  min-width: 82px;
  color: #ffffff;
  background: var(--blue);
}

.decision-keep {
  background: var(--green);
}

.decision-revise,
.decision-human_review {
  background: var(--amber);
}

.decision-reject {
  background: var(--red);
}

.note-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  background: #f1efe8;
  color: var(--text);
}

.issue-list {
  display: grid;
  gap: 12px;
}

.issue-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.issue-card strong {
  line-height: 1.35;
}

.issue-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.issue-card.audit-pass {
  border-left: 3px solid var(--green);
}

.issue-card.audit-warning {
  border-left: 3px solid var(--amber);
}

.issue-card.audit-fail {
  border-left: 3px solid var(--red);
}

.issue-card.audit-not_applicable {
  border-left: 3px solid #98a2b3;
}

.coaching-grid {
  display: grid;
  gap: 10px;
}

.coaching-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fcfcfa;
}

.coaching-item h4 {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coaching-item ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.recommendation-list {
  display: grid;
  gap: 10px;
}

.recommendation-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fbfaf7;
}

.recommendation-item p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.priority-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--amber);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.priority-high {
  border-left-color: var(--red);
}

.priority-high .priority-label {
  background: var(--red);
}

.priority-med {
  border-left-color: var(--amber);
}

.priority-low {
  border-left-color: var(--blue);
}

.priority-low .priority-label {
  background: var(--blue);
}

.severity-high {
  border-left: 4px solid var(--red);
}

.severity-medium {
  border-left: 4px solid var(--amber);
}

.severity-low {
  border-left: 4px solid var(--blue);
}

.decision-workspace-panel {
  margin-top: 16px;
}

.asset-decision-workspace {
  display: grid;
  gap: 12px;
}

.decision-empty-state {
  min-height: 108px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-muted);
}

.asset-decision-card {
  min-width: 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
}

.asset-decision-card.decision-ready {
  border-left-color: var(--green);
}

.asset-decision-card.decision-improve {
  border-left-color: var(--amber);
}

.asset-decision-card.decision-replace {
  border-left-color: var(--red);
}

.asset-decision-card.decision-human_review {
  border-left-color: var(--blue);
}

.asset-decision-summary {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto 18px;
  gap: 14px;
  align-items: center;
  min-height: 100px;
  padding: 10px 14px 10px 10px;
  cursor: pointer;
  list-style: none;
}

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

.asset-decision-summary:focus-visible {
  outline: 3px solid rgba(23, 107, 101, 0.24);
  outline-offset: -3px;
}

.decision-thumbnail {
  width: 84px;
  height: 76px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
}

.decision-thumbnail img,
.decision-thumbnail video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.decision-thumbnail-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.decision-summary-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.decision-summary-heading {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: baseline;
}

.decision-summary-heading strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
}

.decision-summary-heading span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-summary-copy p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.decision-summary-status {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.decision-status,
.priority-chip,
.impact-chip,
.dimension-chip,
.keep-chip,
.overlap-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.decision-status {
  border: 1px solid transparent;
}

.status-ready {
  border-color: #b8d8bf;
  color: #246e39;
  background: #eef8f0;
}

.decision-status.status-improve {
  border-color: #efd08a;
  color: #805e00;
  background: #fff8e4;
}

.decision-status.status-replace {
  border-color: #efbeb8;
  color: #a12e23;
  background: #fff1ef;
}

.decision-status.status-human_review {
  border-color: #b8cbe0;
  color: #285f8f;
  background: #edf5fc;
}

.priority-chip {
  border: 1px solid transparent;
}

.priority-critical {
  color: #ffffff;
  background: #b42318;
}

.priority-high {
  color: #ffffff;
  background: #b85d12;
}

.priority-medium {
  border-color: #ead579;
  color: #705600;
  background: #fff7ca;
}

.priority-low {
  border-color: #d8d8d2;
  color: #5f615b;
  background: #f1f1ed;
}

.decision-expand {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.asset-decision-card[open] .decision-expand {
  transform: rotate(225deg) translate(-2px, -2px);
}

.asset-decision-card[open] .asset-decision-summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.asset-decision-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.decision-section {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fcfcfa;
}

.decision-section:nth-child(4),
.decision-section:nth-child(6),
.decision-section:nth-child(7) {
  grid-column: 1 / -1;
}

.decision-section h4 {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.decision-section p,
.decision-empty-copy {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.overlap-list {
  display: grid;
  gap: 10px;
}

.overlap-entry {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.overlap-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.overlap-chip {
  border: 1px solid #b8cbe0;
  color: #285f8f;
  background: #edf5fc;
  cursor: pointer;
}

.overlap-chip:hover,
.overlap-chip:focus-visible {
  border-color: var(--blue);
  background: #dfeefa;
}

.dimension-chip-list,
.keep-chip-list,
.impact-chip-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.dimension-chip {
  border: 1px solid #d5d7d2;
  color: #5d625b;
  background: #f5f6f2;
}

.keep-chip {
  border: 1px solid #b8d8bf;
  color: #246e39;
  background: #eef8f0;
}

.decision-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.comparison-block {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.comparison-block span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.comparison-block strong {
  font-size: 0.86rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.suggested-block {
  border-color: #b8cbe0;
  background: #f6faff;
}

.result-block {
  border-color: #b8d8bf;
  background: #f4fbf5;
}

.comparison-arrow {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 900;
}

.comparison-reason {
  padding-left: 10px;
  border-left: 3px solid var(--amber);
}

.impact-chip {
  border: 1px solid #b8cbe0;
  color: #285f8f;
  background: #edf5fc;
}

.decision-evidence-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.constraint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.constraint-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.constraint-marker {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 900;
}

.constraint-item strong {
  display: block;
  font-size: 0.8rem;
}

.constraint-item p {
  margin-top: 3px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.constraint-respected {
  border-color: #b8d8bf;
}

.constraint-respected .constraint-marker {
  color: #ffffff;
  background: var(--green);
}

.constraint-conflict {
  border-color: #efbeb8;
  background: #fff8f7;
}

.constraint-conflict .constraint-marker {
  color: #ffffff;
  background: var(--red);
}

.constraint-not_specified .constraint-marker {
  color: #5f615b;
  background: #e8e8e4;
}

.json-block {
  margin-top: 16px;
}

pre {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  padding: 14px;
  background: #1f2320;
  color: #f4f1e9;
  font-size: 0.82rem;
  line-height: 1.5;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .setup-form .field:first-child,
  .criteria-fieldset,
  .button-row {
    grid-column: 1 / -1;
  }

  .upload-band,
  .score-layout,
  .split-layout,
  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

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

  .decision-section:nth-child(4),
  .decision-section:nth-child(6),
  .decision-section:nth-child(7) {
    grid-column: auto;
  }

  .check-grid,
  .asset-metadata-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .main-panel,
  .sidebar {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .brand-block,
  .setup-form,
  .upload-band,
  .asset-section,
  .status-panel,
  .error-panel,
  .results-panel,
  .dashboard-panel {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .setup-form,
  .pillar-toggle-grid,
  .constraint-toggle-grid,
  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .check-grid,
  .asset-metadata-list {
    grid-template-columns: 1fr;
  }

  .asset-decision-summary {
    grid-template-columns: 66px minmax(0, 1fr) 14px;
    gap: 10px;
    min-height: 88px;
    padding: 10px;
  }

  .decision-thumbnail {
    width: 66px;
    height: 62px;
  }

  .decision-summary-status {
    grid-column: 2 / 3;
    justify-content: flex-start;
  }

  .decision-expand {
    grid-column: 3;
    grid-row: 1;
  }

  .asset-decision-detail {
    padding: 12px;
  }

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

  .comparison-arrow {
    min-height: 16px;
  }

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

  .upload-band {
    padding: 16px;
  }

  .section-header,
  .results-header,
  .workspace-header,
  .history-card-heading,
  .history-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    padding: 0 10px;
    white-space: nowrap;
  }

  .final-score {
    font-size: 3.2rem;
  }

  .status-panel {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
  }

  .elapsed-timer {
    grid-column: 2 / 3;
    justify-self: start;
  }

  .evaluation-path {
    grid-column: 1 / -1;
  }

  #modelStatus {
    width: calc(100vw - 106px);
    max-width: calc(100vw - 106px);
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .brand-block > div {
    flex: 0 1 calc(100vw - 106px);
    width: calc(100vw - 106px);
  }
}
