/* ===============================
   Evaluation modal (two-axis)
================================= */

/* Hero: two co-equal readings side by side */
.eval-hero {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 0.5rem;
}

.eval-hero-col {
  flex: 1 1 0;
  text-align: center;
  padding: 0.5rem 0.75rem 0.75rem;
}

.eval-hero-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.eval-hero-sublabel {
  font-size: 0.8rem;
  color: #868e96;
  margin-bottom: 0.6rem;
  line-height: 1.3;
  min-height: 2.1em;
}

.eval-hero-note {
  text-align: center;
  font-size: 0.82rem;
  color: #868e96;
  font-style: italic;
  margin: 0 auto 1rem;
  max-width: 40rem;
}

.eval-section-sub {
  font-size: 0.83rem;
  color: #868e96;
  margin: -0.35rem 0 0.7rem;
  line-height: 1.4;
}

.eval-hero-sep {
  flex: 0 0 1px;
  background: #e9ecef;
  position: relative;
  margin: 0.25rem 0;
}

/* Grade chip (Axis A headline) */
.eval-grade-chip {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 600;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  color: #fff;
}
.grade-strong {
  background: #198754;
}
.grade-adequate {
  background: #6c8a3c;
}
.grade-weak {
  background: #b8860b;
}
.grade-poor {
  background: #b02a37;
}
.grade-unknown {
  background: #6c757d;
}

/* Position chip (Axis B headline) */
.eval-pos-chip {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: 2px solid transparent;
}
.pos-inmotion {
  background: #e7f1ff;
  color: #0a58ca;
  border-color: #9ec5fe;
}
.pos-awaiting {
  background: #fff3cd;
  color: #997404;
  border-color: #ffe69c;
}
.pos-negative {
  background: #f8d7da;
  color: #b02a37;
  border-color: #f1aeb5;
}

.eval-pos-chip-sm {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: #eef0f2;
  color: #495057;
}
.eval-pos-chip-sm.pos-awaiting {
  background: #fff3cd;
  color: #997404;
}
.eval-pos-chip-sm.pos-inmotion {
  background: #e7f1ff;
  color: #0a58ca;
}
.eval-pos-chip-sm.pos-negative {
  background: #f8d7da;
  color: #b02a37;
}

.eval-pos-gloss {
  text-align: center;
  font-size: 0.92rem;
  color: #495057;
  margin: 0.25rem auto 1rem;
  max-width: 42rem;
}

/* Sections */
.eval-section {
  border-top: 1px solid #eef0f2;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}
.eval-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin-bottom: 0.6rem;
}

/* Component rows */
.eval-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  gap: 0.75rem;
}
.eval-comp-name {
  font-size: 0.95rem;
  color: #212529;
}
.eval-comp-levels {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.eval-level-chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
}
.level-present {
  background: #d1e7dd;
  color: #0f5132;
}
.level-partial {
  background: #fff3cd;
  color: #664d03;
}
.level-absent {
  background: #f8d7da;
  color: #842029;
}
.level-unknown {
  background: #e9ecef;
  color: #495057;
}

/* LLM concur (quiet) vs disagree (loud) */
.eval-llm-concur {
  font-size: 0.78rem;
  color: #6c757d;
  font-style: italic;
  cursor: help;
}
.eval-llm-disagree .eval-level-chip {
  outline: 2px solid #b02a37;
  outline-offset: 1px;
}

.eval-comp-rationale {
  font-size: 0.86rem;
  color: #495057;
  background: #f8f9fa;
  border-left: 3px solid #b8860b;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  margin: 0.15rem 0 0.5rem;
}

/* --- structured clinical DETAILS block (deterministic sub-component breakdown) --- */
.eval-details-block {
  background: #f8f9fa;
  border-left: 3px solid #b8860b;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  margin: 0.15rem 0 0.5rem;
}
.eval-detail-item {
  padding: 0.3rem 0;
  border-bottom: 1px solid #ececec;
}
.eval-detail-item:last-child {
  border-bottom: none;
}
.eval-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.eval-detail-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #343a40;
}
.eval-detail-count {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: #495057;
  white-space: nowrap;
}
.eval-detail-needs {
  color: #868e96;
  font-weight: 400;
}
.eval-detail-flag {
  font-size: 0.82rem;
  color: #495057;
  text-align: right;
}
.eval-detail-present {
  font-size: 0.8rem;
  color: #2b7a3d;
  margin-top: 0.15rem;
  line-height: 1.35;
}
.eval-detail-missing {
  font-size: 0.8rem;
  color: #b23b3b;
  margin-top: 0.1rem;
  line-height: 1.35;
}
/* the label's ✓/✗ marker in flag rows inherits the row's ok/gap colour */
.eval-detail-ok .eval-detail-flag {
  color: #2b7a3d;
}
.eval-detail-gap .eval-detail-flag {
  color: #b23b3b;
}
.eval-disagree-note {
  border-left-color: #0d6efd;
}

