/* FundedTruth Consistency Checker — front-end styles. Everything scoped under .fcc */

.fcc {
  --fcc-bg: #ffffff;
  --fcc-surface: #f6f8f8;
  --fcc-ink: #14201f;
  --fcc-muted: #5b6b69;
  --fcc-line: #dfe6e5;
  --fcc-free: #15803d;
  --fcc-accent-soft: color-mix(in srgb, var(--fcc-accent) 9%, transparent);
  --fcc-free-soft: color-mix(in srgb, var(--fcc-free) 10%, transparent);
  --fcc-radius: 10px;
  color: var(--fcc-ink);
  font-size: 15px;
  line-height: 1.45;
  margin: 1.5em 0;
  box-sizing: border-box;
}
.fcc *, .fcc *::before, .fcc *::after { box-sizing: border-box; }

.fcc-theme-dark {
  --fcc-bg: #0f1716; --fcc-surface: #172321; --fcc-ink: #e8f0ef; --fcc-muted: #93a6a3; --fcc-line: #263735; --fcc-free: #4ade80;
  background: var(--fcc-bg); padding: 20px; border-radius: 14px;
}
@media (prefers-color-scheme: dark) {
  .fcc-theme-auto {
    --fcc-bg: #0f1716; --fcc-surface: #172321; --fcc-ink: #e8f0ef; --fcc-muted: #93a6a3; --fcc-line: #263735; --fcc-free: #4ade80;
    background: var(--fcc-bg); padding: 20px; border-radius: 14px;
  }
}

.fcc .fcc-head { margin-bottom: 14px; }
.fcc .fcc-title { margin: 0 0 4px; font-size: 1.5em; line-height: 1.2; }
.fcc .fcc-sub { margin: 0; color: var(--fcc-muted); }
.fcc .fcc-section { margin-bottom: 26px; }
.fcc .fcc-section-title { margin: 0 0 12px; font-size: 1.1em; }
.fcc .fcc-group { margin-bottom: 20px; }
.fcc .fcc-group-title { margin: 0 0 10px; font-size: 1em; color: var(--fcc-muted); }
.fcc .fcc-empty, .fcc .fcc-loading { padding: 22px; text-align: center; color: var(--fcc-muted); background: var(--fcc-surface); border-radius: var(--fcc-radius); margin: 0; }
.fcc .fcc-disclosure { margin: 12px 0 0; font-size: 12.5px; color: var(--fcc-muted); }

.fcc .fcc-v { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.fcc .fcc-v2 { display: block; font-size: 12.5px; color: var(--fcc-muted); }
.fcc a { color: inherit; }
.fcc .fcc-plan-name a, .fcc .fcc-firm-name a { text-decoration: none; }
.fcc .fcc-plan-name a:hover, .fcc .fcc-firm-name a:hover { text-decoration: underline; }

.fcc .fcc-firm { display: inline-flex; align-items: center; gap: 10px; }
.fcc .fcc-firm-name { font-weight: 700; }
.fcc .fcc-logo { width: 34px; height: 34px; border-radius: 8px; flex: none; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--fcc-surface); border: 1px solid var(--fcc-line); }
.fcc .fcc-logo img { width: 100%; height: 100%; object-fit: contain; display: block; margin: 0; }
.fcc .fcc-logo-ph { font-weight: 700; color: var(--fcc-accent); }
.fcc .fcc-plan-name { display: block; font-weight: 600; }
.fcc .fcc-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--fcc-accent-soft); color: var(--fcc-accent); }
.fcc-theme-dark .fcc-pill { color: var(--fcc-ink); }
.fcc .fcc-rank { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 13px; background: var(--fcc-surface); color: var(--fcc-muted); }
.fcc .fcc-rank-1 { background: var(--fcc-accent); color: #fff; }

/* Consistency badge — "No rule" is the loud, good state */
.fcc .fcc-badge { display: inline-block; padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: 0.92em; background: var(--fcc-surface); border: 1px solid var(--fcc-line); }
.fcc .fcc-badge-free { background: var(--fcc-free-soft); border-color: transparent; color: var(--fcc-free); }
.fcc .fcc-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fcc .fcc-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--fcc-surface); border: 1px solid var(--fcc-line); font-size: 12px; color: var(--fcc-muted); }
.fcc .fcc-chip b { color: var(--fcc-ink); font-weight: 700; }

