:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #eef2f7; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100svh; background: radial-gradient(circle at top, #ffffff 0, #eef2f7 55%); }
.app-shell { min-height: 100svh; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.card { width: min(100%, 480px); padding: 18px 18px; border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 18px 55px rgba(30, 48, 80, .13); text-align: center; }
.brand { display: flex; justify-content: center; align-items: center; gap: 8px; color: #4965d3; font-weight: 700; letter-spacing: .02em; }
.brand-mark { font-size: 28px; line-height: 1; }
.connection-status { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 0; }
.connection-pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-pill-label { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.connection-pill strong { font-size: .74rem; font-weight: 800; }
.status-icon-svg, .status-icon-image { width: 16px; height: 16px; flex: 0 0 auto; }
.status-icon-svg { stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.status-icon-image { display: block; object-fit: contain; }
.status-state-online { color: #15803d; background: #d9efe4; }
.status-state-offline { color: #9f2f3d; background: #e8d2da; }
.status-state-checking { color: #b45309; background: #f6e8c8; }
.status-state-disabled { color: #475569; background: #e2e8f0; }
h1 { margin: 8px 0 4px; font-size: clamp(28px, 8vw, 40px); letter-spacing: -.04em; }
.title-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.app-version { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border-radius: 999px; background: #e9edff; color: #30427e; font-size: .64rem; font-weight: 800; letter-spacing: .1em; line-height: 1; white-space: nowrap; }
.intro { margin: 0 auto 14px; max-width: 32ch; color: #667085; line-height: 1.35; }
.token-label { display: block; margin: 0 0 4px; color: #667085; font-size: 13px; text-align: left; }
.token-input { width: 100%; min-height: 40px; margin-bottom: 8px; padding: 8px 10px; border: 1px solid #d5dbea; border-radius: 10px; font: inherit; }
.token-input:focus { outline: 3px solid #dce3ff; border-color: #4965d3; }
.button { width: 100%; min-height: 48px; border: 0; border-radius: 14px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; transition: transform .15s, opacity .15s, background .15s; }
.button:active { transform: scale(.98); }
.button:disabled { cursor: wait; opacity: .6; }
.button-primary { color: white; background: #4965d3; }
.button-primary:hover { background: #3d57bb; }
.button-secondary { color: #30427e; background: #e9edff; }
.button-quiet { color: #667085; background: transparent; }
.preview-panel { margin-top: 14px; text-align: left; }
.preview-panel h2 { margin: 0 0 8px; font-size: 16px; }
#preview-image { display: block; width: 100%; max-height: min(38svh, 300px); border-radius: 14px; object-fit: contain; background: #edf0f5; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.photo-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; border: 0; border-radius: 24px; padding: 24px; color: #172033; background: #fff; box-shadow: 0 18px 55px rgba(30, 48, 80, .25); }
.photo-dialog::backdrop { background: rgba(16, 24, 39, .6); }
.photo-dialog h2 { margin: 0 0 12px; font-size: 21px; }
#camera-status { color: #667085; line-height: 1.4; }
#camera-video { display: block; width: 100%; max-height: 45svh; object-fit: contain; border-radius: 14px; background: #101827; }
#retry-upload-button { margin-top: 10px; }
.button:focus-visible { outline: 3px solid #4965d3; outline-offset: 3px; }
.status, .error { margin-top: 12px; padding: 10px 12px; border-radius: 12px; line-height: 1.35; }
.status { color: #245d43; background: #e4f5eb; }
.error { color: #9f2f3d; background: #ffeaed; }
.spinner { display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 520px) { .card { padding: 30px 38px; } }
