/* ENOKQA /calculator/ — page-specific styles. Loads after /assets/styles.css and reuses its tokens
   (--navy, --blue, --red, --bg-soft, --border, --text, --text-muted, --font-mono ...). CSP: style-src 'self'. */
.calc { padding-top: 1.5rem; padding-bottom: 3rem; }   /* longhands: keep .container's side padding so /calculator/ is inset at 390px (B5) */
.calc .section-title { font-size: 1.05rem; margin-bottom: .9rem; }
.eq {
  font-family: var(--font-mono); font-size: .88rem; color: var(--navy);
  background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: 6px; padding: .6rem .8rem; margin: 0; overflow-x: auto; white-space: nowrap;
}
.card {
  background: var(--white); border: 1px solid var(--border); border-top: var(--card-top, 3px solid var(--blue));
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem; margin-top: 1.25rem; min-width: 0;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid2 > .card { margin-top: 0; }
.row-gap { margin-top: 1.25rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .92rem; font-weight: 500; color: var(--text); margin-bottom: .35rem; }
.field .ctl { display: flex; gap: .6rem; align-items: center; }
.field input[type=range] { flex: 1; min-width: 0; accent-color: var(--blue); }
.field input[type=number], .calc select {
  width: 8.5rem; min-height: 40px; font-family: var(--font-mono); font-size: .88rem; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: .35rem .5rem; background: var(--white);
}
.calc select { font-family: var(--font-sans); }
.field input.num-wide { flex: 1; width: auto; min-width: 0; }
.calc select.select-full { width: 100%; }
.hint { font-size: .8rem; color: var(--text-muted); line-height: 1.55; margin: .3rem 0 0; }
.hint-gap { margin-top: .6rem; }
.note { font-size: .84rem; color: var(--text-muted); line-height: 1.6; border-left: 3px solid var(--red); padding-left: .65rem; margin: .6rem 0 0; }
.warn { display: none; font-size: .86rem; color: #5E0716; background: var(--red-tint); border: 1px solid #F1C2CA; border-radius: 6px; padding: .5rem .65rem; margin-top: .6rem; line-height: 1.5; }
.warn.on { display: block; }
/* Input validation, stale outputs, slider out-of-range, snap note (2026-10-21) */
.field input[aria-invalid=true] { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-tint); }
.field-err { display: none; font-size: .8rem; color: #8A0A1F; line-height: 1.5; margin: .3rem 0 0; }
.field-err.on { display: block; }
.oor-hint { display: none; color: #8A0A1F; }
.oor-hint.on { display: block; }
.field input[type=range].oor { opacity: .4; }
.snap-note { display: none; margin: -.4rem 0 .6rem; }
.snap-note.on { display: block; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.stale-msg { display: none; font-size: .84rem; color: #5E0716; background: var(--red-tint); border: 1px solid #F1C2CA; border-radius: 6px; padding: .5rem .65rem; margin-bottom: .6rem; line-height: 1.5; }
.stale-msg.on { display: block; }
table.out.stale td { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(200, 16, 46, .5); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }

table.out { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.out th, table.out td { text-align: left; padding: .45rem .3rem; border-bottom: 1px solid var(--blue-tint); vertical-align: top; }
table.out th { color: var(--text-muted); font-weight: 400; width: 45%; }
table.out td { font-family: var(--font-mono); color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.regime { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-family: var(--font-sans); font-size: .8rem; font-weight: 500; border: 1px solid; }
.rg-low { color: var(--navy); border-color: var(--navy); background: var(--blue-tint); }
.rg-mid { color: var(--white); border-color: var(--blue); background: var(--blue); }
.rg-high { color: var(--white); border-color: var(--red); background: var(--red); }

.chart-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; }
.chart-wrap canvas, .sim-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }
.sw { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }
.sw.c-curve { background: var(--chart-curve, #1F4FBF); } .sw.c-lc { background: var(--chart-lc, #0B2A5B); } .sw.c-lg, .sw.c-b { background: var(--chart-lg, #C8102E); } .sw.c-stat { background: var(--chart-stat, #6B7FA3); }
.sw.c-pt { background: var(--chart-point, #14213D); width: 9px; height: 9px; border-radius: 50%; }

.consts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.const { border: 1px solid var(--border); border-radius: 6px; padding: .7rem; background: var(--bg-soft); }
.const .k { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.const .v { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 500; color: var(--navy); margin-top: .2rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.const .v.red { color: var(--red); }
.const .d { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; line-height: 1.5; }

.sim-grid { display: grid; grid-template-columns: 300px 1fr; gap: 1.25rem; margin-top: .9rem; }
.sim-ctrls .field { margin-bottom: .7rem; }
.sim-ctrls .field input[type=number] { width: 6rem; }
.sim-stats { font-family: var(--font-mono); font-size: .8rem; color: var(--text-muted); margin: .5rem 0 0; line-height: 1.6; }
.sim-canvas-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 220px; }
.sim-canvas-wrap canvas { border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); }
.foot { font-size: .88rem; color: var(--text-muted); line-height: 1.7; }
.foot p { margin: 0; }
.foot p + p { margin-top: .5rem; }

@media (max-width: 900px) { .grid2, .sim-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .eq { white-space: normal; overflow-x: visible; line-height: 1.9; }   /* wrap instead of a scroll strip (axe: scrollable-region-focusable) */
  .card { padding: .85rem; }
  .field input[type=number] { width: 6.5rem; }
  .chart-wrap, .sim-canvas-wrap { aspect-ratio: 4 / 3; }
}
