/**
 * FDE Drill Result - styles for the #drill-result artifact rendered by
 * drill-result.js. Uses only the FDE tokens defined on the landing page
 * (--ink, --ink-2, --muted, --brand, --brand-soft, --bg, --surface, --hairline,
 * --hairline-strong, --green(-soft), --amber(-soft), --font-mono) plus the
 * shared .hg / .mono / .btn-brand classes.
 * No unrelated styling, no third-party CSS.
 */

.fde-dr-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 22px 44px -36px rgba(19,27,46,.38);
  animation: fde-review-in .22s ease-out both;
}
@keyframes fde-review-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fde-dr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fde-dr-h2 {
  font-family: 'Hanken Grotesk', 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink);
  margin: 0;
}

.fde-dr-stage {
  margin: -0.75rem 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Header: score gauge + badge + feedback ─────────────────────────────── */

.fde-dr-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.fde-dr-gauge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 999px;
}

.fde-dr-gauge-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: var(--surface);
}

.fde-dr-gauge-score {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}

.fde-dr-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 220px;
}

.fde-dr-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fde-dr-badge {
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.fde-dr-badge.is-pass {
  color: var(--green);
  background: var(--green-soft, #e3f4ea);
}

.fde-dr-badge.is-revise,
.fde-dr-badge.is-fail {
  color: var(--amber);
  background: var(--amber-soft, #fbefd6);
}

.fde-dr-bandline {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.fde-dr-threshold {
  font-size: 12px;
  color: var(--muted);
}

.fde-dr-feedback {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ── Short loop: one strength, one next step ───────────────────────────── */

.fde-dr-focus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fde-dr-focus .fde-dr-note { grid-column: 1 / -1; }

.fde-dr-focus-card {
  padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 2px solid var(--hairline-strong);
}

.fde-dr-focus-card.is-good { border-left-color: var(--green); }
.fde-dr-focus-card.is-warn { border-left-color: var(--amber); }
.fde-dr-focus-card.is-next { border-left-color: var(--brand); }

.fde-dr-focus-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.fde-dr-focus-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.fde-dr-caveat {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
}

/* ── Shared section shell ────────────────────────────────────────────────── */

.fde-dr-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hairline);
}

.fde-dr-section h3 {
  margin: 0;
  font-family: 'Hanken Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}

.fde-dr-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── Evidence: what the code measured ─────────────────────────────────────── */

.fde-dr-evidence {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem 1.5rem;
}

@media (min-width: 720px) {
  .fde-dr-evidence { grid-template-columns: 1fr 1fr; }
}

.fde-dr-ev {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  column-gap: 0.4rem;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}

.fde-dr-ev-mark {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.fde-dr-ev.is-pass .fde-dr-ev-mark { color: var(--green); }
.fde-dr-ev.is-fail .fde-dr-ev-mark { color: #a63d27; }
.fde-dr-ev.is-flag .fde-dr-ev-mark { color: var(--amber); }

.fde-dr-ev-detail {
  grid-column: 2;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ── Rubric rows ──────────────────────────────────────────────────────────── */

.fde-dr-rubric-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fde-dr-rubric-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fde-dr-rubric-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.fde-dr-track {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--hairline);
}

.fde-dr-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
}

.fde-dr-fill.is-good { background: var(--green); }
.fde-dr-fill.is-warn { background: var(--amber); }

.fde-dr-rubric-comment {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* ── Full scoring: remaining strengths / fixes ──────────────────────────── */

.fde-dr-si-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.fde-dr-si-col h4 {
  margin: 0 0 0.4rem;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fde-dr-taglist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fde-dr-taglist li {
  position: relative;
  padding-left: 1rem;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.fde-dr-taglist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.fde-dr-taglist.is-good li::before { background: var(--green); }
.fde-dr-taglist.is-warn li::before { background: var(--amber); }

/* ── Collapsed extras: comparison and full scoring ─────────────────────── */

.fde-dr-more {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fde-dr-full[open] > * + * { margin-top: 0.85rem; }

.fde-dr-sub-h {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fde-dr-compare {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: var(--bg);
}

.fde-dr-compare summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  list-style: none;
}

.fde-dr-compare summary::-webkit-details-marker { display: none; }

.fde-dr-compare summary::before {
  content: '+';
  display: inline-block;
  margin-right: 0.45rem;
}

.fde-dr-compare[open] summary::before {
  content: '\2212';
}

.fde-dr-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.85rem;
}

.fde-dr-answer-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.fde-dr-answer-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.fde-dr-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--amber);
  background: color-mix(in srgb, var(--amber) 14%, var(--surface));
}

.fde-dr-answer-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fde-dr-why {
  margin: 0.85rem 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ── FDE Skill Graph ──────────────────────────────────────────────────────── */

.fde-dr-skillgraph {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fde-dr-sg-row {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) 1fr auto;
  align-items: center;
  gap: 0.6rem;
}

.fde-dr-sg-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  overflow-wrap: break-word;
}

.fde-dr-sg-track {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--hairline);
  overflow: hidden;
}

.fde-dr-sg-row.is-unmeasured .fde-dr-sg-track {
  background: repeating-linear-gradient(
    90deg,
    var(--hairline),
    var(--hairline) 4px,
    var(--surface) 4px,
    var(--surface) 8px
  );
}

.fde-dr-sg-row.is-measured .fde-dr-sg-track {
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
}

.fde-dr-sg-value {
  font-size: 12px;
  white-space: nowrap;
  color: var(--muted);
}

.fde-dr-sg-row.is-measured .fde-dr-sg-value {
  color: var(--brand);
  font-weight: 700;
}

/* ── Revise coach: since your last answer (FRD-44 FR-44.33) ────────────── */

.fde-dr-since {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--hairline));
  background: var(--brand-soft);
}

.fde-dr-since h3 {
  margin: 0 0 0.3rem;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand);
}

.fde-dr-since p {
  margin: 0.15rem 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
}

.fde-dr-since .fde-dr-since-score { font-weight: 700; }

/* ── Next step + CTAs ─────────────────────────────────────────────────────── */

.fde-dr-next {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--bg);
}

.fde-dr-next-msg {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.fde-dr-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.fde-dr-cta {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 1rem;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.fde-dr-cta-secondary {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 1rem;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand);
  border: 1px solid var(--hairline);
}

.fde-dr-cta-secondary:hover { text-decoration: underline; }

.fde-dr-cta-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-underline-offset: 4px;
}

.fde-dr-attempts {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ── Responsive: 320px and up ─────────────────────────────────────────────── */

@media (max-width: 520px) {
  .fde-dr-card { padding: 1.25rem; gap: 1.25rem; }
  .fde-dr-si-cols,
  .fde-dr-focus,
  .fde-dr-compare-grid { grid-template-columns: 1fr; }
  .fde-dr-ctas { flex-direction: column; align-items: stretch; }
  .fde-dr-cta-link { text-align: center; padding: 0.35rem 0; }
  .fde-dr-sg-row {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
  }
  .fde-dr-sg-value { text-align: left; }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .fde-dr-card,
  .fde-dr-card * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* 1 Oct: the review panel sits apart from the CEO conversation. */
.fde-dr-intro { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2, #44454f); }
.fde-dr-example { margin: 0; align-self: flex-start; font-size: 13px; font-weight: 700; color: #7a4a00; background: #fbefd6; border: 1px solid #efd9a8; border-radius: 6px; padding: 4px 10px; }
