/* QR → full sheet → deliberate result confirmation. */
#t-scan .scan-journey { display:flex; gap:12px; list-style:none; padding:0 0 16px; margin:0 0 20px; border-bottom:1px solid var(--border); }
.scan-journey li { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; }
.scan-journey li > span { display:grid; place-items:center; width:23px; height:23px; border-radius:50%; background:var(--raised); border:1px solid var(--control); font-variant-numeric:tabular-nums; }
.scan-journey li[aria-current=step] { color:var(--ink); font-weight:500; }
.scan-journey li[aria-current=step] > span { background:var(--ink); border-color:var(--ink); color:var(--surface); }
.scan-journey li.done > span { background:var(--ok-soft); color:var(--ok); border-color:var(--ok-soft); }
#t-scan.has-scan #scanStart { display:none; }
#t-scan:has(#qrPanel:not([hidden])) :is(#scanStart,#scanRes,#scanWithoutQr,#scanDrafts) { display:none; }
.workspace-sheet:has(#qrPanel:not([hidden])) #pageDescription { display:none; }
#t-scan #qrOpen { min-height:42px; }
#scanQrEntry { width:min(100%,300px); }
#scanQrEntry > button { width:100%; }
#t-scan .upload-area { min-height:260px; padding:28px; }
#t-scan .upload-area h2 { font-size:21px; }
#t-scan #scanHint { max-width:50ch; margin-bottom:18px; }
#t-scan .scan-photo-options { margin-top:14px; width:min(100%,440px); }
#t-scan .scan-photo-options > summary { cursor:pointer; font-size:13px; padding:9px; min-height:40px; }
#t-scan .scan-photo-options p { margin:8px 0 12px; font-size:12px; }
#t-scan .scan-photo-options .upload-actions { width:100%; max-width:none; flex-direction:row; flex-wrap:wrap; }
#t-scan .upload-caption { margin-top:12px; }
#qrPanel { margin:0; border:1px solid var(--border); background:var(--surface); padding:18px; }
#qrPanel .qr-panel-heading { margin-bottom:12px; }
#qrPanel [data-qr-status] { font-size:13px; line-height:1.6; margin-bottom:14px; }
#qrPanel[aria-busy=true] [data-qr-status]::before { content:''; display:inline-block; width:13px; height:13px; border:2px solid var(--control); border-right-color:var(--ink); border-radius:50%; vertical-align:-2px; margin-right:8px; animation:spin .7s linear infinite; }
#qrPanel .qr-card-details { padding:0; margin:0 0 12px; }
#qrPanel .qr-card-details strong { font-size:16px; font-weight:500; }
#qrPanel .qr-card-details > p { margin-top:4px; font-size:12px; }
#qrPanel .qr-preview { width:100%; max-width:520px; max-height:48dvh; border-radius:8px; margin:0 auto 14px; }
#qrPanel .qr-actions { gap:8px; }
#qrPanel .qr-actions .text-button { margin-left:auto; }
#scanSecondaryActions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; flex-basis:100%; }
#scanSecondaryActions > div { display:contents; }
#scanSecondaryActions > button { flex:1; }
#t-scan #scanSecondaryActions #qrOpen { min-height:38px; }
#scanActionError { flex-basis:100%; margin:0; line-height:1.6; }
#scanActionError:empty { display:none; }
#t-scan .scan-next-photo { flex-basis:100%; font-size:12px; margin-top:4px; }
#t-scan .scan-next-photo > summary { cursor:pointer; min-height:36px; padding-block:8px; }
#t-scan .scan-next-photo > .btn { margin-top:6px; }
#t-scan .score-table { border:0; margin-top:14px; }
#scanSubjects > summary { display:none; }
#t-scan .scan-completion { padding:24px; background:var(--raised); border:1px solid var(--border); border-radius:10px; outline:none; }
#scanCompletion h2 { font-size:22px; margin:14px 0 12px; }
#scanDonePerson { font-size:16px; font-weight:500; line-height:1.5; margin-bottom:4px; }
#scanDoneExam { font-size:13px; margin-bottom:16px; }
#scanDoneScore { font-size:34px; font-weight:500; font-variant-numeric:tabular-nums; line-height:1.3; margin:14px 0; }
#scanDoneScore:empty { display:none; }
#scanDoneNote { font-size:13px; line-height:1.6; max-width:65ch; margin-bottom:20px; }
#scanCompletedQrHost { margin-bottom:12px; }
#scanCompletedQrHost > button { min-width:240px; }
#scanRes.is-complete > :is(.scan-result-header,.scan-result-grid) { display:none; }
#scanRes.is-complete.show-completed-details > .scan-result-header { display:flex; margin-top:24px; }
#scanRes.is-complete.show-completed-details > .scan-result-grid { display:grid; }
@media(max-width:760px), (max-width:1000px) and (max-height:500px) and (pointer:coarse) {
  #t-scan .scan-journey { gap:8px; justify-content:space-between; padding-bottom:12px; margin-bottom:16px; }
  .scan-journey li { gap:5px; font-size:11px; }
  .scan-journey li > span { width:21px; height:21px; flex:none; }
  #t-scan .upload-area { min-height:250px; padding:24px 16px; }
  #t-scan .upload-area h2 { font-size:19px; }
  #t-scan .scan-photo-options .upload-actions { display:grid; grid-template-columns:1fr; }
  #t-scan .scan-photo-options .upload-actions > .btn { width:100%; }
  #t-scan .upload-caption { display:none; }
  #qrPanel { padding:14px; }
  #qrPanel .qr-panel-heading h3 { font-size:17px; }
  #qrPanel .qr-preview { max-height:44dvh; }
  #qrPanel .qr-actions { align-items:stretch; }
  #qrPanel .qr-actions > :is(button,.btn) { min-height:40px; font-size:12px; }
  #qrPanel .qr-actions [data-qr-capture] { flex-basis:100%; }
  #scanSubjects { border-block:1px solid var(--border); }
  #scanSubjects > summary { display:list-item; min-height:40px; padding:10px 0; cursor:pointer; font-size:12px; font-weight:500; }
  #t-scan .scan-completion { padding:20px 16px; }
  #scanCompletion h2 { font-size:20px; }
  #scanDoneScore { font-size:30px; }
  #scanCompletedQrHost > button { width:100%; min-width:0; }
  #scanSecondaryActions { gap:8px; }
  #scanSecondaryActions > button { flex:1 1 130px; font-size:12px; }
  #t-scan .scan-save-actions { padding-block:12px; }
}
@media(max-width:359px) { .scan-journey li { font-size:11px; gap:4px; }.scan-journey li > span { width:19px; height:19px; } }
@media(prefers-reduced-motion:reduce) { #qrPanel[aria-busy=true] [data-qr-status]::before { animation:none; } }
