/* FinE Retirement Planning R3 — module-scoped presentation.
 *
 * Loaded only by r3.html. styles/app.css, styles/tokens.css, and styles/print.css are
 * SHARED with the accepted R1 and R2 baselines and are NOT modified by R3. Every value
 * here resolves to a semantic token from tokens.css; no literal colour is introduced.
 *
 * FinE family visual system only. No retirement-specific logo, mascot, or brand.
 */

/* Row-header reflow, same latent defect corrected for R2 in styles/r2.css. R3 tables
   carry a row header in every table, so the rule is completed for row headers too. */
@media (max-width: 46rem) {
  table.fine-table tbody th[scope="row"] {
    display: block;
    width: 100%;
    border-bottom: none;
    padding: var(--fine-space-1) 0;
    text-align: left;
    font-weight: 400;
  }
  table.fine-table tbody th[scope="row"]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    font-size: 0.8125rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  }
  table.fine-table th.fine-num { text-align: left; font-variant-numeric: tabular-nums; }

  /* No table may produce page-level horizontal scrolling at narrow widths. */
  .fine-table-wrap { overflow-x: visible; max-width: 100%; }
  table.fine-table { table-layout: auto; word-break: break-word; }
}

@media print {
  #print-region table th[scope="row"]::before { content: none; }
}

/* Progress contract: session and module progress are both always visible. */
.fine-progress .fine-session-progress,
.fine-progress .fine-module-progress { font-weight: 600; }

/* Contrast-case banner. Meaning is carried by text and a border, never by colour alone. */
.fine-contrast-banner {
  display: block;
  border: 2px solid var(--fine-anchor);
  border-left-width: 6px;
  padding: var(--fine-space-2);
  margin: var(--fine-space-3) 0;
  font-weight: 600;
}

/* Grouped activity blocks. */
.fine-grid-item {
  border: 1px solid var(--fine-border);
  padding: var(--fine-space-2);
  margin: var(--fine-space-2) 0;
}

.fine-fieldset {
  border: 1px solid var(--fine-border);
  padding: var(--fine-space-2);
  margin: var(--fine-space-2) 0;
}
.fine-fieldset legend { font-weight: 600; padding: 0 var(--fine-space-1); }

.fine-choice { display: flex; align-items: flex-start; gap: var(--fine-space-1); margin: var(--fine-space-1) 0; }
.fine-choice label { flex: 1; }

.fine-field { margin: var(--fine-space-2) 0; }
.fine-field label { display: block; font-weight: 600; margin-bottom: var(--fine-space-1); }
.fine-field textarea { width: 100%; min-height: 6rem; font: inherit; padding: var(--fine-space-1); }

/* Feedback. Corrective feedback is marked by a label and a border, not by colour alone. */
.fine-corrective { border-left: 4px solid var(--fine-anchor); padding-left: var(--fine-space-2); }
.fine-hard-errors { border: 1px solid var(--fine-border); padding: var(--fine-space-2); margin-top: var(--fine-space-2); }
.fine-model-label { font-style: italic; font-weight: 600; }

.fine-sources { border-top: 1px solid var(--fine-border); padding-top: var(--fine-space-1); }
.fine-disclosure { border-top: 1px solid var(--fine-border); margin-top: var(--fine-space-3); padding-top: var(--fine-space-2); }
.fine-disclosure-persistent { font-size: 0.875rem; }

.fine-instructor-meta pre { white-space: pre-wrap; word-break: break-word; font-size: 0.8125rem; }
.fine-plaintext pre { white-space: pre-wrap; word-break: break-word; }

.fine-print-region { display: none; }
@media print {
  .fine-print-region { display: block; }
  .fine-nav, .fine-actions, .fine-skip { display: none; }
}

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