/* Fidelity (/stories/fidelity), design docs/designs/fidelity-consolidation-2026-11-17. Plain, not scoped: the page's
   tabs, Start a run and the recording page's Fidelity panel are separate components sharing these pieces. */
.fc{display:flex;flex-direction:column;gap:16px;}
.fc-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;}
.fc-tools__end{margin-left:auto;font-size:var(--fs-xs);color:var(--muted);}
.fc-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;}
@media (max-width:1100px){.fc-two{grid-template-columns:1fr;}}
.fc-lab{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:10px 0 4px;}
.fc-sub{display:block;font-size:var(--fs-xs);color:var(--muted);font-weight:400;}
.fc-help{font-size:var(--fs-xs);color:var(--muted);margin:0;}

/* Stacked state bar: what settled each chunk */
.fc-bar{height:8px;border-radius:var(--r-full);background:var(--surface-3);overflow:hidden;display:flex;flex:1;min-width:60px;}
.fc-bar i{display:block;height:100%;}
.fc-bar--lg{height:16px;border-radius:5px;}
.fc-bar--xl{height:28px;border-radius:6px;margin-bottom:12px;}
.f-clean{background:var(--v-clean);}.f-rule{background:var(--v-rule);}.f-fixed{background:var(--v-fixed);}
.f-person{background:var(--v-person);}.f-flag{background:var(--v-flag);}.f-wait{background:var(--v-wait);}
.f-ok{background:var(--success);}.f-same{background:var(--muted);}.f-bad{background:var(--danger);}.f-info{background:var(--info);}
.f-none{background:var(--surface-3);}
.fc-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:var(--fs-xs);color:var(--ink-2);}
.fc-legend span{display:inline-flex;align-items:center;gap:6px;}
.fc-legend i{width:10px;height:10px;border-radius:3px;display:inline-block;}
.fc-legend i.f-none{box-shadow:0 0 0 1px var(--line-strong);}

/* Where they stand */
.fc-fun{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;}
.fc-step{border:1px solid var(--line);border-radius:8px;padding:10px 12px;background:var(--surface-2);display:flex;flex-direction:column;gap:2px;color:inherit;}
a.fc-step:hover{text-decoration:none;border-color:var(--line-strong);}
.fc-step__k{font-size:var(--fs-xs);color:var(--muted);display:flex;align-items:center;gap:6px;}
.fc-step__k i{width:9px;height:9px;border-radius:2px;display:inline-block;}
.fc-step__v{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums;}
.fc-step__s{font-size:var(--fs-xs);color:var(--muted);}
.fc-step--flag{background:var(--warn-soft);border-color:var(--warn-line);}

/* Is another pass worth it */
.fc-dim{position:relative;display:flex;align-items:flex-end;gap:18px;height:150px;padding:0 6px;border-bottom:1px solid var(--line);}
.fc-dim__c{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;height:100%;}
.fc-dim__c b{font-size:var(--fs-xs);font-variant-numeric:tabular-nums;}
.fc-dim__c i{display:block;width:100%;max-width:56px;border-radius:4px 4px 0 0;background:var(--v-fixed);}
.fc-dim__c i.low{background:var(--v-wait);}
.fc-dim__line{position:absolute;left:0;right:0;border-top:2px dashed var(--warn);pointer-events:none;}
.fc-dim__x{display:flex;gap:18px;padding:6px 6px 0;}
.fc-dim__x span{flex:1;text-align:center;font-size:11.5px;color:var(--muted);}
.fc-verdict{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:8px;border:1px solid var(--ai-line);background:var(--ai-soft);margin-top:12px;}
.fc-verdict--ok{border-color:var(--success-line);background:var(--success-soft);}
.fc-verdict p{margin:0 0 4px;}

/* Levers */
.fc-levers{display:flex;flex-direction:column;}
.fc-lever{display:grid;grid-template-columns:34px minmax(0,1fr) 190px 190px;gap:14px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);}
.fc-lever:last-child{border-bottom:0;}
@media (max-width:900px){.fc-lever{grid-template-columns:34px minmax(0,1fr);}.fc-lever__n,.fc-lever__act{grid-column:2;}}
.fc-lever__ic{width:34px;height:34px;border-radius:8px;display:grid;place-items:center;}
.fc-lever__ic--info{background:var(--info-soft);color:var(--info);}
.fc-lever__ic--warn{background:var(--warn-soft);color:var(--warn);}
.fc-lever__ic--success{background:var(--success-soft);color:var(--success);}
.fc-lever__ic--ai{background:var(--ai-soft);color:var(--ai);}
.fc-lever__ic--muted{background:var(--surface-3);color:var(--muted);}
.fc-lever__t{font-weight:600;}
.fc-lever__s{color:var(--muted);font-size:var(--fs-xs);}
.fc-lever__n{font-size:var(--fs-xs);color:var(--ink-2);}
.fc-lever__n b{font-size:16px;color:var(--ink);font-variant-numeric:tabular-nums;display:block;}
.fc-lever__act{display:flex;justify-content:flex-end;}

