:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f5f5f5; background: #101112; font-synthesis: none; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input { font: inherit; }
button, label[for] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .35; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #c6defa; outline-offset: 4px; }
::selection { color: #101112; background: #c6defa; }
[hidden] { display: none !important; }
.app { display: grid; grid-template-rows: auto minmax(0, 1fr); width: 100%; height: 100vh; height: 100dvh; max-width: 900px; margin: 0 auto; padding: max(8px, env(safe-area-inset-top)) 20px max(8px, env(safe-area-inset-bottom)); }
.header { display: flex; align-items: center; justify-content: space-between; min-height: 42px; gap: 16px; }
.brand { font-size: .9375rem; font-weight: 600; letter-spacing: -.015em; }
.header .brand { display: flex; align-items: center; min-height: 44px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.help-button { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #f5f5f5; font-size: .8125rem; }
.help-button:hover { color: #c6defa; }
.sheet-link { display: flex; align-items: center; min-height: 44px; color: #b9babc; font-size: .8125rem; }
.sheet-link:hover { color: #fff; }
.capture { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; gap: 14px; }
.heading { padding: 5px 0 2px; }
.heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#step-label { color: #b9babc; font-size: .8125rem; white-space: nowrap; }
#instruction { margin: 5px 0 0; color: #b9babc; font-size: .8125rem; line-height: 1.4; }
#instruction:empty, #status:empty { display: none; }
.stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; border-radius: 4px; background: #050506; }
.empty { max-width: 260px; padding: 20px; color: #b9babc; font-size: .875rem; text-align: center; line-height: 1.5; }
.camera-frame { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
.camera-frame video { display: block; width: 100%; height: auto; }
.camera-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#review-canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; touch-action: none; }
#result-svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; padding: 16px; }
#result-photo { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.review-switch { display: inline-flex; justify-self: center; gap: 2px; padding: 3px; border: 1px solid #ffffff1f; border-radius: 99px; background: #ffffff0a; }
.review-switch button { min-width: 88px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 99px; color: #b9babc; background: transparent; font-size: .8125rem; font-weight: 500; }
.review-switch button[aria-pressed="true"] { color: #fff; background: linear-gradient(165deg, #ffffff26, #ffffff12); box-shadow: 0 2px 5px #0003; }
.review-switch button:hover { color: #fff; }
#result-path, #left-path, #right-path { fill: none; stroke: #e5eaf2; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.dimension-line { fill: none; stroke: #9098a5; stroke-width: .75; }
.dimension-label { fill: #e0e5ec; font-size: 11px; font-variant-numeric: tabular-nums; }
.photo-import { position: absolute; bottom: 14px; left: 14px; z-index: 4; display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; border: 1px solid #5a5b5d; border-radius: 6px; color: #fff; background: #17181bea; font-size: .8125rem; }
.photo-import input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#camera-retry { position: absolute; bottom: 14px; right: 14px; z-index: 4; min-height: 44px; padding: 0 14px; border: 0; border-radius: 6px; color: #111; background: #fff; font-size: .8125rem; font-weight: 600; }
.action-area { display: grid; gap: 8px; padding-bottom: 5px; }
#status { min-height: 2.7em; max-height: 4.2em; margin: 0; color: #b9babc; font-size: .75rem; line-height: 1.35; text-align: center; overflow: hidden; }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 74px; }
body[data-phase="live"] .controls, body[data-phase="starting"] .controls, body[data-phase="idle"] .controls { display: none; }
.primary { min-height: 48px; padding: 0 30px; border: 0; border-radius: 6px; background: #f5f5f5; color: #101112; font-size: .9375rem; font-weight: 600; transition: opacity .16s ease-out; }
.primary:not(:disabled):active { background: #d7d8da; }
.primary.shutter { flex: none; width: 72px; height: 72px; min-height: 72px; padding: 4px; border: 2px solid #f5f5f5; border-radius: 50%; background: transparent; }
.shutter-core { display: block; width: 100%; height: 100%; border-radius: 50%; background: #f5f5f5; transition: transform .16s ease-out; }
.primary.shutter:not(:disabled):active .shutter-core { transform: scale(.91); }
.secondary, .lens-caption button { min-width: 64px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #ddd; font-size: .875rem; }
.secondary:hover, .lens-caption button:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
#aim-overlay { position: absolute; z-index: 3; overflow: visible; pointer-events: none; }
#aim-crosshair { position: absolute; width: 18px; height: 18px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 8px #0009; }
#aim-crosshair::before, #aim-crosshair::after { position: absolute; content: ""; background: #c6defa; }
#aim-crosshair::before { top: -5px; left: 7px; width: 1px; height: 24px; }
#aim-crosshair::after { top: 7px; left: -5px; width: 24px; height: 1px; }
#aim-loupe { position: absolute; width: 112px; height: 112px; overflow: hidden; border: 3px solid #fff; border-radius: 50%; background: #fff; box-shadow: 0 10px 28px #0009; }
#aim-loupe canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.torch-toggle { position:absolute; z-index:4; right:14px; bottom:14px; min-height:48px; display:flex; align-items:center; gap:7px; padding:0 16px; border:1px solid #ffffff45; border-radius:999px; color:#fff; background:linear-gradient(145deg,#ffffff38,#ffffff12),#25282b80; -webkit-backdrop-filter:blur(20px); backdrop-filter:blur(20px); box-shadow:inset 0 1px 1px #ffffff30,0 3px 12px #0003; font:inherit; font-size:.875rem; touch-action:manipulation; }
.torch-toggle[aria-pressed="true"] { color:#101112; background:#f5f6f8e8; }
.torch-toggle:disabled { opacity:.7; }
.torch-toggle:focus-visible { outline:2px solid #fff; outline-offset:3px; }
.torch-note { position:absolute; z-index:4; bottom:72px; right:14px; left:14px; width:fit-content; max-width:calc(100% - 28px); margin-left:auto; border-radius:10px; background:#16181be6; color:#eee; padding:7px 10px; font-size:.75rem; }
@media (prefers-reduced-transparency:reduce) { .torch-toggle { background:#303338; -webkit-backdrop-filter:none; backdrop-filter:none; } }
#pair-results { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); padding: 0 18px; }
.lens-result { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 10px 0; }
.lens-result + .lens-result { border-top: 1px solid #313235; }
.lens-caption { display: flex; justify-content: space-between; align-items: center; font-size: .875rem; }
.lens-caption button { font-size: .75rem; color: #b9babc; }
.lens-result svg { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
body[data-phase="pair"] .primary, body[data-phase="result"] .primary { flex: 1; max-width: 360px; }
@media (min-width: 650px) { #pair-results { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 24px; } .lens-result + .lens-result { border-top: 0; } }
@media (max-height: 640px) { .app { padding-top: 0; padding-bottom: 4px; } .header { min-height: 36px; } .capture { gap: 7px; } h1 { font-size: 1.125rem; } #instruction { font-size: .75rem; } .controls { min-height: 58px; } .primary.shutter { width: 56px; height: 56px; min-height: 56px; } #status { min-height: 1.4em; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
