/* AP score calculators, shared tool styles.
   Scoped to .ftb-tool-ap, which all five subjects use, so this file is byte
   identical in the chemistry, calculus AB, biology, stats and psych folders.
   Only the current tool's CSS is ever loaded (class-assets.php); WordPress
   shares engine.js between tools but not stylesheets. Keep the three copies in
   sync. Every value is a token (§4.2). */

.ftb-tool-ap .ftb-ap-note{margin:0 0 var(--ftb-space-4);font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-semi)}
.ftb-tool-ap .ftb-ap-set{margin:0 0 var(--ftb-space-5);padding:var(--ftb-space-4) var(--ftb-space-5);
  border:1px solid var(--ftb-border);border-radius:var(--ftb-radius);background:var(--ftb-surface);min-width:0}
.ftb-tool-ap legend{padding:0 var(--ftb-space-2);font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-bold)}
.ftb-tool-ap .ftb-ap-grid{display:grid;gap:0 var(--ftb-space-4);
  grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr))}
.ftb-tool-ap .ftb-field{margin-bottom:var(--ftb-space-4);min-width:0}
.ftb-tool-ap .ftb-ap-max{color:var(--ftb-text-muted);font-weight:var(--ftb-fw-normal)}
.ftb-tool-ap .ftb-ap-curvepick{max-width:22rem}
.ftb-tool-ap [aria-invalid=true]{border-color:var(--ftb-error)}
/* Psych rubric parts: wider cells for a label plus a one-line hint. */
.ftb-tool-ap .ftb-ap-wide{grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr))}
/* Inputs line up along a row even when one hint wraps to two lines. */
.ftb-tool-ap .ftb-ap-wide .ftb-field{display:flex;flex-direction:column;justify-content:flex-end}
.ftb-tool-ap .ftb-ap-subh{margin:0 0 var(--ftb-space-3);font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-semi)}
.ftb-tool-ap .ftb-ap-wide+.ftb-ap-subh{margin-top:var(--ftb-space-2)}
.ftb-tool-ap .ftb-ap-hint{display:block;font-size:var(--ftb-text-sm);color:var(--ftb-text-muted)}

/* ---------------------------------------------------------------- results */

/* Height reserved so the first estimate never shifts the page (§10). */
.ftb-tool-ap .ftb-ap-results{min-height:calc(var(--ftb-space-24) + var(--ftb-space-16))}
.ftb-tool-ap .ftb-ap-h{margin:0 0 var(--ftb-space-4);font-size:var(--ftb-text-lg);font-weight:var(--ftb-fw-semi)}
.ftb-tool-ap .ftb-ap-h3{margin:var(--ftb-space-5) 0 var(--ftb-space-2);font-size:var(--ftb-text-sm);
  font-weight:var(--ftb-fw-semi);color:var(--ftb-text-muted)}

.ftb-tool-ap .ftb-ap-headline{display:flex;align-items:baseline;gap:var(--ftb-space-3);
  padding:var(--ftb-space-4) var(--ftb-space-5);background:var(--ftb-surface-2);border-radius:var(--ftb-radius)}
.ftb-tool-ap .ftb-ap-big{margin:0;font-size:var(--ftb-text-3xl);font-weight:var(--ftb-fw-bold);
  color:var(--ftb-primary);line-height:1;font-variant-numeric:tabular-nums}
.ftb-tool-ap .ftb-ap-biglab{margin:0;font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-semi);color:var(--ftb-text-muted)}
.ftb-tool-ap .ftb-ap-summary{margin:var(--ftb-space-3) 0 var(--ftb-space-4)}

.ftb-tool-ap .ftb-ap-boxes{display:grid;gap:var(--ftb-space-3);
  grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr))}
.ftb-tool-ap .ftb-ap-box{padding:var(--ftb-space-4);background:var(--ftb-surface);
  border:1px solid var(--ftb-border);border-radius:var(--ftb-radius)}
.ftb-tool-ap .ftb-ap-k{margin:0;font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-semi);color:var(--ftb-text-muted)}
.ftb-tool-ap .ftb-ap-v{margin:var(--ftb-space-1) 0 0;font-size:var(--ftb-text-xl);font-weight:var(--ftb-fw-bold);
  font-variant-numeric:tabular-nums}
.ftb-tool-ap .ftb-ap-box .ftb-tool-stat{margin-top:var(--ftb-space-1)}

.ftb-tool-ap .ftb-ap-list{margin:0;padding-inline-start:var(--ftb-space-6);
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug)}
.ftb-tool-ap .ftb-ap-list li + li{margin-top:var(--ftb-space-2)}
.ftb-tool-ap .ftb-ap-src{color:var(--ftb-text-muted)}

.ftb-tool-ap .ftb-ap-work{margin-top:var(--ftb-space-5)}
.ftb-tool-ap .ftb-ap-work summary{display:flex;align-items:center;min-height:var(--ftb-tap);cursor:pointer;
  font-size:var(--ftb-text-sm);font-weight:var(--ftb-fw-semi);color:var(--ftb-primary)}
.ftb-tool-ap .ftb-ap-work summary:focus-visible{outline:2px solid var(--ftb-primary);outline-offset:2px}
.ftb-tool-ap .ftb-ap-work ol{margin:var(--ftb-space-3) 0 0;padding-inline-start:var(--ftb-space-6);
  font-size:var(--ftb-text-sm);line-height:var(--ftb-lh-snug)}
.ftb-tool-ap .ftb-ap-work li + li{margin-top:var(--ftb-space-2)}

.ftb-tool-ap .ftb-ap-disclaimer{margin:var(--ftb-space-6) 0 0;padding:var(--ftb-space-4) var(--ftb-space-5);
  background:var(--ftb-surface-2);border-radius:var(--ftb-radius);font-size:var(--ftb-text-sm);
  line-height:var(--ftb-lh-snug);color:var(--ftb-text-muted)}

@media (max-width:479px){
  .ftb-tool-ap .ftb-ap-set{padding:var(--ftb-space-3)}
  .ftb-tool-ap .ftb-tool-actions .ftb-btn{flex:1 1 auto}
}
