/* Self-hosted fonts (SIL Open Font License), latin and latin-ext subsets */
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/big-shoulders-display-latin-ext-700-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(fonts/big-shoulders-display-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(fonts/big-shoulders-display-latin-ext-800-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-display: swap;
  font-weight: 800;
  src: url(fonts/big-shoulders-display-latin-800-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* ibm-plex-mono-latin-600-normal (dial numbers under the index mark) */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(fonts/ibm-plex-mono-latin-600-normal.woff2) format('woff2');
}
[hidden]:not([hidden=until-found i]) { display: none !important; }
img { max-width: 100%; }
/* Layout: one phone-width app column, centered on desktop. Home = stacked section boxes that open in place; tool = result card on top, inputs below. Single dark look by choice (used on set). */
:root {
  --bg: #0E0D0C;
  --surface: #171513;
  --surface2: #201D1A;
  --line: #2C2925;
  --fg: #EDE7DD;
  --muted: #A39B8F;
  --accent: #E8B04B;
  --accent-ink: #14110D;
  --band: rgba(232, 176, 75, 0.22);
  --scrim: rgba(0, 0, 0, 0.62);
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--body); -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
button:focus-visible, select:focus-visible, .sec:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 0 48px; }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 12px; min-height: 64px; margin-inline: -16px; padding-inline: 16px; border-bottom: 1px solid var(--line); }
.wordmark { font: 800 24px/1 var(--display); letter-spacing: 0.12em; color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-left: auto; flex: none; }
.seg button { height: 40px; min-width: 44px; padding: 0 14px; background: transparent; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.title { font: 800 clamp(46px, 13vw, 66px)/0.92 var(--display); letter-spacing: 0.005em; margin: 28px 0 20px; text-wrap: balance; }

.cam { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer; }
.cam svg { flex: none; color: var(--accent); }
.cam-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cam-name { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-change { color: var(--accent); font-size: 14px; flex: none; }
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.secs { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; }
.sec.is-open { border-color: var(--accent); cursor: default; }
.sec-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 20px 18px 6px; background: transparent; border: 0; text-align: left; cursor: pointer; }
.sec-icon { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.sec-name { font: 700 31px/1 var(--display); letter-spacing: 0.01em; flex: 1; min-width: 0; }
.sec-chev { flex: none; color: var(--muted); }
.sec.is-open .sec-chev { transform: rotate(180deg); color: var(--accent); }
.sec-tools { list-style: none; margin: 0; padding: 6px 18px 20px 78px; display: flex; flex-direction: column; }
.tool-name { color: var(--muted); font-size: 15px; line-height: 1.75; }
.sec.is-open .sec-tools { padding: 10px 12px 12px; gap: 6px; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 54px; padding: 0 14px 0 16px; background: var(--surface2); border: 0; border-radius: 12px; font-weight: 500; font-size: 17px; text-align: left; cursor: pointer; }
.tool-row svg { flex: none; color: var(--accent); }
.tool-row.is-soon { background: transparent; color: var(--muted); cursor: default; }
.soon { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
@media (prefers-reduced-motion: no-preference) { .sec-chev { transition: transform 0.2s ease; } }

.top-tool { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 12px; }
.brandrow { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.titlerow { display: flex; align-items: center; gap: 12px; }
button.wordmark { background: transparent; border: 0; padding: 0; cursor: pointer; }
.cam-block { display: flex; flex-direction: column; gap: 8px; }
.cam-note { margin: 0; padding-inline: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.cam-note strong { color: var(--fg); font-weight: 500; }
.cam-note.flash strong { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .cam-note strong { transition: color 0.6s ease; } }
.back { width: 44px; height: 44px; flex: none; border-radius: 22px; border: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tool-title { font: 800 27px/1 var(--display); letter-spacing: 0.01em; margin: 3px 0 0; }
.tool { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.tool .cam { min-height: 56px; }

.result { background: var(--surface); border: 1px solid var(--accent); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.r-main { display: flex; flex-direction: column; gap: 4px; }
.r-big { font: 800 clamp(46px, 14vw, 66px)/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.r-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.r-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r-mid { font: 700 clamp(25px, 7.4vw, 34px)/1 var(--display); font-variant-numeric: tabular-nums; }
.r-acc { color: var(--accent); }
.r-list { margin: 0; display: flex; flex-direction: column; }
.r-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.r-list dt { color: var(--muted); font-size: 15px; }
.r-list dd { margin: 0; font-family: var(--mono); font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.r-block { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.r-note { margin: 0; font-size: 15px; color: var(--fg); }
.diag { width: 100%; height: auto; display: block; }
.d-axis { stroke: var(--line); stroke-width: 2; }
.d-band { fill: var(--band); stroke: var(--accent); stroke-width: 1; }
.d-focus { stroke: var(--accent); stroke-width: 2; }
.d-tick { stroke: var(--muted); stroke-width: 1; }
.d-text { fill: var(--muted); font: 10px var(--mono); }
.d-flabel { fill: var(--accent); font: 10px var(--mono); }

.inputs { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.num { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; height: 54px; padding: 0 14px; }
.num:focus-within { border-color: var(--accent); }
.num input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; font: 500 22px var(--mono); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num .unit, .num .pre { color: var(--muted); font: 500 16px var(--mono); flex: none; }
select { height: 54px; width: 100%; padding: 0 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 38px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font: 500 14px var(--mono); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-head label { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.val { font: 500 24px var(--mono); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 34px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { font-size: 14px; color: var(--muted); }

.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; height: min(80vh, 680px); background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 18px 12px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: 4px; }
.sheet h2 { margin: 0; font: 800 30px/1 var(--display); }
.x { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pk-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 8px; }
.pk-col { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-bottom: 8px; }
.pk-models { background: var(--bg); border-radius: 14px; padding: 6px; }
.pk-brand { flex: none; display: flex; align-items: center; min-height: 50px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 500; font-size: 16px; text-align: left; cursor: pointer; }
.pk-brand[aria-pressed="true"] { background: var(--surface2); color: var(--fg); font-weight: 600; }
.pk-group { flex: none; padding: 12px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pk-model { flex: none; display: flex; flex-direction: column; gap: 2px; min-height: 58px; justify-content: center; padding: 6px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.pk-model:hover { background: var(--surface); }
.pk-model[aria-current="true"] { border-color: var(--accent); background: var(--surface); }
.pk-model .m-name { font-weight: 500; font-size: 15px; line-height: 1.3; }
.pk-model[aria-current="true"] .m-name { color: var(--accent); }
.pk-model .m-meta { font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-foot { margin: 0; padding-inline: 4px; font-size: 12px; color: var(--muted); }
/* Brand lockup: CINETRAM and Cinematographer Tools as one centered mark. The subtitle's letter-spacing is set in script so it spans exactly the width of CINETRAM. */
.lockup { display: flex; flex-direction: column; align-items: center; width: fit-content; margin: 34px auto 28px; }
.lk-name { font: 800 clamp(52px, 15vw, 80px)/0.82 var(--display); letter-spacing: 0.05em; margin-right: -0.05em; color: var(--accent); }
.lk-sub { display: block; white-space: nowrap; margin-top: 10px; padding-top: 9px; border-top: 2px solid var(--accent); font: 700 clamp(13px, 3.6vw, 18px)/1 var(--display); text-transform: uppercase; color: var(--fg); }
.lockup.sm { margin: 0; align-items: flex-start; }
.lockup.sm .lk-name { font-size: 27px; letter-spacing: 0.08em; margin-right: -0.08em; }
.lockup.sm .lk-sub { margin-top: 4px; padding-top: 3px; border-top-width: 1px; font-size: 9.5px; }
button.lockup { background: transparent; border: 0; padding: 0; cursor: pointer; text-align: left; }
.top-home { justify-content: flex-end; }
.lang { margin-left: auto; width: auto; max-width: 52vw; height: 40px; padding: 0 10px; border-radius: 999px; font-size: 14px; }
.field-head .seg { margin-left: 0; }
.field-head .seg button { height: 34px; font-size: 13px; }

/* Links styled like the buttons they replaced */
a.tool-row, a.back, a.lockup { color: inherit; text-decoration: none; }
a.tool-row:focus-visible, a.back:focus-visible, a.lockup:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Page text under the tool: what it does and how it works (also what search engines read) */
.about { max-width: 560px; margin: 8px auto 0; padding: 28px 16px 56px; border-top: 1px solid var(--line); color: var(--fg); }
.about h2 { font: 700 26px/1.1 var(--display); letter-spacing: 0.02em; margin: 0 0 12px; color: var(--accent); }
.about h3 { font: 600 17px/1.3 var(--body); margin: 26px 0 8px; }
.about p, .about li { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; }
.about p strong { color: var(--fg); font-weight: 600; }
.about ul { padding-left: 20px; margin: 0 0 12px; }
.about .more { margin-top: 26px; }
.about .more a { color: var(--accent); text-decoration: none; }
.about .more ul { list-style: none; padding: 0; columns: 2; column-gap: 20px; }
.about .more li { margin: 0 0 8px; break-inside: avoid; }
.site-foot { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.site-foot { line-height: 1.8; }
.info-top { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.about.info { border-top: 0; padding-top: 4px; }
.about.info h1 { font: 700 34px/1.1 var(--display); letter-spacing: 0.02em; color: var(--accent); margin: 0 0 16px; }
.about.info h2 { font: 600 18px/1.3 var(--body); color: var(--fg); letter-spacing: 0; margin: 26px 0 8px; }
.about.info a, .about .langs a { color: var(--accent); }
.about .langs { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.about .langs h3 { margin-top: 0; }
/* Static first paint before the app script runs */
.boot .tool-row { margin-bottom: 8px; }

/* Tool page heading under the brand lockup */
.tool-head { padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
/* Camera picker: centered dialog on wider screens, taller sheet on phones, denser rows */
.sheet { height: min(90vh, 760px); }
.pk-model { min-height: 50px; padding: 5px 12px; }
.pk-brand { min-height: 46px; }
@media (min-width: 600px) {
  .sheet-wrap { align-items: center; padding: 16px; }
  .sheet { height: min(86vh, 760px); border-bottom: 1px solid var(--line); border-radius: 22px; }
}

.pk-back { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: var(--surface); color: var(--fg); font-weight: 600; font-size: 15px; text-align: left; cursor: pointer; }
.pk-back svg { color: var(--accent); flex: none; }
.pk-model.has-modes .m-meta::after { content: ' ›'; color: var(--accent); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > .field, .two > .num { min-width: 0; }
.two .num input { min-width: 0; width: 100%; }
.result .r-big { overflow-wrap: anywhere; }
.btn-ghost { margin-top: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--accent); font: 500 14px var(--body); cursor: pointer; }
.fl-viz { margin: 14px 0 6px; }
.fl-viz svg { display: block; width: 100%; max-height: 240px; }
.fl-sensor { fill: var(--bg); stroke: var(--muted); stroke-width: 0.4; }
.fl-line { fill: none; stroke: var(--accent); stroke-width: 0.7; }
.fl-cross { stroke: var(--accent); stroke-width: 0.4; }
.sun-at { margin: 18px 0 0; }
input[type=date], input[type=time] { color-scheme: dark; }

/* ===== Compact layout (phones first) ===== */
body { font-size: 15px; }
.app { padding-bottom: 28px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 14px; }
.home-head .lockup { margin: 0; align-items: flex-start; }
.home-head .lang { margin-left: 0; flex: none; }
.lk-name { font-size: clamp(30px, 9vw, 40px); }
.lk-sub { margin-top: 6px; padding-top: 5px; border-top-width: 1.5px; font-size: clamp(8.5px, 2.5vw, 11px); }
.lang { height: 32px; font-size: 12.5px; padding: 0 6px; max-width: 42vw; }
.tool-head { display: flex; align-items: flex-end; gap: 10px; padding: 14px 0 10px; margin: 0 0 2px; border-bottom: 1px solid var(--line); }
.tool-head .tt { gap: 1px; }
.tool-title { font-size: 22px; margin: 0; }
.brand-sm { flex: none; font: 800 22px/1 var(--display); letter-spacing: 0.06em; color: var(--accent); text-decoration: none; }
.back { width: 34px; height: 34px; border-radius: 17px; align-self: center; }
.back svg { width: 18px; height: 18px; }
.label { font-size: 10px; letter-spacing: 0.1em; }
.cam { min-height: 46px; padding: 6px 12px; gap: 10px; border-radius: 12px; }
.tool .cam { min-height: 46px; }
.cam-name { font-size: 14px; }
.cam-change { font-size: 13px; }
.cam-note { font-size: 12px; line-height: 1.4; }
.secs { gap: 8px; margin-top: 12px; }
.sec { border-radius: 14px; }
.sec-head { gap: 10px; padding: 8px 12px 2px; }
.sec-icon { width: 30px; height: 30px; border-radius: 8px; }
.sec-icon svg { width: 16px; height: 16px; }
.sec-name { font-size: 19px; }
.sec-tools { padding: 0 12px 8px 52px; }
.tool-name { font-size: 13px; line-height: 1.4; }
.sec.is-open .sec-tools { padding: 6px 8px 8px; gap: 4px; }
.tool-row { min-height: 40px; padding: 0 10px 0 12px; border-radius: 10px; font-size: 15px; }
.tool { gap: 10px; margin-top: 10px; }
.result { border-radius: 14px; padding: 12px 14px; gap: 10px; }
.r-big { font-size: clamp(30px, 9vw, 42px); }
.r-mid { font-size: clamp(19px, 5.4vw, 25px); }
.r-grid { gap: 8px; }
.r-list > div { padding: 6px 0; gap: 12px; }
.r-list dt, .r-list dd { font-size: 13.5px; }
.r-note { font-size: 14px; }
.inputs { border-radius: 14px; padding: 12px 14px; gap: 14px; }
.field { gap: 6px; }
.field > label, .field-head label { font-size: 10px; letter-spacing: 0.1em; }
.num { height: 42px; padding: 0 12px; border-radius: 10px; }
.num input { font-size: 18px; }
.num .unit, .num .pre { font-size: 13px; }
select { height: 42px; font-size: 15px; border-radius: 10px; }
.chips { gap: 5px; }
.chip { height: 30px; min-width: 36px; padding: 0 9px; font-size: 12.5px; }
.val { font-size: 17px; }
input[type="range"] { height: 26px; }
.seg button { height: 32px; min-width: 38px; padding: 0 10px; font-size: 12.5px; }
.field-head .seg button { height: 28px; font-size: 12px; }
.hint { font-size: 12px; }
.btn-ghost { height: 34px; font-size: 13px; }
.sheet h2 { font-size: 24px; }
.pk-model { min-height: 44px; padding: 4px 10px; }
.pk-model .m-name { font-size: 14px; }
.pk-brand { min-height: 40px; font-size: 15px; }
.about { padding: 20px 16px 36px; }
.about h2 { font-size: 22px; }
.about h3 { font-size: 15px; margin: 20px 0 6px; }
.about p, .about li { font-size: 14px; line-height: 1.55; margin-bottom: 10px; }
.site-foot { font-size: 12.5px; padding-bottom: 28px; }
.site-foot .foot-lang { display: block; margin: 0 0 10px; width: auto; }
.info-top .lockup { margin: 18px 0 14px; align-items: flex-start; }
.about.info h1 { font-size: 28px; }
.about.info h2 { font-size: 16px; margin: 20px 0 6px; }
/* One advertising slot between the tool and its description (only rendered when ads are configured) */
.ad-slot { max-width: 560px; margin: 0 auto; padding: 0 16px 16px; min-height: 100px; }
.ad-slot .ad-label { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* Confirm dialog for the camera choice */
.confirm-wrap { position: fixed; inset: 0; z-index: 30; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; }
.confirm { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--accent); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.confirm h2 { margin: 0 0 4px; font: 800 22px/1 var(--display); }
.confirm .r-list dd { font-family: var(--body); font-weight: 500; }
.confirm-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.btn-pri, .btn-sec { height: 40px; padding: 0 16px; border-radius: 999px; font: 600 14px var(--body); cursor: pointer; }
.btn-pri { background: var(--accent); color: var(--accent-ink); border: 0; }
.btn-sec { background: transparent; color: var(--fg); border: 1px solid var(--line); }
/* Until the tool is drawn, keep the text below it hidden so nothing jumps */
.js:not(.ready) .about, .js:not(.ready) .site-foot, .js:not(.ready) .ad-slot, .js:not(.ready) .boot { visibility: hidden; }
/* Desktop: settings on the left, results on the right */
@media (min-width: 960px) {
  .app { max-width: 1080px; padding-inline: 24px; }
  .about, .site-foot, .ad-slot { max-width: 1080px; padding-inline: 24px; }
  .about .more ul { columns: 4; }
  .secs { display: block; columns: 2; column-gap: 12px; }
  .secs > .sec { break-inside: avoid; margin-bottom: 10px; }
  .tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "inp res"; gap: 18px; align-items: start; }
  .tool.has-cam { grid-template-areas: "cam res" "inp res"; grid-template-rows: auto 1fr; }
  .tool > .cam-block { grid-area: cam; }
  .tool > .result { grid-area: res; position: sticky; top: 16px; }
  .tool > .inputs { grid-area: inp; }
  .tool-title, .brand-sm { font-size: 28px; }
  .lk-name { font-size: 46px; }
  .lk-sub { font-size: 12px; }
}

/* Camera not chosen yet */
.cam-empty { border-color: var(--accent); }
.cam-empty .cam-name { color: var(--accent); font-weight: 600; font-size: 15px; }
.cam-note:empty { display: none; }
.cam-note.warn-on { color: var(--accent); font-weight: 600; }
.cam.pulse { animation: campulse 0.6s ease 3; }
@keyframes campulse { 50% { box-shadow: 0 0 0 4px var(--band); } }
.inputs.locked { position: relative; }
.inputs.locked > :not(.lock) { opacity: 0.45; }
.lock { position: absolute; inset: 0; border-radius: inherit; cursor: not-allowed; }
.lock:focus-visible { outline: 2px solid var(--accent); }
.result.is-empty { opacity: 0.55; }
@media (prefers-reduced-motion: reduce) { .cam.pulse { animation: none; } }
/* Desktop home: a bit larger logo and boxes; two even rows (3 + 2) */
@media (min-width: 960px) {
  .home-head { padding: 26px 0 20px; }
  .home-head .lk-name { font-size: 54px; }
  .home-head .lk-sub { font-size: 13.5px; }
  .secs { display: grid; columns: auto; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
  .secs > .sec { margin: 0; grid-column: span 2; display: flex; flex-direction: column; }
  .secs > .sec:nth-child(n+4) { grid-column: span 3; }
  .sec, .sec.is-open { border-color: var(--line); cursor: default; }
  .sec-head { padding: 14px 16px 6px; cursor: default; }
  .sec-icon { width: 36px; height: 36px; border-radius: 10px; }
  .sec-icon svg { width: 19px; height: 19px; }
  .sec-name { font-size: 23px; }
  .sec-chev { display: none; }
  .sec.is-open .sec-tools { padding: 8px 12px 14px; gap: 6px; }
  .tool-row { min-height: 44px; font-size: 15.5px; }
}

.fd-view { background: #000; border-radius: 10px; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 160px; }
.fd-view canvas { display: block; }
.fd-off { padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.fd-err { margin: 0; color: #E8836F; font-size: 13px; }
.fd-btns { display: flex; gap: 8px; justify-content: center; }
.fd-calbox { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }

.pwa-btn { display: block; margin: 0 0 12px; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 600 13.5px var(--body); cursor: pointer; }
.ios-hint { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--surface2); border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.ios-hint p { margin: 0; flex: 1; font-size: 13.5px; line-height: 1.45; color: var(--fg); }
.ios-hint svg { vertical-align: -3px; color: var(--accent); margin: 0 2px; }
.ios-hint button { flex: none; width: 32px; height: 32px; border-radius: 16px; border: 1px solid var(--line); background: transparent; color: var(--fg); font-size: 18px; line-height: 1; cursor: pointer; }
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top, 0px); } }

.cambox { align-items: flex-start; gap: 12px; min-height: 0; padding: 9px 14px; background: #141b16; border-color: #2c4733; border-radius: 12px; }
.tool .cambox { min-height: 0; }
.cambox svg { color: #8DBE97; margin-top: 1px; }
.cb-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cb-l1 { font-size: 13px; line-height: 19px; }
.cb-brand { color: #8DBE97; font-weight: 500; letter-spacing: 0.05em; }
.cb-dash { color: rgba(141, 190, 151, 0.55); }
.cb-model { color: #E6F2E8; font-weight: 600; }
.cb-l2 { display: flex; align-items: flex-start; gap: 12px; }
.cb-mode { flex: 1; min-width: 0; color: #9FDCEB; font-weight: 500; font-size: 14.5px; line-height: 18px; }
.cb-px { flex: none; color: #86C3D2; font: 12.5px/18px var(--mono); white-space: nowrap; }

.pk-sheet { padding: 0; gap: 0; height: min(86vh, 720px); }
.pk-top { display: flex; justify-content: flex-end; padding: 8px 10px 0; }
.pk-close { height: 40px; padding: 0 10px; border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 15px; cursor: pointer; border-radius: 8px; }
.pk-head { padding: 0 16px 12px; }
.pk-crumb { display: flex; align-items: center; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 6px; }
.pk-crumb button { border: 0; background: transparent; padding: 4px 2px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }
.pk-c-root { color: var(--accent); }
.pk-c-brand { color: #8DBE97; font-weight: 500; letter-spacing: 0.05em; padding: 4px 2px; }
.pk-c-model { color: #E6F2E8; font-weight: 600; font-size: 13px; }
.pk-sep { color: var(--muted); padding: 0 6px; }
.pk-step { display: flex; align-items: center; gap: 10px; }
.pk-num { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 12px/22px var(--body); text-align: center; }
.pk-step h2 { margin: 0; font: 600 18px/1.3 var(--body); }
.pk-bar { display: flex; gap: 6px; margin-top: 10px; }
.pk-bar i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.pk-bar i.on { background: var(--accent); }
.pk-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.pk-row { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.pk-row:hover { background: var(--surface2); }
.pk-row[aria-current="true"] { background: rgba(232, 176, 75, 0.12); }
.pk-row .m-name { font-size: 16px; line-height: 1.35; }
.pk-row[aria-current="true"] .m-name { color: var(--accent); }
.pk-row .m-meta { font: 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-list .pk-group { padding: 16px 16px 6px; }
.pk-sheet .pk-foot { padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font-size: 11.5px; }
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .pk-sheet { border-bottom: 1px solid var(--line); border-radius: 22px; } }

.dial-hide { display: none !important; }
.dial { margin-top: 2px; }
.dial-cv { display: block; width: 100%; height: 57px; cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; border-radius: 4px; }
.dial-cv:active { cursor: grabbing; }
.dial-cv:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-head .dial-v { margin-left: auto; font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.field-head .dial-v + .seg { margin-left: 10px; }
.field.has-dial { gap: 6px; }
.pair > .field.has-dial { grid-column: 1 / -1; }

.adv { border: 1px solid var(--line); border-radius: 10px; }
.adv > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-radius: 10px; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.adv-t { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 1px; }
.adv-s { font-size: 14px; color: var(--fg); }
.adv-chev { flex: none; color: var(--muted); transition: transform 0.15s; }
.adv[open] .adv-chev { transform: rotate(180deg); }
.adv-body { padding: 0 14px 14px; }

.vis { display: block; width: 100%; border-radius: 8px; }
.vis-row { display: flex; align-items: center; gap: 12px; }
.vis-row > .r-list { flex: 1; min-width: 0; }
.vis-inset { flex: none; width: 120px; }
.vis-row .r-list dd { white-space: nowrap; }
.vis-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tool-row .tr-ic { color: var(--accent); flex: none; }
.tool-row .tr-name { flex: 1; min-width: 0; }

input[type="range"].thin { -webkit-appearance: none; appearance: none; height: 24px; background: transparent; --p: 0%; }
.thin::-webkit-slider-runnable-track { height: 1.5px; border-radius: 2px; background: linear-gradient(to right, rgba(232, 176, 75, 0.75) var(--p), var(--line) var(--p)); transition: height 0.15s; }
.thin::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 7px; height: 7px; border: 0; border-radius: 50%; background: var(--accent); margin-top: -2.75px; transition: width 0.15s, height 0.15s, margin-top 0.15s; }
.thin::-moz-range-track { height: 1.5px; border-radius: 2px; background: var(--line); transition: height 0.15s; }
.thin::-moz-range-progress { height: 1.5px; border-radius: 2px; background: rgba(232, 176, 75, 0.75); transition: height 0.15s; }
.thin::-moz-range-thumb { width: 7px; height: 7px; border: 0; border-radius: 50%; background: var(--accent); transition: width 0.15s, height 0.15s; }
.thin.on::-webkit-slider-runnable-track, .thin:focus-visible::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
.thin.on::-webkit-slider-thumb, .thin:focus-visible::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -8px; }
.thin.on::-moz-range-track, .thin.on::-moz-range-progress, .thin:focus-visible::-moz-range-track, .thin:focus-visible::-moz-range-progress { height: 4px; }
.thin.on::-moz-range-progress, .thin:focus-visible::-moz-range-progress { background: var(--accent); }
.thin.on::-moz-range-thumb, .thin:focus-visible::-moz-range-thumb { width: 20px; height: 20px; }
@media (hover: hover) {
  .thin:hover::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
  .thin:hover::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -8px; }
  .thin:hover::-moz-range-track, .thin:hover::-moz-range-progress { height: 4px; }
  .thin:hover::-moz-range-progress { background: var(--accent); }
  .thin:hover::-moz-range-thumb { width: 20px; height: 20px; }
}

.cambox .cb-brand { color: var(--accent); }

.fl-live { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 2px; font: 500 14.5px/1.2 var(--body); color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.fl-live svg { width: 19px; height: 19px; flex: none; }
.fl-live.on { background: var(--accent); color: #14110D; }
.fl-live-msg:empty { display: none; }
.fl-cam { position: relative; overflow: hidden; border-radius: 4px; background: #000; margin: 0 auto; }
.fl-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fl-over { position: absolute; inset: 0; width: 100%; height: 100%; }
.fl-shade { fill: rgba(0, 0, 0, 0.55); }
.fl-edge { fill: none; stroke: rgba(237, 231, 221, 0.5); stroke-width: 0.4; vector-effect: non-scaling-stroke; }
.fl-over .fl-line { stroke-width: 2; vector-effect: non-scaling-stroke; }
.fl-over .fl-cross { stroke-width: 1.2; vector-effect: non-scaling-stroke; }

.sky-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.sky-chip { font: 500 12px/1 var(--body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.sky-chip:hover, .sky-chip:focus-visible { color: var(--fg); border-color: var(--muted); }
.sky-chart { touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.sky-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.sky-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sky-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sky-ar { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; font: 500 14.5px/1.2 var(--body); color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 999px; padding: 10px 14px; cursor: pointer; }
.sky-ar:hover, .sky-ar:focus-visible { background: rgba(232, 176, 75, 0.08); }
.sky-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 4px; }
.sky-dome { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sky-dome .vis { background: transparent; }
.sky-stats { flex: 1.1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sky-stat { display: flex; flex-direction: column; }
.ss-l { font-size: 12px; line-height: 15px; color: var(--muted); min-height: 30px; }
.ss-v { font: 500 14px/18px var(--mono); color: var(--fg); min-height: 36px; }
.moon-top { display: flex; align-items: center; gap: 14px; }
.moon-top canvas { flex: none; width: 120px; height: 120px; }
.moon-ph { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.moon-lit { font: 500 14px/1.3 var(--mono); color: var(--fg); }
.appnote { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.an-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.an-box { position: relative; max-width: 380px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.an-box h2 { margin: 0; font: 600 17px/1.3 var(--body); color: var(--accent); display: flex; align-items: center; gap: 8px; }
.sky-ic { flex: none; }
.an-box p { margin: 0; }
.an-close { align-self: flex-end; font: 600 15px/1 var(--body); color: var(--accent); background: transparent; border: 0; padding: 10px 6px; cursor: pointer; }
