/* code.camera. Mobile first: the base style is the phone, larger screens only add. */
:root {
--bg: #f6f7f4;
--card: #ffffff;
--text: #1b2321;
--muted: #4a5753;
--line: #c9d1cd;
--accent: #0f766e;
--accent-text: #ffffff;
--error: #b42318;
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme='light']) {
--bg: #121816; --card: #1b2421; --text: #eef3f1; --muted: #b4c0bb; --line: #3a4743; --accent: #2dd4bf; --accent-text: #08201c; --error: #ff8a80;
color-scheme: dark;
}
}
:root[data-theme='dark'] {
--bg: #121816; --card: #1b2421; --text: #eef3f1; --muted: #b4c0bb; --line: #3a4743; --accent: #2dd4bf; --accent-text: #08201c; --error: #ff8a80;
color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; }
.site-header p, .site-footer p { margin: 0; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
main { max-width: 40rem; margin: 0 auto; padding: 0 1rem 2rem; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 1rem 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.lead { color: var(--muted); margin-top: 0; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, h1:focus-visible, h3:focus-visible, input:where([type='button'],[type='submit']):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .button, input:where([type='button'],[type='submit']) { display: inline-block; font: inherit; font-weight: 600; min-height: 2.75rem; padding: 0.55rem 1.1rem; border: 2px solid var(--accent); border-radius: 0.6rem; background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
button:hover, .button:hover, input:where([type='button'],[type='submit']):hover { filter: brightness(1.08); }
input[type='text'], select { font: inherit; width: 100%; min-height: 2.75rem; padding: 0.45rem 0.6rem; border: 2px solid var(--line); border-radius: 0.5rem; background: var(--card); color: var(--text); }
input[type='checkbox'] { width: 1.2rem; height: 1.2rem; vertical-align: -0.2rem; margin-inline-end: 0.4rem; }
input[type='file'] { max-width: 100%; margin-top: 0.3rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.video-wrap { position: relative; }
.video-wrap video { display: block; width: 100%; max-height: 22rem; background: #000; border-radius: 0.6rem; }
/* The oval frame lies exactly over the video (same box, the same fit), so the oval is where the head should be. */
.video-wrap .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.frame ellipse { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 22 14; opacity: 0.9; }
.result { padding: 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.qr svg { width: 12rem; height: 12rem; border: 1px solid var(--line); border-radius: 0.4rem; }
.error { color: var(--error); font-weight: 600; }
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.site-footer select { width: auto; min-height: 2.5rem; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (min-width: 40rem) {
h1 { font-size: 2rem; }
input[type='text'], select { max-width: 28rem; }
}

/* Skip link, header tools, the for-sale page and the offer form */
main:focus { outline: none; }
.header-tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; justify-content: flex-end; }
.header-tools select { width: auto; min-height: 2.5rem; }
.header-tools button, .header-tools input:where([type='button'],[type='submit']) { min-height: 2.5rem; padding: 0.35rem 0.9rem; }
.field { margin: 0.9rem 0; }
.req::after { content: ' *'; }
.req-note, .hint { color: var(--muted); font-size: 0.95rem; }
.hint { display: block; margin-top: 0.25rem; }
.error:empty, .ok:empty { display: none; }
.ok { font-weight: 600; }
details { margin: 0.5rem 0; padding: 0.5rem 0.75rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.5rem; }
summary { cursor: pointer; font-weight: 600; min-height: 2.25rem; }
.offer { margin-top: 2rem; }
[aria-invalid='true'] { border-color: var(--error) !important; }

/* The preview is a mirror (the advice about left and right is given from the mirror view) */
.video-wrap video { transform: scaleX(-1); }

/* Top bar ABOVE the camera picture (not over it, so nothing covers the oval frame), in page order: Speech (start), Counter (5) (middle), Sound (end). */
.video-top { display: flex; align-items: stretch; gap: 0.4rem; margin-bottom: 0.5rem; }
.video-top button, .video-top input:where([type='button'],[type='submit']) { min-height: 2.75rem; padding: 0.3rem 0.7rem; }
.video-top .toggle { flex: 0 0 auto; padding: 0.2rem 0.8rem; font-size: 0.95rem; line-height: 1.1; }
.video-top #timer { flex: 1 1 auto; min-width: 0; position: relative; font-size: 0.9rem; line-height: 1.15; }
/* The countdown number (5 to 1) shows on the Counter button itself while it counts (its value); the words stay as its name for screen readers (aria-label). */
#timer.counting { opacity: 1; font-size: 2rem; font-weight: 700; line-height: 1; }
/* The toggles follow the page colours (both themes): pressed = filled with the text colour, not pressed = outlined. The On / Off words show the same. */
.video-top .toggle { border-color: var(--text); }
/* Pressed looks pressed in: filled, with an inner shadow. Not pressed is outlined and flat. No On / Off words (the screen reader says pressed or not pressed). */
.video-top .toggle[aria-pressed='true'] { background: var(--text); color: var(--bg); box-shadow: inset 0 0.25rem 0.5rem rgba(0, 0, 0, 0.55); }
.video-top .toggle[aria-pressed='false'] { background: var(--card); color: var(--text); box-shadow: none; }

/* Bottom row, in page order: Stop camera (start), the Auto checkbox (middle), Take photo (end). */
body { --mid: clamp(7.5rem, 33vw, 10rem); }
.video-bottom { display: grid; grid-template-columns: 1fr var(--mid) 1fr; gap: 0.4rem; align-items: stretch; margin-top: 0.5rem; }
.video-bottom button, .video-bottom input:where([type='button'],[type='submit']) { min-height: 3.25rem; min-width: 0; padding: 0.4rem 0.6rem; text-align: center; }
.video-bottom .auto { display: flex; align-items: center; min-height: 3.25rem; font-size: 0.85rem; line-height: 1.2; padding: 0.2rem 0.4rem; background: var(--card); border: 2px solid var(--line); border-radius: 0.6rem; }

/* Camera mode (owner, 2026-11-09): while the camera is on, the camera area fills the screen. The top row is at the top of the screen, the bottom row at
the bottom, the picture with the oval in the middle. The page order is the same as the screen order (top row, picture, bottom row); the rest of the
page is inert (script) so nothing behind it can be reached. */
/* After a photo (owner, 2026-11-09): the photo replaces the live picture in the middle, Keep and Retake sit above the bottom row, below the picture. */
.video-review { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; margin-top: 0.5rem; }
.video-review button, .video-review input:where([type='button'],[type='submit']) { min-height: 3.25rem; min-width: 0; }
.video-wrap #review-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 0.6rem; }
#camera.reviewing video, #camera.reviewing .frame { visibility: hidden; }
.video-bottom button:disabled, .video-top #timer:disabled:not(.counting), .video-bottom .auto:has(input:disabled), .video-bottom input:where([type='button'],[type='submit']):disabled { opacity: 0.5; }
body.camera-on { overflow: hidden; }
body.camera-on #camera { position: fixed; inset: 0; z-index: 30; max-width: 40rem; margin-inline: auto; box-shadow: 0 0 0 100vmax var(--bg); background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0.5rem; padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem max(0.5rem, env(safe-area-inset-bottom)); }
body.camera-on #camera.reviewing { grid-template-rows: auto minmax(0, 1fr) auto auto; }
body.camera-on .video-top, body.camera-on .video-bottom, body.camera-on .video-review { margin: 0; }
body.camera-on .video-wrap { margin: 0; min-height: 0; height: 100%; }
body.camera-on .video-wrap video { width: 100%; height: 100%; max-height: none; object-fit: contain; }


/* The copy that lives inside another site (omri.co, omri.net): its own header has only the Home link and the Install button */
header > input:where([type='button']) { margin-inline-start: auto; min-height: 2.5rem; padding: 0.35rem 0.9rem; }
header { align-items: center; }