/* A difference: expected struck through, heard after it */
.fc-diff{display:inline-flex;align-items:center;gap:6px;}
.fc-diff s{color:var(--danger);text-decoration-color:var(--danger-line);}
.fc-diff u{color:var(--success);text-decoration:none;font-weight:600;}
.fc-ar{font-family:var(--font-arabic);unicode-bidi:isolate;}
.fc-flag{width:18px;height:12px;border-radius:2px;object-fit:cover;vertical-align:-1px;margin-right:5px;box-shadow:0 0 0 1px var(--line);}
.fc-run{display:flex;flex-direction:column;gap:4px;min-width:180px;}
.fc-sel > td{background:var(--brand-soft);}
.fc-sel > td:first-child{box-shadow:inset 3px 0 0 var(--brand);}

/* How it works */
.fc-lane{display:flex;align-items:stretch;gap:10px;flex-wrap:wrap;}
.fc-node{flex:1 1 160px;min-width:0;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);padding:12px 14px;display:flex;flex-direction:column;gap:4px;}
.fc-node__t{font-weight:600;}
.fc-node__s{font-size:var(--fs-xs);color:var(--muted);}
.fc-node__w{font-size:var(--fs-xs);color:var(--info);font-weight:500;margin-top:auto;padding-top:6px;}
.fc-node--ai{border-color:var(--ai-line);background:var(--ai-soft);}
.fc-node--ok{border-color:var(--success-line);background:var(--success-soft);}
.fc-node--warn{border-color:var(--warn-line);background:var(--warn-soft);}
.fc-node--person{border-color:var(--person-line);background:var(--person-soft);}

/* Start a run */
.fc-start{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:16px;align-items:start;}
@media (max-width:1000px){.fc-start{grid-template-columns:1fr;}}
.fc-start__col{display:flex;flex-direction:column;gap:16px;}
.fc-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.fc-field:last-child{margin-bottom:0;}
.fc-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.fc-kpi{display:flex;align-items:baseline;gap:8px;margin-bottom:8px;}
.fc-kpi b{font-size:28px;font-weight:600;font-variant-numeric:tabular-nums;}
.fc-kpi span{color:var(--muted);}
.fc-go{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;}

/* Recording page: chunk strip and history */
.fc-strip{display:grid;grid-template-columns:repeat(auto-fill,minmax(30px,1fr));gap:4px;margin:10px 0 14px;}
.fc-strip button{height:26px;border:0;border-radius:4px;display:grid;place-items:center;font:600 10.5px var(--font-ui);color:var(--on-tone);cursor:pointer;padding:0;}
.fc-strip button.f-wait,.fc-strip button.f-rule{color:var(--ink);}
.fc-strip button:hover{outline:2px solid var(--ink);}
.fc-strip button[aria-pressed="true"]{outline:2px solid var(--ink);outline-offset:1px;}
.fc-tl{display:flex;flex-direction:column;margin:0;padding:0;list-style:none;}
.fc-tl li{display:grid;grid-template-columns:110px 20px minmax(0,1fr);gap:10px;align-items:start;padding-bottom:14px;}
.fc-tl__d{font-size:var(--fs-xs);color:var(--muted);text-align:right;padding-top:1px;}
.fc-tl__dot{width:12px;height:12px;border-radius:50%;margin-top:4px;justify-self:center;}
.fc-tl__dot--clean{background:var(--v-clean);}.fc-tl__dot--flag{background:var(--v-flag);}.fc-tl__dot--fixed{background:var(--v-fixed);}
.fc-tl__dot--person{background:var(--v-person);}.fc-tl__dot--wait{background:var(--v-wait);}.fc-tl__dot--warn{background:var(--warn);}
.fc-tl__t{font-weight:600;}
.fc-tl__s{font-size:var(--fs-xs);color:var(--muted);}
.fc-acts{display:flex;flex-wrap:wrap;gap:8px;}
.fc-matrix td.c-better{background:var(--success-soft);}
.fc-matrix td.c-worse{background:var(--danger-soft);}
.fc-grow{flex:1;min-width:160px;}
.fc-gap-b{margin-bottom:10px;}
.fc-gap-t{margin-top:14px;}
.fc-gloss{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:var(--sp-3);font-size:var(--fs-sm);}
.fc-gloss b{display:block;margin-bottom:2px;}
.fc-gloss .v-clean{color:var(--success);}.fc-gloss .v-minor{color:var(--warn);}.fc-gloss .v-hall{color:var(--danger);}

