/* Fit Checker v2 — Figma-approved visual system */

:root {
  --fc-ink: #1b211e;
  --fc-paper: #f4f3ef;
  --fc-card: #ffffff;
  --fc-border: #d8d4cb;
  --fc-muted: #6b726b;
  --fc-label: #8a9089;
  --fc-action: #3b82f6;
  --fc-action-hover: #2563eb;
  --fc-action-light: #eff6ff;
  --fc-verdict-accent: #c47a12;
  --fc-strong: #2f7d5c;
  --fc-strong-bg: #e6f0eb;
  --fc-match: #1d5fa6;
  --fc-match-bg: #e4eef9;
  --fc-partial: #c47a12;
  --fc-partial-bg: #fff8e8;
  --fc-partial-border: #e8c878;
  --fc-weak: #1b211e;
  --fc-weak-bg: #f1f3ef;
  --fc-radius: 12px;
  --fc-max: 700px;
  --fc-mono: "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace;
  --fc-sans: "Inter", system-ui, -apple-system, sans-serif;
}

.fc-root {
  max-width: var(--fc-max);
  margin: 0 auto;
  color: var(--fc-ink);
  font-family: var(--fc-sans);
  line-height: 1.55;
}

.fc-slip {
  background: var(--fc-card);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius);
  padding: 1.5rem 1.5rem 1.75rem;
}

.fc-state-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--fc-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fc-label);
  margin: 0 0 1.25rem;
}

.fc-state-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fc-action);
  flex-shrink: 0;
}

.fc-perforation {
  border: none;
  border-top: 1px dashed #cfcac0;
  margin: 1.5rem 0;
}

/* ── Loading ─────────────────────────────────────── */

.fc-loading {
  text-align: left;
}

.fc-loading-steps {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.fc-loading-step {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.65rem;
  align-items: start;
}

.fc-loading-step-icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  border: 1.5px solid #d0ccc4;
  background: transparent;
  flex-shrink: 0;
}

.fc-loading-step.is-active .fc-loading-step-icon {
  border-color: var(--fc-action);
  background: var(--fc-action);
}

.fc-loading-step.is-done .fc-loading-step-icon {
  border-color: var(--fc-strong);
  background: var(--fc-strong);
  position: relative;
}

.fc-loading-step.is-done .fc-loading-step-icon::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.fc-loading-step-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fc-ink);
}

.fc-loading-step.is-pending .fc-loading-step-title,
.fc-loading-step.is-pending .fc-loading-step-sub {
  color: #a8aea7;
}

.fc-loading-step-sub {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--fc-muted);
}

.fc-loading-progress {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--fc-mono);
  font-size: 0.72rem;
  color: var(--fc-label);
  margin-bottom: 0;
}

.fc-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d8d4cb;
}

.fc-loading-dot.is-active,
.fc-loading-dot.is-done {
  background: var(--fc-action);
}

.fc-loading-bar {
  width: 1.5rem;
  height: 4px;
  border-radius: 2px;
  background: #d8d4cb;
}

.fc-loading-bar.is-active,
.fc-loading-bar.is-done {
  background: var(--fc-action);
}

.fc-loading-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  font-family: var(--fc-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--fc-action);
  background: var(--fc-action-light);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.fc-loading-note[hidden] {
  display: none;
}

/* ── Verdict block ───────────────────────────────── */

.fc-verdict-block {
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid var(--fc-border);
}

.fc-verdict-block.is-strong {
  background: var(--fc-strong-bg);
  border-color: #c5dbd0;
}

.fc-verdict-block.is-match {
  background: var(--fc-match-bg);
  border-color: #b8cfe8;
}

.fc-verdict-block.is-partial {
  background: var(--fc-partial-bg);
  border-color: var(--fc-partial-border);
}

.fc-verdict-block.is-weak {
  background: var(--fc-weak-bg);
  border-color: var(--fc-ink);
}

.fc-verdict-stamp {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  line-height: 1;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1.5px dashed currentColor;
}

.fc-verdict-block.is-strong .fc-verdict-stamp {
  color: var(--fc-strong);
}

.fc-verdict-block.is-match .fc-verdict-stamp {
  color: var(--fc-match);
}

.fc-verdict-block.is-partial .fc-verdict-stamp {
  color: var(--fc-partial);
}

