.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.detection-flow { max-width: 580px; margin: 0 auto; }
.flow-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 44px; margin: -8px 0 22px; color: #596574; font-size: 13px; }
.flow-nav>span:nth-child(2) { color: var(--ink, #1c3027); font-weight: 500; }
.flow-step { justify-self: end; color: #8b94a0; font-size: 12px; }
.flow-step b { color: var(--brand, #18583f); font-weight: 500; }
.flow-back { justify-self: start; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: 0; color: #556576; margin-left: -12px; }
.flow-back svg { width: 20px; height: 20px; }
.detection-flow fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.flow-intro { margin-bottom: 26px; }
.flow-intro h1 { font-size: 29px; line-height: 1.4; letter-spacing: -.4px; font-weight: 650; }
.flow-intro p { font-size: 13px; color: #7b8490; margin-top: 9px; }
.reason-list { display: grid; gap: 12px; }
.reason-option { display: flex; align-items: center; gap: 16px; text-align: left; min-height: 90px; padding: 18px; border: 1px solid #e3e7ed; border-radius: 17px; background: white; color: var(--text); }
.reason-option>span:nth-child(2) { flex: 1; }
.reason-option strong { display: block; font-size: 16px; font-weight: 550; }
.reason-option small { display: block; font-size: 12px; color: #7a8492; margin-top: 6px; }
.reason-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--surface-muted, #eff5f0); display: grid; place-items: center; color: #62758a; flex-shrink: 0; }
.reason-icon svg { width: 24px; height: 24px; }
.reason-check { border: 1px solid #d4dce7; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.reason-check svg { width: 14px; height: 14px; visibility: hidden; }
.reason-option.selected { border-color: #94b7a4; background: var(--surface-muted, #eff5f0); box-shadow: 0 0 0 1px #b4d1bd50; }
.reason-option.selected .reason-icon { color: var(--brand, #18583f); background: var(--surface-muted, #eff5f0); }
.reason-option.selected .reason-check { background: var(--brand, #18583f); border-color: var(--brand, #18583f); color: white; }
.reason-option.selected .reason-check svg { visibility: visible; }
.optional-note { border: 0; margin: 17px 0 0; padding: 0; }
.optional-note summary { color: #607083; display: flex; align-items: center; min-height: 48px; list-style: none; font-size: 13px; }
.optional-note summary span { color: #939ca8; font-size: 11px; margin-left: 8px; }
.optional-note summary::after { content: '+'; font-size: 20px; margin-left: auto; font-weight: 300; }
.optional-note[open] summary::after { content: '−'; }
.optional-note textarea { min-height: 110px; background: white; }
.identity-fields, .existing-pick { padding: 22px; border: 1px solid #e4e8ee; border-radius: 17px; background: white; }
.existing-pick { margin-bottom: 14px; }
.detection-flow label:not(.check-row,.identity-consent,.file-choice,.sr-only) { display: block; font-size: 13px; font-weight: 500; color: #536171; margin: 20px 0 8px; }
.detection-flow label:first-child { margin-top: 0; }
.detection-flow input:not([type=checkbox]), .detection-flow select, .detection-flow textarea { border-color: #dce2e9; border-radius: 10px; font-size: 15px; min-height: 48px; padding: 12px; }
.detection-flow input[aria-invalid=true] { border-color: #b65348; }
.field-hint { color: #838d98; font-size: 12px; margin-top: 10px; }
.flow-preview { display: flex; align-items: center; gap: 10px; margin-top: 22px; color: #788697; font-size: 12px; padding: 0 4px; }
.flow-preview svg { width: 17px; height: 17px; }
.flow-dock { margin-top: 28px; }
.flow-dock>div { display: flex; gap: 10px; align-items: center; justify-content: center; }
.flow-dock .primary { width: 100%; min-height: 50px; border-radius: 13px; font-size: 15px; }
.flow-later { display: flex; align-items: center; justify-content: center; min-height: 48px; font-size: 13px; color: #6c7c8e; }
.flow-error { color: #a14535; background: #fff3ee; border-radius: 10px; padding: 13px 15px; font-size: 13px; margin: 14px 0; overflow-wrap: anywhere; }
.upload-identity { display: flex; align-items: center; gap: 12px; padding: 16px 0; margin: -6px 0 22px; border-top: 1px solid #e3e7ed; border-bottom: 1px solid #e3e7ed; }
.upload-identity>svg { width: 23px; height: 23px; color: #687b90; }
.upload-identity>div { flex: 1; min-width: 0; }
.upload-identity strong { font-size: 14px; font-weight: 550; display: block; overflow-wrap: anywhere; }
.upload-identity small { font-size: 11px; color: #7d8997; display: block; margin-top: 4px; overflow-wrap: anywhere; }
.upload-identity>span { font-size: 10px; color: #8c97a5; }
.file-choice { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px; border: 1px solid #cedfd3; border-radius: 20px; background: var(--surface-muted, #eff5f0); cursor: pointer; }
.file-choice>span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--surface-muted, #eff5f0); color: var(--brand, #18583f); margin-bottom: 3px; }
.file-choice svg { width: 26px; height: 26px; }
.file-choice strong { font-weight: 550; font-size: 16px; color: var(--brand, #18583f); }
.file-choice small { color: #7d8da1; font-size: 11px; }
.file-choice:focus-within { outline: 3px solid #467b6180; outline-offset: 3px; }
.file-choice.drag-over { border-color: var(--brand, #18583f); outline: 2px solid var(--brand, #18583f); }
.upload-format { margin: 14px 0; border: 0; border-bottom: 1px solid #dce5de; padding: 0 0 10px; }
.upload-format summary { min-height: 44px; padding: 11px 0; color: var(--brand, #18583f); font-weight: 550; }
.upload-format p, .retest-note p { margin: 6px 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.upload-format .text-link, .retest-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand, #18583f); }
.retest-note { margin: 14px 0; padding: 16px 18px; border: 1px solid #e4d6b9; border-radius: 14px; background: #fff8eb; }
.file-choice .drop-hint { margin-top: -5px; }
@media (pointer:coarse) { .drop-hint { display: none; } }
.file-choice input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.upload-note { font-size: 11px; color: #88929f; text-align: center; margin: 16px 10px; }
#file-reading { min-height: 260px; text-align: center; padding: 40px 0; }
.flow-spinner { width: 34px; height: 34px; margin: 0 auto 22px; border: 3px solid #cedfd3; border-top-color: var(--brand, #18583f); border-radius: 50%; animation: spin 1s linear infinite; }
#file-reading h2 { font-size: 18px; }
#file-reading p { font-size: 13px; color: #8693a2; margin-top: 10px; }
.selected-file { display: flex; align-items: center; gap: 12px; padding: 15px; background: white; border: 1px solid #e5e9ee; border-radius: 14px; margin-bottom: 22px; }
.selected-file>span { width: 34px; height: 40px; border-radius: 9px; background: var(--surface-muted, #eff5f0); color: var(--brand, #18583f); display: grid; place-items: center; }
.selected-file>div { flex: 1; min-width: 0; }
.selected-file strong { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.selected-file small { display: block; font-size: 11px; color: #8591a0; margin-top: 5px; }
.selected-file button { min-width: 44px; min-height: 44px; justify-content: center; font-size: 12px; }
#record-pick { margin-top: 24px; }
#record-preview { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #e3e7ed; background: white; border-radius: 15px; padding: 18px; margin-top: 16px; }
#record-preview>div { display: flex; align-items: baseline; gap: 7px; }
#record-preview strong { font-size: 23px; font-weight: 550; color: var(--ink, #1c3027); }
#record-preview span { font-size: 11px; color: #8793a1; }
#record-preview p { grid-column: 1/-1; border-top: 1px solid #edf0f4; padding-top: 12px; margin-top: 14px; font-size: 12px; color: #6e7e91; line-height: 1.7; }
.selected-group { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 0; background: transparent; border: 0; color: #586d83; text-align: left; }
.selected-group>div { flex: 1; min-width: 0; }
.selected-group strong { font-size: 14px; color: var(--ink, #1c3027); font-weight: 550; display: block; margin-top: 5px; overflow-wrap: anywhere; }
.selected-group small { font-size: 11px; color: #8592a2; }
.selected-group>span:last-child { display: flex; align-items: center; font-size: 11px; }
.selected-group>span:last-child svg { width: 13px; height: 13px; }
.record-summary { color: #8994a1; font-size: 11px; margin: 0 0 18px 31px; }
.analysis-options { background: white; border: 1px solid #e3e7ed; border-radius: 16px; padding: 0 17px; }
.analysis-option-ready { display: flex; gap: 10px; align-items: center; padding: 18px 0; }
.analysis-option-ready>span { display: grid; place-items: center; width: 25px; height: 25px; background: var(--surface-muted, #eff5f0); color: var(--brand, #18583f); border-radius: 50%; }
.analysis-option-ready svg { width: 15px; height: 15px; }
.analysis-option-ready>div { flex: 1; }
.analysis-option-ready strong { display: block; font-size: 13px; font-weight: 550; }
.analysis-option-ready small { display: block; font-size: 10px; color: #8a95a2; margin-top: 4px; }
.analysis-option-ready em { font-style: normal; font-size: 10px; color: #6082a0; }
.analysis-options details { margin-top: 0; padding-top: 0; }
.analysis-options summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 53px; color: #586d82; list-style: none; font-size: 13px; }
.analysis-options summary::after { content: '+'; margin-left: auto; font-size: 18px; color: #8e9aa8; font-weight: 300; }
.analysis-options details[open]>summary::after { content: '−'; }
.analysis-options summary small { color: #8a95a2; font-size: 10px; margin-left: auto; }
.analysis-options summary small+* { margin-left: 0; }
.analysis-options .setting-hint { font-size: 11px; color: #8b96a4; margin: 0 0 12px; }
.analysis-options .check-row { font-size: 12px!important; line-height: 1.8; margin: 15px 0 12px!important; }
.analysis-options .check-row input { width: 19px; height: 19px; }
.analysis-options details[open] { padding-bottom: 8px; }
.identity-consent { display: flex; gap: 10px; align-items: flex-start; padding: 16px 2px; margin-top: 12px; color: #718094; font-size: 12px; line-height: 1.9; }
.identity-consent input { width: 20px; height: 20px; margin-top: 2px; }
.identity-consent strong { color: var(--ink, #1c3027); font-weight: 500; overflow-wrap: anywhere; }
.saved-record-notice { display: flex; align-items: center; gap: 10px; background: var(--surface-muted, #eff5f0); border-radius: 10px; color: #517092; padding: 15px; font-size: 13px; }
.record-picker-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; min-height: 52px; border: 1px solid #dce2e9; border-radius: 11px; background: white; color: #3f5873; font: inherit; font-size: 14px; text-align: left; }
.record-picker-button svg { width: 16px; height: 16px; color: #7e91a7; }
.record-picker-sheet { overflow: hidden; }
.group-search-box { padding: 14px 20px 0; }
.group-search-box input { background: var(--surface-muted, #eff5f0); }
.group-search-box p { margin: 9px 0; color: #8795a5; font-size: 11px; }
.group-options { padding: 0 20px 24px; max-height: 48dvh; overflow-y: auto; overscroll-behavior: contain; }
.group-option { border: 0; border-top: 1px solid var(--surface-muted, #eff5f0); background: white; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 16px 2px; color: var(--ink, #1c3027); text-align: left; }
.group-option>span { min-width: 0; }
.group-option strong { display: block; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.group-option small { display: block; color: #8c99a8; font-size: 11px; margin-top: 5px; }
.group-option svg { width: 17px; height: 17px; color: #8ba2bf; }
.group-option[aria-pressed=true] svg { color: var(--brand, #18583f); }
.group-empty { text-align: center; padding: 30px 10px; color: #7b8b9d; font-size: 13px; }
.analysis-target { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.analysis-target strong { font-size: 16px; font-weight: 550; }
.analysis-target>span { font-size: 11px; color: #8c98a6; overflow-wrap: anywhere; }
.analysis-progress { position: relative; width: 168px; height: 168px; margin: 28px auto 20px; }
.analysis-progress>svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.analysis-progress circle { fill: none; stroke-width: 5; }
.progress-ring-track { stroke: #cedfd3; }
.progress-ring-value { stroke: var(--brand, #18583f); stroke-linecap: round; transition: stroke-dasharray .3s; }
.analysis-progress>div { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.analysis-progress strong { font-size: 41px; font-weight: 500; line-height: 1.4; color: var(--ink, #1c3027); font-variant-numeric: tabular-nums; }
.analysis-progress strong small { font-size: 17px; margin-left: 3px; }
.analysis-progress>div>span { font-size: 11px; color: #8a97a6; }
.analysis-flow .analysis-stage { text-align: center; font-size: 20px; letter-spacing: 0; line-height: 1.5; }
.analysis-subtitle { color: #8a98a8; font-size: 12px; text-align: center; margin-top: 10px; }
.analysis-stages { list-style: none; padding: 14px 22px; margin: 26px 0 22px; border: 1px solid #e6eaf0; border-radius: 16px; background: white; }
.analysis-stages li { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: #9aa5b2; }
.analysis-stages li>span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #e3e7ed; border-radius: 50%; font-size: 10px; }
.analysis-stages li>span svg { width: 14px; height: 14px; }
.analysis-stages strong { font-size: 13px; font-weight: 400; }
.analysis-stages li.done { color: #6c889e; }
.analysis-stages li.active { color: var(--brand, #18583f); }
.analysis-stages li.active>span { background: var(--surface-muted, #eff5f0); border-color: #cedfd3; }
.analysis-stages li>i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand, #18583f); margin-left: auto; }
.analysis-leave { display: flex; background: transparent; border-color: #cedfd3; min-height: 48px; }
.analysis-persistence { font-size: 11px; text-align: center; margin-top: 12px; color: #97a0ac; }
.resume-flow { text-align: center; }
.resume-symbol { width: 66px; height: 66px; margin: 35px auto 22px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-muted, #eff5f0); color: var(--brand, #18583f); }
.resume-symbol svg { width: 29px; height: 29px; }
.resume-flow h1 { font-size: 26px; letter-spacing: 0; }
.resume-flow>p:not(.flow-error) { font-size: 12px; color: #8290a0; margin-top: 14px; overflow-wrap: anywhere; }
.resume-message { font-size: 13px; color: #6e7f93; line-height: 1.8; background: white; padding: 20px; border-radius: 14px; margin: 25px 0; }
.resume-flow>.primary { width: 100%; min-height: 50px; }
.resume-flow>.text-link { min-height: 50px; margin-top: 8px; }

@media(max-width:650px) {
 body:has(.new-detection,.upload-flow) .bottom-nav, body:has(.new-detection,.upload-flow) .app-footer { display: none; }
 .new-detection, .upload-flow { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
 .flow-nav { margin-bottom: 19px; font-size: 12px; }
 .flow-intro { margin-bottom: 23px; }
 .flow-intro h1 { font-size: 26px; }
 .flow-intro p { font-size: 12px; margin-top: 8px; }
 .reason-option { min-height: 84px; padding: 15px; gap: 13px; border-radius: 15px; }
 .reason-option strong { font-size: 15px; }
 .reason-option small { font-size: 11px; }
 .reason-icon { width: 41px; height: 43px; }
 .identity-fields, .existing-pick { padding: 19px; }
 .detection-flow input:not([type=checkbox]), .detection-flow select, .detection-flow textarea { font-size: 16px; }
 .flow-dock { position: fixed; bottom: 0; left: 0; right: 0; background: #ffffffed; border-top: 1px solid #e4e9ef; backdrop-filter: blur(18px); padding: 13px 18px max(16px,env(safe-area-inset-bottom)); margin: 0; z-index: 32; }
 .flow-dock>div { max-width: 580px; margin: auto; }
 .flow-dock .primary { min-height: 50px; font-size: 14px; border-radius: 13px; }
 .upload-identity { margin-bottom: 18px; padding: 14px 0; }
 .selected-file { padding: 12px; margin-bottom: 18px; }
 .selected-file strong { font-size: 12px; }
 .selected-file small { font-size: 10px; }
 .upload-flow:has(#record-confirm:not([hidden])) .selected-file { display: none; }
 .analysis-progress { width: 151px; height: 151px; margin: 23px auto 18px; }
 .analysis-progress strong { font-size: 36px; }
 .analysis-flow .analysis-stage { font-size: 18px; }
 .analysis-target { margin-top: 10px; }
 .analysis-stages { margin: 23px 0 19px; padding: 10px 18px; }
 .analysis-stages li { padding: 11px 0; }
}
@media(max-width:360px){.flow-intro h1 { font-size: 24px; }.reason-option { padding: 13px; gap: 11px; }.reason-option strong { font-size: 14px; }.reason-option small { font-size: 10px; }.identity-fields,.existing-pick { padding: 16px; }}