/* ── Audio quality (/stories/audio-quality, approved redesign 2026-11-19) ───────────────────── */
.aq{display:flex;flex-direction:column;gap:var(--sp-4);}
.aq-s-clean{background:var(--v-clean);}.aq-s-ear{background:var(--v-person);}.aq-s-fixed{background:var(--v-fixed);}
.aq-s-prog{background:var(--subtle);}.aq-s-need{background:var(--v-flag);}.aq-s-rest{background:var(--surface-3);}
.aq-s-ink{background:var(--ink-2);}.aq-s-none{background:transparent;}
.aq-c-ok{color:var(--success);}.aq-c-need{color:var(--warn);}.aq-c-ink2{color:var(--ink-2);}.aq-c-ear{color:var(--ai);}
.aq-muted{color:var(--muted);}.aq-sm{font-size:var(--fs-sm);}.aq-xs{font-size:var(--fs-xs);}
.aq-big{font-size:var(--fs-2xl);font-weight:600;line-height:1.1;font-variant-numeric:tabular-nums;}
.aq-big--md{font-size:24px;}
.aq-bigrow{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--sp-8);}
.aq-bigrow a{color:inherit;text-decoration:none;}
.aq-row{display:flex;align-items:center;gap:var(--sp-2);flex-wrap:wrap;}
.aq-sp{flex:1 1 auto;}
.aq-ml{margin-left:var(--sp-2);}
.aq-pad{padding:var(--sp-3) var(--sp-4);}
.aq-gap{margin-bottom:var(--sp-3);}.aq-gap-t{margin-top:var(--sp-3);}
.aq-lbl{font-size:var(--fs-xs);font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:var(--sp-2) 0;}
.aq-stack{display:flex;flex-direction:column;gap:var(--sp-4);min-width:0;}
.aq-stack--tight{gap:var(--sp-3);}
.aq-tools{display:flex;align-items:center;gap:var(--sp-3);flex-wrap:wrap;margin-bottom:var(--sp-3);}
.aq-g3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--sp-4);}
.aq-g4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--sp-4);margin-bottom:var(--sp-4);}
.aq-gm{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:var(--sp-4);align-items:start;}
.aq-gm--side{grid-template-columns:minmax(0,1fr) 420px;}
@media (max-width:1100px){.aq-gm,.aq-gm--side{grid-template-columns:minmax(0,1fr);}.aq-g4{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:700px){.aq-g3,.aq-g4{grid-template-columns:minmax(0,1fr);}}
.aq-card p{margin:var(--sp-2) 0 var(--sp-3);font-size:var(--fs-sm);}
.aq-stk{display:flex;height:10px;border-radius:var(--r-full);overflow:hidden;background:var(--surface-3);gap:1px;}
.aq-stk i{display:block;min-width:2px;}
.aq-stk--lg{height:18px;margin-top:var(--sp-4);}
.aq-stk--sm{height:8px;margin:var(--sp-1) 0;}
.aq-legend{display:flex;flex-wrap:wrap;gap:var(--sp-4);font-size:var(--fs-sm);color:var(--ink-2);margin-top:var(--sp-3);}
.aq-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:middle;}
.aq-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:600;
  background:var(--surface-3);color:var(--ink-2);border:1px solid var(--line);text-decoration:none;white-space:nowrap;}