.fc-verdict-block.is-weak .fc-verdict-stamp {
  color: var(--fc-weak);
  border-style: solid;
  background: var(--fc-weak-bg);
}

.fc-headline {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.fc-proof-label {
  font-family: var(--fc-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fc-verdict-accent);
  margin: 0 0 0.4rem;
}

.fc-proof-text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.fc-proof-lead {
  font-weight: 700;
}

.fc-top-caveat {
  position: relative;
  padding: 0.85rem 1rem 0.85rem;
  border-radius: 8px;
  background: var(--fc-card);
  border: 1px solid #e8c878;
  font-size: 0.9rem;
  line-height: 1.5;
}

.fc-top-caveat-label {
  font-family: var(--fc-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fc-verdict-accent);
  margin-bottom: 0.35rem;
}

.fc-top-caveat-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
}

.fc-top-caveat .fc-severity-high {
  background: var(--fc-verdict-accent);
  color: #fff;
}

/* ── Role lens ───────────────────────────────────── */

.fc-section-title {
  font-family: var(--fc-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fc-label);
  margin: 0 0 0.75rem;
}

.fc-role-type {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
}

.fc-role-meta {
  font-size: 0.85rem;
  color: var(--fc-muted);
  margin: 0 0 0.75rem;
}

.fc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.fc-chip {
  font-family: var(--fc-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
  background: transparent;
  color: var(--fc-ink);
  border: 1px solid #cfcac0;
}

.fc-hidden-need {
  font-size: 0.9rem;
  color: var(--fc-ink);
  margin: 0;
  line-height: 1.5;
}

.fc-hidden-need-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* ── Evidence map ────────────────────────────────── */

.fc-evidence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.fc-toggle-btn {
  background: none;
  border: none;
  color: var(--fc-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.fc-toggle-btn:hover {
  color: var(--fc-action);
}

.fc-evidence-list {
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  overflow: hidden;
}

.fc-evidence-row {
  border-bottom: 1px solid var(--fc-border);
}

.fc-evidence-row:last-child {
  border-bottom: none;
}

.fc-evidence-summary {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: var(--fc-card);
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.fc-evidence-summary:hover {
  background: #faf9f6;
}

.fc-evidence-req {
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}

.fc-evidence-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.fc-match-glyph {
  font-size: 0.95rem;
  line-height: 1;
  color: var(--fc-ink);
  text-align: center;
}

.fc-evidence-row .fc-match-glyph {
  font-weight: 600;
}

.fc-chevron {
  display: none;
}

.fc-evidence-detail {
  display: none;
  padding: 0 0.85rem 0.85rem 2.35rem;
  font-size: 0.88rem;
  color: var(--fc-ink);
  border-top: 1px solid #eceae4;
  margin: 0 0.85rem;
  padding-top: 0.75rem;
}

.fc-evidence-row.is-open .fc-evidence-detail {
  display: block;
}

.fc-evidence-detail p {
  margin: 0 0 0.55rem;
}

.fc-case-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.fc-case-key {
  font-size: 0.75rem;
  color: var(--fc-match);
  text-decoration: none;
  font-weight: 600;
}

.fc-case-key:hover {
  color: var(--fc-action);
}

.fc-distance-note {
  font-size: 0.84rem;
  color: var(--fc-muted);
  font-style: italic;
  margin-top: 0.35rem;
}

.fc-evidence-legend {
  margin-top: 0.65rem;
  font-family: var(--fc-mono);
  font-size: 0.68rem;
  color: var(--fc-label);
  letter-spacing: 0.02em;
}

.fc-fallback {
  font-size: 0.9rem;
  color: var(--fc-muted);
  font-style: italic;
}

/* ── Badges ──────────────────────────────────────── */

.fc-badge {
  display: inline-block;
  font-family: var(--fc-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.42rem;
  border-radius: 3px;
  white-space: nowrap;
}

.fc-badge-critical {
  background: var(--fc-ink);
  color: #fff;
}

.fc-badge-important {
  background: #4a524c;
  color: #fff;
}

.fc-badge-supporting {
  background: #eceae4;
  color: var(--fc-ink);
  border: 1px solid var(--fc-border);
}

.fc-badge-minor {
  background: #f0eeea;
  color: var(--fc-muted);
  border: 1px solid var(--fc-border);
}

.fc-badge-match-direct {
  background: var(--fc-strong-bg);
  color: var(--fc-strong);
  border: 1px solid #c5dbd0;
  text-transform: lowercase;
  font-weight: 500;
}

.fc-badge-match-adjacent {
  background: var(--fc-match-bg);
  color: var(--fc-match);
  border: 1px solid #b8cfe8;
  text-transform: lowercase;
  font-weight: 500;
}

.fc-badge-match-gap {
  background: #f5f3ef;
  color: var(--fc-muted);
  border: 1px solid var(--fc-border);
  text-transform: lowercase;
  font-weight: 500;
}

.fc-badge-match-negative {
  background: #eceae4;
  color: var(--fc-ink);
  border: 1px solid var(--fc-border);
  text-transform: lowercase;
}

.fc-severity-high {
  background: var(--fc-verdict-accent);
  color: #fff;
  text-transform: lowercase;
  font-weight: 600;
}

.fc-severity-medium {
  background: var(--fc-match-bg);
  color: var(--fc-match);
  border: 1px solid #b8cfe8;
  text-transform: lowercase;
  font-weight: 600;
}

.fc-severity-low {
  background: #f0eeea;
  color: var(--fc-muted);
  border: 1px solid var(--fc-border);
  text-transform: lowercase;
  font-weight: 600;
}

/* ── Story card ──────────────────────────────────── */

.fc-story-card {
  background: var(--fc-card);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius);
  padding: 1.15rem 1.25rem 1.25rem;
}

.fc-story-lead {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
}

.fc-story-why {
  font-size: 0.92rem;
  margin: 0 0 0.85rem;
  line-height: 1.55;
  color: var(--fc-muted);
}

.fc-story-expand {
  background: none;
  border: none;
  color: var(--fc-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.fc-story-expand:hover {
  color: var(--fc-action);
}

.fc-story-talk {
  display: none;
  margin-top: 0.65rem;
  padding: 0.75rem 1rem;
  background: #faf9f6;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.fc-story-talk.is-open {
  display: block;
}

.fc-story-cta {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.1rem;
  background: var(--fc-action);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
  text-decoration: none;
}

.fc-story-cta:hover {
  background: var(--fc-action-hover);
}

/* ── Caveats ─────────────────────────────────────── */

.fc-caveat-item {
  position: relative;
  padding: 0.85rem 1rem;
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  background: var(--fc-card);
  margin-bottom: 0.65rem;
}

.fc-caveat-item:last-child {
  margin-bottom: 0;
}

.fc-caveat-text {
  margin: 0;
  padding-right: 4rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.fc-caveat-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

/* ── Bottom CTA ──────────────────────────────────── */

.fc-bottom-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 0.25rem;
}

.fc-cta-primary {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  background: var(--fc-action);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--fc-action);
}

.fc-cta-primary:hover {
  background: var(--fc-action-hover);
  border-color: var(--fc-action-hover);
}

.fc-cta-secondary {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fc-action);
  background: transparent;
  border: 1px solid var(--fc-action);
  border-radius: 8px;
  text-decoration: none;
}

.fc-cta-secondary:hover {
  background: var(--fc-action-light);
}

.fc-footer-note {
  margin-top: 1.25rem;
  text-align: center;
  font-family: var(--fc-mono);
  font-size: 0.62rem;
  color: var(--fc-label);
  letter-spacing: 0.02em;
}

.fc-check-another-wrap {
  margin-top: 1.25rem;
  text-align: center;
}

button.fc-cta-secondary {
  cursor: pointer;
  font-family: inherit;
}

/* ── Error states ────────────────────────────────── */

.fc-error {
  text-align: left;
  padding: 0;
}

.fc-error-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
}

.fc-error-msg {
  font-size: 0.92rem;
  color: var(--fc-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
  max-width: 32rem;
}

.fc-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-start;
}

.fc-retry-btn {
  padding: 0.6rem 1.1rem;
  background: var(--fc-card);
  color: var(--fc-action);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid var(--fc-action);
  border-radius: 8px;
  cursor: pointer;
}

.fc-retry-btn:hover {
  background: var(--fc-action-light);
}
