/* ==========================================================================
   evaluator-room.css — the Evaluator room. A guided console for an outside
   evaluator (procurement officer, auditor, government reviewer) to try the
   product, verify its evidence, and take it away.

   Uses only the app's own tokens (css/app.css): --accent, --accent-2,
   --kit-accent-grad, --glow-rgb, --panel, --border, --text, --text-muted,
   --radius-md/lg/pill, --bg-sunken, --bg-elevated, --danger, --danger-soft,
   --amber, --amber-soft. No hard-coded national colour. Phone-first,
   verified at 375 / 768 / 1280.
   ========================================================================== */

.evaluator-wrap { padding: 0 14px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 980px; margin: 0 auto; }

.ev-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(10px) saturate(1.1);
  padding: 18px 18px 20px;
}
.ev-card::after {
  content: "";
  position: absolute; left: 20px; right: 20px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--glow-rgb), .6), transparent);
}
.ev-card h2 { font-size: 22px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.01em; }
.ev-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.ev-card p { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); margin: 0 0 10px; }
.ev-card p:last-child { margin-bottom: 0; }

.ev-step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; margin-right: 8px;
  border-radius: var(--radius-pill);
  background: var(--kit-accent-grad, linear-gradient(135deg, var(--accent), var(--accent-2)));
  color: var(--accent-contrast, #fff);
  font: 800 11px/1 var(--font-mono, monospace);
  vertical-align: middle;
}

/* -------- Section 1: What this is -------- */
.ev-facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.ev-fact { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-sunken); }
.ev-fact-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-family: var(--font-mono, monospace); }
.ev-fact-value { font-size: 15px; font-weight: 700; margin-top: 3px; word-break: break-word; }
.ev-fact-value.is-mono { font-family: var(--font-mono, monospace); font-size: 13px; }

/* -------- Section 2: Drive it yourself -------- */
.ev-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.ev-example-chip {
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--bg-sunken);
  color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.ev-example-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.ev-example-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ev-prompt-box { position: relative; margin-bottom: 12px; }
.ev-prompt-input {
  width: 100%; min-height: 88px; max-height: 220px; resize: vertical;
  padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text); font: inherit; font-size: 14px; line-height: 1.5;
}
.ev-prompt-input:focus { border-color: var(--accent); outline: none; }

.ev-controls-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 14px; }
.ev-toggle-field { display: flex; align-items: center; gap: 8px; }
.ev-toggle-field span { font-size: 13px; font-weight: 600; color: var(--text); }
.ev-run-btn { margin-left: auto; }

.ev-stage-timeline { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; }
.ev-stage-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-md); background: var(--bg-sunken); border: 1px solid var(--border);
  font-size: 12.5px; animation: ev-stage-in .2s ease both;
}
@keyframes ev-stage-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.ev-stage-layer { font-weight: 700; min-width: 118px; font-family: var(--font-mono, monospace); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.ev-stage-cat { flex: 1; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-stage-ms { font-family: var(--font-mono, monospace); color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }

.ev-answer-box { padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-sunken); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; min-height: 44px; }
.ev-answer-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 12px; color: var(--text-muted); }
.ev-answer-meta span { font-family: var(--font-mono, monospace); }

/* -------- Section 3: Verify the receipt -------- */
.ev-ledger-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ev-verify-field { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ev-verify-field input[type="text"] { flex: 1; min-width: 180px; }
.ev-verify-result { margin-top: 8px; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; }
.ev-verify-result.is-match { background: var(--accent-soft); color: var(--accent-strong); }
.ev-verify-result.is-nomatch { background: var(--danger-soft); color: var(--danger); }
.ev-verify-result.is-neutral { background: var(--bg-sunken); color: var(--text-muted); font-weight: 500; }

.ev-filepicker-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.ev-file-label { font-size: 12.5px; color: var(--text-muted); }

/* -------- Section 4: Scoreboard -------- */
.ev-scoreboard-headline { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 16px; }
.ev-scoreboard-metric { display: flex; flex-direction: column; gap: 2px; }
.ev-scoreboard-metric .ev-fact-label { font-size: 10px; }
.ev-scoreboard-metric .ev-fact-value { font-size: 24px; }
.ev-cat-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.ev-cat-table th { text-align: left; padding: 6px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); border-bottom: 1px solid var(--border); }
.ev-cat-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.ev-cat-bar-track { width: 100%; min-width: 60px; height: 8px; border-radius: var(--radius-pill); background: var(--bg-sunken); overflow: hidden; }
.ev-cat-bar-fill { height: 100%; border-radius: var(--radius-pill); background: var(--kit-accent-grad, linear-gradient(90deg, var(--accent), var(--accent-2))); }
.ev-not-run { padding: 14px; border-radius: var(--radius-md); background: var(--bg-sunken); border: 1px dashed var(--border-strong); font-size: 13px; color: var(--text-muted); }
.ev-metric-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* -------- Section 5: Known limitations -------- */
.ev-limits-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ev-limits-list li { position: relative; padding-left: 20px; font-size: 13.5px; line-height: 1.55; color: var(--text-muted); }
.ev-limits-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }

/* -------- Section 6: Take it with you -------- */
.ev-download-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.ev-download-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 52px; padding: 0 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--bg-elevated);
  color: var(--text); font-size: 13.5px; font-weight: 700; text-decoration: none;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.ev-download-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.ev-download-btn .ev-download-icon { flex-shrink: 0; color: var(--accent-2); }
.ev-download-btn .ev-download-sub { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--text-faint); font-family: var(--font-mono, monospace); }
.ev-checksums-note { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

/* -------- shared bits -------- */
.ev-inline-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; min-height: 1em; }
.ev-loading-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.ev-loading-dots span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .35; animation: ev-blink 1s infinite; }
.ev-loading-dots span:nth-child(2) { animation-delay: .18s; }
.ev-loading-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes ev-blink { 0%, 100% { opacity: .25; } 40% { opacity: .9; } }

/* -------- Tablet (768px) -------- */
@media (min-width: 768px) {
  .evaluator-wrap { padding: 0 20px 48px; gap: 20px; }
  .ev-card { padding: 22px 24px 26px; }
  .ev-facts-grid { grid-template-columns: repeat(4, 1fr); }
  .ev-metric-sub-grid { grid-template-columns: repeat(3, 1fr); }
  .ev-download-grid { grid-template-columns: 1fr 1fr; }
}

/* -------- Desktop (1280px) -------- */
@media (min-width: 1280px) {
  .evaluator-wrap { max-width: 1080px; }
  .ev-download-grid { grid-template-columns: repeat(2, 1fr); }
}

/* -------- Phone hard overrides (375px), always last, !important where a
   desktop/tile rule would otherwise win -------- */
@media (max-width: 480px) {
  .evaluator-wrap { padding: 0 12px 32px !important; }
  .ev-card { padding: 16px 14px 18px !important; }
  .ev-card h2 { font-size: 20px !important; }
  .ev-facts-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .ev-controls-row { gap: 12px !important; }
  .ev-run-btn { margin-left: 0 !important; width: 100% !important; }
  .ev-stage-row { flex-wrap: wrap !important; }
  .ev-stage-layer { min-width: 0 !important; }
  .ev-scoreboard-headline { gap: 14px !important; }
  .ev-scoreboard-metric .ev-fact-value { font-size: 20px !important; }
  .ev-download-btn { min-height: 48px !important; }
  .ev-verify-field { flex-direction: column !important; }
  .ev-verify-field input[type="text"] { width: 100% !important; }
}
