:root { font-family: system-ui, sans-serif; color-scheme: light; background: #f3f5f8; }
:root:has([data-theme="dark"]) { color-scheme: dark; background: #141922; }
* { box-sizing: border-box; }
body { margin: 0; }
main, #test-app { max-width: 40rem; margin: auto; padding: 1rem 1rem max(2rem, env(safe-area-inset-bottom)); }
[data-theme] {
  --bg: var(--app-bg, #ffffff); --text: var(--app-text, #172336);
  --surface: var(--app-surface, #eef2f7); --hint: #45556c;
  --button: var(--app-button, #205db8); --button-text: var(--app-button-text, #ffffff);
  color: var(--text); background: var(--bg); min-height: var(--viewport-height, 100dvh);
  overflow-wrap: anywhere;
}
[data-theme="dark"] { --bg: var(--app-bg, #141922); --text: var(--app-text, #f1f4fa); --surface: var(--app-surface, #232d3c); --hint: #c2ccdc; --button: var(--app-button, #a5c7ff); --button-text: var(--app-button-text, #10233e); }
h1 { font-size: 1.6rem; margin-bottom: .2rem; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
header p, small { color: var(--hint, #45556c); }
header p { margin-top: .25rem; }
label { display: block; margin: 1rem 0; }
input:not([type=checkbox]), select { display: block; width: 100%; min-width: 0; margin-top: .35rem; padding: .8rem; font: inherit; font-size: 1rem; border: 1px solid var(--hint, #45556c); border-radius: .5rem; background: var(--bg, Canvas); color: var(--text, CanvasText); }
input[type=checkbox] { width: 1.2rem; height: 1.2rem; vertical-align: middle; accent-color: var(--button); }
button, summary { min-height: 44px; }
button { margin: .3rem .3rem .3rem 0; padding: .7rem .85rem; font: inherit; line-height: 1.25; cursor: pointer; border: 1px solid transparent; border-radius: .6rem; background: var(--button, #205db8); color: var(--button-text, #fff); max-width: 100%; overflow-wrap: anywhere; }
button:disabled { cursor: wait; opacity: .6; }
:where(button, input, select, summary):focus-visible { outline: 3px solid var(--text, #172336); outline-offset: 3px; }
nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; padding: .7rem 0; border-bottom: 1px solid var(--hint); }
nav button { margin: 0; padding: .7rem .2rem; font-size: .9rem; background: var(--surface); color: var(--text); }
nav [aria-current="page"] { box-shadow: inset 0 -3px var(--button); font-weight: 700; }
.notice { border-left: 3px solid var(--button, #205db8); padding: .8rem; background: var(--surface, #eef2f7); }
.notice:empty { display: none; }
.danger { border: 2px solid currentColor; background: var(--bg); color: #a32232; }
[data-theme="dark"] .danger { color: #ffb8bf; }
small { display: block; margin: .5rem 0; line-height: 1.5; }
p, li { line-height: 1.5; }
li { margin-bottom: .7rem; }
section, form, details { margin: 1rem 0; }
form, details, .stats li { padding: .8rem; background: var(--surface, #eef2f7); border-radius: .7rem; }
summary { cursor: pointer; padding: .5rem 0; }
.stats { padding: 0; list-style: none; }
.stats p { margin: .3rem 0; }
progress { display: block; width: 100%; height: 1rem; accent-color: var(--button); }
#character { display: grid; place-items: center; max-width: 24rem; margin: 1rem auto; }
#character img { max-width: 100%; height: auto; object-fit: contain; }
.character-placeholder { display: grid; place-content: center; text-align: center; padding: 1.2rem; margin: 0; width: 100%; min-height: 8rem; border: 1px dashed var(--hint); border-radius: .7rem; background: var(--surface); }
output { display: block; overflow-wrap: anywhere; user-select: all; }
video { display: block; width: 100%; max-height: 45vh; background: #111; object-fit: contain; }
.camera-preview { position: relative; background: #111; }
.camera-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.camera-guide-toggle { margin-bottom: .5rem; }
#camera-details { margin: .7rem 0; border: 1px solid GrayText; padding: .6rem; }
#camera-diagnostics { padding-left: 1.3rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
@media (max-width: 360px) { main, #test-app { padding-left: .7rem; padding-right: .7rem; } nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