.fcc .fcc-btn { display: inline-block; padding: 9px 16px; border-radius: 8px; text-decoration: none !important; white-space: nowrap; background: var(--fcc-accent); color: #fff !important; font-weight: 600; font-size: 14px; line-height: 1.2; border: 0; cursor: pointer; transition: filter .15s; }
.fcc .fcc-btn:hover { filter: brightness(1.1); }
.fcc .fcc-btn-ghost { background: transparent; color: var(--fcc-accent) !important; border: 1px solid var(--fcc-line); }
.fcc .fcc-btn:focus-visible, .fcc button:focus-visible, .fcc input:focus-visible, .fcc select:focus-visible { outline: 2px solid var(--fcc-accent); outline-offset: 2px; }

/* Table */
.fcc .fcc-table-wrap { overflow-x: auto; border: 1px solid var(--fcc-line); border-radius: var(--fcc-radius); background: var(--fcc-bg); }
.fcc .fcc-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; }
.fcc .fcc-table th { text-align: left; padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--fcc-muted); background: var(--fcc-surface); border: 0; border-bottom: 1px solid var(--fcc-line); white-space: nowrap; }
.fcc .fcc-table td { padding: 13px 14px; vertical-align: middle; border: 0; border-bottom: 1px solid var(--fcc-line); background: transparent; }
.fcc .fcc-table tbody tr:last-child td { border-bottom: 0; }
.fcc .fcc-table tbody tr:hover td { background: var(--fcc-surface); }
.fcc .fcc-table .fcc-c-rank { width: 1%; }
.fcc .fcc-table .fcc-c-cta { text-align: right; width: 1%; }
.fcc .fcc-table.fcc-grid td:first-child, .fcc .fcc-table.fcc-grid th:first-child { min-width: 160px; }

@media (max-width: 780px) {
  .fcc .fcc-table-wrap { border: 0; background: transparent; overflow: visible; }
  .fcc .fcc-table:not(.fcc-grid), .fcc .fcc-table:not(.fcc-grid) tbody { display: block; }
  .fcc .fcc-table:not(.fcc-grid) thead { display: none; }
  .fcc .fcc-table:not(.fcc-grid) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--fcc-line); border-radius: var(--fcc-radius); background: var(--fcc-bg); }
  .fcc .fcc-table:not(.fcc-grid) td { display: block; padding: 0; border: 0 !important; background: transparent !important; }
  .fcc .fcc-table:not(.fcc-grid) td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 12px; color: var(--fcc-muted); margin-bottom: 2px; }
  .fcc .fcc-table:not(.fcc-grid) td.fcc-c-rank, .fcc .fcc-table:not(.fcc-grid) td.fcc-c-firm, .fcc .fcc-table:not(.fcc-grid) td.fcc-c-plan, .fcc .fcc-table:not(.fcc-grid) td.fcc-c-consistency, .fcc .fcc-table:not(.fcc-grid) td.fcc-c-cta { grid-column: 1 / -1; }
}

/* Cards */
.fcc .fcc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fcc .fcc-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--fcc-line); border-radius: var(--fcc-radius); background: var(--fcc-bg); }
.fcc .fcc-card-top { display: flex; align-items: center; gap: 10px; }
.fcc .fcc-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fcc .fcc-facts > div { margin: 0; }
.fcc .fcc-facts dt { font-size: 12px; color: var(--fcc-muted); margin: 0; }
.fcc .fcc-facts dd { margin: 0; }
.fcc .fcc-card-cta { margin-top: auto; }
.fcc .fcc-card-cta .fcc-btn { display: block; text-align: center; }