.aq-pill--need{background:var(--warn-soft);color:var(--warn);border-color:var(--warn-line);}
.aq-pill--fix{background:var(--info-soft);color:var(--info);border-color:var(--info-line);}
.aq-pill--bad{background:var(--danger-soft);color:var(--danger);border-color:var(--danger-line);}
.aq-pill--ok{background:var(--success-soft);color:var(--success);border-color:var(--success-line);}
.aq-pill--ear{background:var(--ai-soft);color:var(--ai);border-color:var(--ai-line);}
.aq-acts{display:flex;gap:var(--sp-2);justify-content:flex-end;flex-wrap:wrap;}
.aq-working{padding-bottom:var(--sp-3);border-bottom:1px solid var(--line);margin-bottom:var(--sp-3);}
.aq-auto{margin:var(--sp-3) 0;align-items:flex-start;flex-wrap:nowrap;}
.aq-cells{display:flex;flex-wrap:wrap;gap:3px;margin-top:var(--sp-2);}
.aq-cell{width:16px;height:16px;border-radius:3px;border:0;padding:0;cursor:pointer;}
.aq-cell:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}
.aq-cell.is-sel{outline:2px solid var(--ink);outline-offset:2px;}
.aq-tl{position:relative;padding-left:22px;display:flex;flex-direction:column;gap:var(--sp-3);margin-top:var(--sp-4);}
.aq-tl::before{content:"";position:absolute;left:5px;top:6px;bottom:6px;width:2px;background:var(--line);}
.aq-tl__e{position:relative;}
.aq-tl__e::before{content:"";position:absolute;left:-22px;top:4px;width:12px;height:12px;border-radius:50%;background:var(--surface);border:2px solid var(--line-strong);}
.aq-tl--ok::before{background:var(--v-clean);border-color:var(--v-clean);}
.aq-tl--need::before{background:var(--v-flag);border-color:var(--v-flag);}
.aq-tl--fix::before{background:var(--v-fixed);border-color:var(--v-fixed);}
.aq-tl--ear::before{background:var(--v-person);border-color:var(--v-person);}
.aq-where{border:1px solid var(--line);border-radius:var(--r-sm);margin:var(--sp-3) 0;}
.aq-newrun{border-color:var(--v-flag);}
.aq-why{margin-bottom:var(--sp-3);}
.aq-ladder{display:flex;flex-direction:column;gap:var(--sp-3);}
.aq-ladder .aq-row{flex-wrap:nowrap;align-items:flex-start;}

/* Audio quality: story links read as text, the Stories filters, and "How this tab works" (2026-11-19). */
.aq a.aq-link{color:inherit;text-decoration:none;font-weight:600;}
.aq a.aq-link:hover,.aq a.aq-link:focus-visible{text-decoration:none;color:var(--ink);}
.aq-filters{display:flex;flex-direction:column;gap:var(--sp-2);margin-bottom:var(--sp-3);}
.aq-filter{display:flex;align-items:center;gap:var(--sp-3);flex-wrap:wrap;}
.aq-filter .aq-lbl{margin:0;min-width:48px;}
/* "How this tab works" (AqHowItWorks): full content width like the cards below it. */
.aq-how{margin-bottom:var(--sp-4);width:100%;}
.aq-how .aq-how__panel{width:100%;}
.aq-how .aq-how__panel>.body{padding:0 var(--sp-4) var(--sp-4);}
.aq-how__sec{margin:var(--sp-5) 0 0;}
.aq-how__sec:first-child{margin-top:var(--sp-2);}
.aq-how__sec h4{display:flex;align-items:center;gap:var(--sp-2);font-size:var(--fs-lg);margin:0 0 var(--sp-3);color:var(--ink);}
.aq-how__sec p,.aq-how__sec li{font-size:var(--fs-sm);color:var(--ink-2);line-height:1.55;}
.aq-how__sec p{margin:0 0 var(--sp-2);}
.aq-how__sec ul{margin:0 0 var(--sp-2);padding-left:var(--sp-5);}
.aq-how__foot{margin-top:var(--sp-3) !important;}
.aq-how__table td{font-size:var(--fs-sm);vertical-align:top;}
.aq-how__table td:first-child{white-space:nowrap;width:1%;padding-right:var(--sp-4);}