.eval-judge-note {
  font-size: 0.86rem;
  color: #495057;
  margin: 0.6rem 0 0;
}
.eval-judge-note.muted {
  color: #adb5bd;
  font-style: italic;
}

.eval-warnings {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: #664d03;
}

.eval-raw {
  margin-top: 1rem;
}
.eval-raw summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: #6c757d;
}
.eval-raw pre {
  font-size: 0.74rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 0.6rem;
  margin-top: 0.4rem;
  max-height: 22rem;
  overflow: auto;
}

/* Fatigue band hint next to the interactional fatigue component. */
.eval-fatigue-band {
  font-size: 0.8rem;
  color: #868e96;
  font-weight: 400;
}

/* Position headline chip inside the (demoted) position section. */
.eval-position-headline {
  text-align: center;
  margin: 0.25rem 0 0.5rem;
}

/* v3 spec-driven modal: real-world context divider + collapsible rationale */
.eval-context-divider {
  display: flex;
  align-items: center;
  margin: 0.85rem 0 0.55rem;
  color: #868e96;
  font-size: 0.78rem;
  font-style: italic;
}
.eval-context-divider::before,
.eval-context-divider::after {
  content: "";
  flex: 1;
  border-top: 1px dashed #d0d4d9;
}
.eval-context-divider span {
  padding: 0 0.6rem;
  white-space: nowrap;
}
.eval-rationale-collapse {
  margin: 0.1rem 0 0.5rem;
}
.eval-rationale-collapse > summary {
  font-size: 0.78rem;
  color: #868e96;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-block;
  padding: 0.05rem 0;
}
.eval-rationale-collapse > summary::-webkit-details-marker {
  display: none;
}
.eval-rationale-collapse > summary::before {
  content: "\25b8  ";
  color: #b8860b;
}
.eval-rationale-collapse[open] > summary::before {
  content: "\25be  ";
}
.eval-rationale-collapse > summary:hover {
  color: #495057;
}
.eval-rationale-collapse .eval-comp-rationale {
  margin-top: 0.25rem;
}

/* =====================================================================
   Spacing normalization (v4). One consistent vertical rhythm on a 4px
   scale (0.25 / 0.5 / 0.75 / 1 / 1.5rem). These override the ad-hoc
   values above. Each COMPONENT is a self-contained block:
       [ name .............................. LEVEL ]
       description (muted, always shown)
       > Why  (collapsible rationale)
   ===================================================================== */

/* --- top-level sections: one clear divide, even rhythm --- */
.eval-section {
  border-top: 1px solid #dee2e6;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}
.eval-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
  margin: 0 0 0.25rem;
}
.eval-section-sub {
  font-size: 0.85rem;
  color: #868e96;
  line-height: 1.4;
  margin: 0 0 1rem;
}
/* first section after the hero: no heavy top rule/gap */
.eval-hero-note + .eval-section,
.eval-hero + .eval-section {
  border-top: none;
  margin-top: 0.5rem;
  padding-top: 0;
}

/* --- a component block: the unit of vertical rhythm --- */
.eval-comp-block {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f3f5;
}
.eval-comp-block:last-child {
  border-bottom: none;
}

.eval-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
}
.eval-comp-name {
  font-size: 0.95rem;
  color: #212529;
  line-height: 1.3;
}
.eval-comp-hint {
  color: #868e96;
  font-weight: 400;
  font-size: 0.85rem;
}
.eval-comp-levels {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* the permanent description line under the name (replaces the (?) toggle) */
.eval-comp-desc {
  font-size: 0.83rem;
  color: #868e96;
  line-height: 1.4;
  margin-top: 0.25rem;
  max-width: 44rem;
}

/* collapsible "Why" rationale: tight to the block, consistent indent */
.eval-rationale-collapse {
  margin-top: 0.5rem;
}
.eval-rationale-collapse > summary {
  font-size: 0.8rem;
  color: #868e96;
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-block;
}
.eval-rationale-collapse > summary::-webkit-details-marker {
  display: none;
}
.eval-rationale-collapse > summary::before {
  content: "\25b8  ";
  color: #b8860b;
}
.eval-rationale-collapse[open] > summary::before {
  content: "\25be  ";
}
.eval-rationale-collapse > summary:hover {
  color: #495057;
}
.eval-comp-rationale {
  font-size: 0.86rem;
  color: #495057;
  line-height: 1.5;
  background: #f8f9fa;
  border-left: 3px solid #b8860b;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  max-width: 44rem;
}

/* --- real-world context divider: consistent spacing --- */
.eval-context-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  color: #adb5bd;
  font-size: 0.78rem;
  font-style: italic;
}
.eval-context-divider::before,
.eval-context-divider::after {
  content: "";
  flex: 1;
  border-top: 1px dashed #dee2e6;
}
.eval-context-divider span {
  white-space: nowrap;
}
