:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: #17281f; background: #f4f5ef; font-synthesis: none; --accent: #244f3d; --muted: #737b72; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, label, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #568469; outline-offset: 4px; }
a { color: inherit; text-underline-offset: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.setup { max-width: 460px; min-height: 100svh; margin: auto; padding: max(24px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) 0 max(26px, env(safe-area-inset-left)); display: flex; flex-direction: column; animation: enter .25s ease-out; }
.brand { padding: 4px 0 24px; }
h1 { margin: 0; font-size: 22px; line-height: 1.4; letter-spacing: -.5px; font-weight: 600; }
.prepare { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 18px 0 32px; }
.target-figure { margin: 0; overflow: hidden; border-radius: 6px; }
.target-figure img { display: block; width: 100%; max-height: 40svh; object-fit: contain; }
.button { min-height: 48px; border: 0; border-radius: 10px; padding: 12px 17px; font-size: 14px; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 14px; text-decoration: none; transition: background .15s, transform .15s; }
.button:active:not(:disabled) { transform: scale(.98); }
.secondary { color: #284735; background: #e6e9e0; flex-shrink: 0; }
.primary { color: #fff; background: var(--accent); }
.target-actions { display: flex; gap: 18px; align-items: center; min-height: 52px; font-size: 13px; color: var(--accent); }
.target-actions a { margin-left: auto; padding: 16px 0; text-decoration: none; }
.text-button { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 0; background: none; border: 0; font-size: 13px; color: inherit; cursor: pointer; }
.target-actions:has(input:focus-visible) label { outline: 3px solid #568469; outline-offset: 3px; }
.instruction { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.start-area { margin-top: auto; position: sticky; bottom: 0; padding: 15px 0 max(14px, env(safe-area-inset-bottom)); background: #f4f5ef; }
.start-area .primary { width: 100%; min-height: 54px; padding: 0 22px; font-size: 16px; }
.start-area p { text-align: center; color: #7d857a; font-size: 10px; margin: 12px 0 0; }
.message { padding: 12px; background: #ebe7db; border-radius: 6px; font-size: 13px; line-height: 1.6; }
body:not([data-view="setup"]) { overflow: hidden; background: #111914; }
.experience { position: fixed; inset: 0; height: 100dvh; background: #111914; color: #fff; }
#video, #ar-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; object-position: center; }
#ar-canvas { pointer-events: none; }
.camera-header { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 12px; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left)); }
.glass { background: #14201bb8; color: #fff; border: 1px solid #ffffff22; }
.icon-button { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0; font-size: 29px; line-height: 1; flex-shrink: 0; }
.settings-button { font-size: 20px; letter-spacing: 2px; grid-column: 3; }
.tracking-status { min-height: 40px; justify-self: center; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 30px; padding: 8px 14px; font-size: 12px; }
.tracking-status i { width: 6px; height: 6px; border-radius: 50%; background: #d1d8d1; }
.tracking-status[data-tracked="true"] { background: #244f3de8; }
.tracking-status[data-tracked="true"] i { background: #bde0a9; box-shadow: 0 0 0 4px #bde0a91a; }
.camera-footer { position: absolute; z-index: 3; bottom: 0; left: 0; right: 0; padding: 20px max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); display: flex; justify-content: center; }
.pause-button { background: #14201bd9; color: #fff; border: 1px solid #ffffff30; border-radius: 28px; min-height: 48px; min-width: 112px; font-size: 14px; }
.session-overlay { position: absolute; inset: 0; z-index: 2; background: #111914f5; display: grid; place-items: center; padding: 80px 35px; text-align: center; }
.session-copy { max-width: 310px; animation: enter .2s ease-out; }
.session-copy h2 { font-size: 23px; font-weight: 550; margin: 22px 0 12px; }
.session-copy p { font-size: 14px; line-height: 1.7; color: #a7b5aa; }
.session-copy .primary { background: #c0dfad; color: #173524; min-width: 180px; margin-top: 20px; }
.spinner { width: 32px; height: 32px; border: 2px solid #46554b; border-top-color: #c0dfad; border-radius: 50%; margin: auto; animation: spin .8s linear infinite; }
.settings-sheet { border: 0; width: min(100%, 520px); max-height: min(85dvh, 740px); padding: 10px 24px max(24px, env(safe-area-inset-bottom)); margin: auto auto 0; border-radius: 22px 22px 0 0; color: #17281f; background: #f4f5ef; }
.settings-sheet[open] { animation: sheet-in .22s ease-out; }
.settings-sheet::backdrop { background: #03100b70; }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto 8px; border-radius: 5px; background: #c8d0c5; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; }
.sheet-header h2 { font-size: 20px; font-weight: 600; margin: 14px 0; }
.sheet-header .icon-button { background: transparent; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; border-bottom: 1px solid #dbe1d7; }
.setting-row strong { display: block; font-size: 15px; font-weight: 550; }
.setting-row small { display: block; margin-top: 6px; color: #778171; font-size: 11px; }
input[role="switch"] { appearance: none; width: 46px; height: 28px; border-radius: 20px; background: #bcc5b7; position: relative; margin: 0; transition: background .15s; flex-shrink: 0; }
input[role="switch"]::after { content: ''; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
input[role="switch"]:checked { background: var(--accent); }
input[role="switch"]:checked::after { transform: translateX(18px); }
details summary { padding: 20px 0; font-size: 14px; cursor: pointer; }
details summary span { float: right; color: #8a9383; font-size: 11px; }
.diagnostic-note, .sheet-note { font-size: 11px; line-height: 1.7; color: #7c8675; }
.sheet-note { margin-top: 10px; }
.field-label { font-size: 12px; margin-bottom: 7px; display: block; }
select { width: 100%; padding: 12px; border: 1px solid #cdd5c7; border-radius: 7px; color: inherit; background: transparent; font-size: 16px; }
.diagnostic-actions { display: flex; gap: 10px; margin: 12px 0; }
.diagnostic-actions .button { flex: 1; padding: 10px; font-size: 12px; }
#diagnostic-summary { display: block; white-space: pre-line; font-size: 12px; line-height: 1.7; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@media (min-width: 700px) { .setup { padding-top: 36px; } }
@media (max-height: 730px) and (orientation: portrait) { .setup { padding-top: max(18px, env(safe-area-inset-top)); } .brand { padding-bottom: 12px; } .prepare { padding: 12px 0 20px; } }
@media (orientation: landscape) and (max-height: 600px) { .camera-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); } .camera-header { padding-top: max(10px, env(safe-area-inset-top)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
