/* ABG Practice Tutor — app styles (on top of /assets/labs.css) */
.app-page .page-title { margin-bottom: 18px; }
.app-block { margin-top: 20px; }
.h-sm { font-size: 22px; margin: 0 0 6px; }
.h-xs { font-size: 17px; margin: 22px 0 8px; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.field-msg { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.field-msg:empty { min-height: 0; margin: 0; }
.field-msg.err { color: var(--danger); font-weight: 600; }
.field-msg.ok { color: var(--ok); font-weight: 600; }
.danger { color: var(--danger) !important; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)) !important; }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent) !important; }
.disclaimer { margin-top: 24px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.file-btn { position: relative; overflow: hidden; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; }
.file-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.f { display: grid; gap: 4px; align-content: start; min-width: 0; }
.f label { display: block; font-size: 14px; }
.f select { min-height: 44px; padding: 8px 12px; width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pick-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 8px; }
.grow { flex: 1 1 18rem; }

/* Case */
.case-meta { margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.story { font-size: 17px; margin: 0 0 12px; max-width: 70ch; }
.table-scroll { overflow-x: auto; }
.vals { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .vals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.val { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); min-width: 0; }
.val dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.val dd { margin: 0; font-size: 20px; font-weight: 650; overflow-wrap: anywhere; }
.vals .u { font-size: 13px; font-weight: 400; color: var(--muted); }
.ranges { margin: 6px 0 4px; }
.ranges summary { cursor: pointer; color: var(--accent); font-size: 15px; min-height: 32px; display: inline-flex; align-items: center; }

/* Dialogue */
.log { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.turn { display: grid; grid-template-columns: 4.5rem 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); overflow-wrap: anywhere; }
.turn.you { background: var(--bg); }
.turn .who { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.turn.good { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.turn.nudge { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.turn.hint { border-style: dashed; }
.qa { margin-top: 16px; padding: 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--line); }
.q { font-size: 18px; font-weight: 650; margin: 0 0 12px; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; }
.choice:hover { border-color: var(--accent); }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.choice:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice input, .choice input:focus, .choice input:focus-visible { outline: none !important; box-shadow: none !important; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.num-row { display: flex; align-items: center; gap: 10px; }
.num { min-height: 44px; width: 10rem; font-size: 18px; padding: 8px 12px; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); }

/* Breakdown */
.breakdown { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
.bd-out { margin: 0 0 10px; }
.bd-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bd-step { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--bg); }
.bd-n { margin: 0 0 6px; font-size: 15px; }
.bd-step dl { display: grid; grid-template-columns: 11rem 1fr; gap: 4px 12px; margin: 0; font-size: 15px; }
.bd-step dt { color: var(--muted); font-weight: 600; }
.bd-step dd { margin: 0; }
@media (max-width: 640px) { .bd-step dl { grid-template-columns: 1fr; } .bd-step dd { margin-bottom: 6px; } .turn { grid-template-columns: 1fr; gap: 2px; } }
.insight { margin: 14px 0 0; padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Progress */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-top: 8px; }
.stat { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.stat-n { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 9rem minmax(4rem, 1fr) 13rem; gap: 12px; align-items: center; font-size: 14px; }
.bar { width: 100%; height: 12px; }
.bar-bg { fill: var(--surface-2); }
.bar-fg { fill: var(--accent); }
.bar-fg.low { fill: var(--warn); }
.bar-val { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr; gap: 2px; } }
.weak { font-weight: 600; margin: 12px 0 0; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; }
.tbl td.num { font-variant-numeric: tabular-nums; }
html { scroll-padding-top: 84px; }
@media print { .top, .foot, .btn-row, .qa, #phi-notice { display: none !important; } }
[hidden] { display: none !important; }