/* Interactive tool */
.fcc .fcc-ui { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.fcc .fcc-side { position: sticky; top: 16px; padding: 16px; border: 1px solid var(--fcc-line); border-radius: var(--fcc-radius); background: var(--fcc-surface); max-height: calc(100vh - 32px); overflow: auto; }
.fcc .fcc-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fcc .fcc-link { background: none; border: 0; padding: 0; color: var(--fcc-accent); cursor: pointer; font-size: 13px; text-decoration: underline; }
.fcc .fcc-fset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.fcc .fcc-fset > legend, .fcc .fcc-flabel { font-size: 13px; font-weight: 700; padding: 0; margin: 0 0 7px; display: block; }
.fcc .fcc-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.fcc .fcc-toggle { border: 1px solid var(--fcc-line); background: var(--fcc-bg); color: var(--fcc-ink); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; line-height: 1.3; font-family: inherit; }
.fcc .fcc-toggle small { color: var(--fcc-muted); margin-left: 4px; }
.fcc .fcc-toggle[aria-pressed="true"] { background: var(--fcc-accent); border-color: var(--fcc-accent); color: #fff; }
.fcc .fcc-toggle[aria-pressed="true"] small { color: rgba(255,255,255,.8); }
.fcc .fcc-radio { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 6px; font-size: 13.5px; cursor: pointer; }
.fcc .fcc-radio input { margin-top: 3px; }
.fcc .fcc-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.fcc .fcc-switch input { width: 18px; height: 18px; accent-color: var(--fcc-free); }
.fcc .fcc-range { width: 100%; accent-color: var(--fcc-accent); margin: 0; }
.fcc .fcc-fval { float: right; font-weight: 500; color: var(--fcc-muted); }
.fcc .fcc-firmbox { max-height: 190px; overflow: auto; border: 1px solid var(--fcc-line); border-radius: 8px; background: var(--fcc-bg); padding: 6px 10px; }
.fcc .fcc-firmbox label { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 13.5px; cursor: pointer; }
.fcc .fcc-search { width: 100%; margin: 0 0 6px; padding: 7px 10px; border: 1px solid var(--fcc-line); border-radius: 8px; background: var(--fcc-bg); color: var(--fcc-ink); font-size: 13.5px; font-family: inherit; }

.fcc .fcc-main { min-width: 0; }
.fcc .fcc-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fcc .fcc-stat { padding: 12px 14px; border-radius: var(--fcc-radius); background: var(--fcc-surface); }
.fcc .fcc-stat b { display: block; font-size: 1.3em; font-variant-numeric: tabular-nums; }
.fcc .fcc-stat span { font-size: 12.5px; color: var(--fcc-muted); }
.fcc .fcc-stat.fcc-stat-free { background: var(--fcc-free-soft); }
.fcc .fcc-stat.fcc-stat-free b { color: var(--fcc-free); }

.fcc .fcc-bar-tools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fcc .fcc-count { color: var(--fcc-muted); font-size: 14px; }
.fcc .fcc-tools-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fcc .fcc-select { padding: 7px 28px 7px 10px; border: 1px solid var(--fcc-line); border-radius: 8px; background-color: var(--fcc-bg); color: var(--fcc-ink); font-size: 13.5px; font-family: inherit; }
.fcc .fcc-seg { display: inline-flex; border: 1px solid var(--fcc-line); border-radius: 8px; overflow: hidden; }
.fcc .fcc-seg button { border: 0; background: var(--fcc-bg); color: var(--fcc-ink); padding: 7px 12px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.fcc .fcc-seg button[aria-pressed="true"] { background: var(--fcc-accent); color: #fff; }
.fcc .fcc-tool-btn { border: 1px solid var(--fcc-line); background: var(--fcc-bg); color: var(--fcc-ink); padding: 7px 12px; border-radius: 8px; font-size: 13.5px; cursor: pointer; font-family: inherit; }
.fcc .fcc-more { display: block; margin: 16px auto 0; }
.fcc .fcc-filter-toggle { display: none; }

@media (max-width: 900px) {
  .fcc .fcc-ui { grid-template-columns: 1fr; }
  .fcc .fcc-side { position: static; max-height: none; display: none; }
  .fcc .fcc-side.is-open { display: block; }
  .fcc .fcc-filter-toggle { display: inline-block; }
}

@media (prefers-reduced-motion: reduce) { .fcc * { transition: none !important; } }