/* Diagrams: rows of state-coloured boxes joined by arrows (the approved design's "One chunk's life" board). */
.aq-dg{display:flex;flex-direction:column;gap:var(--sp-3);}
.aq-dg__row{display:flex;align-items:stretch;gap:var(--sp-2);padding:var(--sp-3);border-radius:var(--r-md);background:var(--surface-2);}
.aq-dg__row:has(>.aq-dg__fork)>.aq-dg__box{align-self:center;}
.aq-dg__row>.aq-dg__box{flex:1 1 0;min-width:0;}
.aq-dg__fork{flex:1.5 1 0;min-width:0;display:flex;flex-direction:column;gap:var(--sp-2);}
.aq-dg__row--even{flex-wrap:wrap;}
.aq-dg__row--even>.aq-dg__box{flex:1 1 170px;}
.aq-dg__box{border:1px solid var(--line-strong);border-radius:var(--r-sm);background:var(--surface);padding:10px 12px;}
.aq-dg__t{display:flex;align-items:center;gap:6px;font-weight:600;font-size:var(--fs-md);color:var(--ink);line-height:1.3;}
.aq-dg__t svg{flex:none;}
.aq-dg__s{font-size:var(--fs-sm);color:var(--muted);margin-top:3px;line-height:1.4;}
.aq-dg__box--clean{border-color:var(--success-line);background:var(--success-soft);} .aq-dg__box--clean .aq-dg__t{color:var(--success);}
.aq-dg__box--ear{border-color:var(--ai-line);background:var(--ai-soft);} .aq-dg__box--ear .aq-dg__t{color:var(--ai);}
.aq-dg__box--fixed{border-color:var(--info-line);background:var(--info-soft);} .aq-dg__box--fixed .aq-dg__t{color:var(--info);}
.aq-dg__box--prog{border-color:var(--line-strong);background:var(--surface-2);} .aq-dg__box--prog .aq-dg__t{color:var(--ink-2);}
.aq-dg__box--need{border-color:var(--warn-line);background:var(--warn-soft);} .aq-dg__box--need .aq-dg__t{color:var(--warn);}
.aq-dg__box--bad{border-color:var(--danger-line);background:var(--danger-soft);} .aq-dg__box--bad .aq-dg__t{color:var(--danger);}
.aq-dg__arrow{flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--subtle);width:32px;}
.aq-dg__arrow--l{width:auto;min-width:32px;padding:0 var(--sp-1);}
.aq-dg__al{font-size:var(--fs-sm);color:var(--muted);text-align:center;line-height:1.2;white-space:nowrap;}
.aq-dg__next{display:flex;align-items:center;justify-content:center;gap:var(--sp-2);color:var(--ink-2);font-size:var(--fs-sm);font-weight:600;}
.aq-dg__arrow svg,.aq-dg__next svg{width:20px;height:20px;}
.aq-dg__arrow{color:var(--muted) !important;}
@media (max-width:760px){
  .aq-dg__row{flex-direction:column;}
  .aq-dg__row>.aq-dg__box,.aq-dg__fork,.aq-dg__row--even>.aq-dg__box{flex:none;}
  .aq-dg__arrow{flex-direction:row;max-width:none;min-height:24px;gap:var(--sp-2);}
  .aq-dg__arrow svg{transform:rotate(90deg);}
  .aq-how__table tr{display:block;padding:var(--sp-2) 0;border-bottom:1px solid var(--line);}
  .aq-how__table td{display:block;width:auto !important;height:auto !important;min-height:0 !important;padding:0 !important;border:0 !important;line-height:1.45;}
  .aq-how__table td:first-child{white-space:normal;margin-bottom:2px;}
  .aq-dg__arrow--l{padding:0;}
  .aq-dg__row:has(>.aq-dg__fork)>.aq-dg__box{align-self:stretch;}
  .aq-dg__arrow{width:auto;justify-content:center;}

}/* A segment row never wraps (manage rule); on a phone it scrolls sideways inside the page instead of widening it. */
@media (max-width:760px){.aq .aq-tools>.m-seg{max-width:100%;overflow-x:auto;flex-wrap:nowrap;}}

/* Story names in lists: the title column keeps a readable width (a narrow screen scrolls the table in its own box,
   m-tablewrap), the number never parts from the title (no-break space in StoryName), and the chunk's details sit on
   their own line below. */
.aq .aq-chunkcol{min-width:300px;}
.aq a.aq-story{display:block;line-height:1.35;overflow-wrap:normal;}
.aq-meta{font-size:var(--fs-xs);color:var(--muted);margin-top:2px;line-height:1.35;}
.aq .m-table td.actions{white-space:nowrap;}
.aq-filters--page{margin-bottom:var(--sp-4);}
.aq-filter--wide{min-width:0;}
.aq-filter--wide .m-dd{max-width:420px;}
.aq-storypick{width:340px;max-width:100%;}
.aq-g2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-4);}
@media (max-width:900px){.aq-g2{grid-template-columns:minmax(0,1fr);}}
@media (max-width:760px){.aq .aq-chunkcol{min-width:240px;}.aq-storypick{width:100%;}}
