:root{color-scheme:dark;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#16191C;color:#F5F6F7;font-size:16px}*{box-sizing:border-box}body{margin:0}header,main{max-width:1160px;margin:auto;padding:28px}header{display:flex;justify-content:space-between;gap:24px;border-bottom:1px solid #69737C}h1{font-size:32px;margin:5px 0 10px}h2{font-size:23px;margin-top:0}h3{color:#FFBE45}p{line-height:1.55}.eyebrow{font-size:12px;letter-spacing:1.5px;color:#FFBE45;margin:0}.connection{max-width:320px}.connection p{margin:0 0 8px}#offline{font-weight:650}#offline[data-ready=true]{color:#FFBE45}#update,.hint,footer{color:#C0C7CD;font-size:14px}nav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px}button,input,select{font:inherit;border:1px solid #69737C;border-radius:7px;min-height:46px}button{background:#2C3237;color:#F5F6F7;padding:10px 16px;cursor:pointer}button[aria-pressed=true],.primary{background:#FFBE45;color:#171A1D;font-weight:700;border-color:#FFBE45}button:hover{filter:brightness(1.1)}:focus-visible{outline:3px solid #FFBE45;outline-offset:3px}.workspace{display:grid;grid-template-columns:1fr 1.15fr;gap:22px}.card{background:#22272B;border:1px solid #69737C;border-radius:12px;padding:24px;min-width:0}.pair{display:grid;grid-template-columns:1fr 1fr;gap:14px}label{display:block;margin-bottom:18px;font-weight:600;line-height:1.5}input,select{display:block;background:#191E22;color:#F5F6F7;width:100%;padding:10px;margin-top:7px}#error{color:#FFB4AB;min-height:24px}#form button{margin:0 8px 8px 0}#result dl{margin:0}#result dl>div{display:flex;justify-content:space-between;gap:16px;padding:15px 0;border-bottom:1px solid #69737C}dd{margin:0;font-weight:700;text-align:right;overflow-wrap:anywhere}dt{color:#C0C7CD}#result dl>div:first-child dd{font-size:24px;color:#F5F6F7}.audit{font-size:13px;color:#C0C7CD;overflow-wrap:anywhere}svg{width:100%;height:auto;display:block;margin-top:22px}svg text{fill:#F5F6F7;font-family:inherit;font-size:15px}svg .pipe{fill:none;stroke:#C8D0D7;stroke-width:5}svg .dimension{fill:none;stroke:#FFBE45;stroke-width:3}svg .guide{fill:none;stroke:#69737C;stroke-width:2;stroke-dasharray:5 5}footer{margin-top:24px}[hidden]{display:none!important}@media(max-width:720px){header{display:block}header,main{padding:20px}.connection{margin-top:20px;max-width:none}.workspace{grid-template-columns:1fr}.card{padding:18px}.pair{gap:10px}}@media(prefers-reduced-motion:no-preference){button{transition:filter .15s}}

.tool-bar{display:flex;align-items:end;gap:16px;margin-bottom:14px}.tool-bar>button{flex:1;font-weight:700;text-align:left}.precision-control{margin:0;font-size:14px;max-width:190px}.precision-control select{margin-top:4px}#precision-error{color:#FFB4AB;font-size:14px;margin:0 0 10px}dialog{background:#16191C;color:#F5F6F7;border:1px solid #69737C;border-radius:12px;width:min(580px,calc(100% - 28px));max-height:90dvh;padding:22px;overflow-y:auto}dialog::backdrop{background:#000b}.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.dialog-header h2{margin:0}#calculator-picker nav{display:block;margin:0}#calculator-picker section{margin-bottom:20px}#calculator-picker h3{font-size:15px;margin:10px 0}#calculator-picker [data-page]{width:100%;text-align:left}#general{max-width:560px;margin:0 auto}#general h2{margin:0 0 12px}.general-modes{display:flex;gap:8px;margin-bottom:8px}.general-modes button{flex:1}.general-display{background:#22272B;border:1px solid #69737C;border-radius:12px;padding:14px;margin-bottom:8px;min-height:176px;display:flex;flex-direction:column;gap:6px}#general-expression{display:flex;align-items:baseline;overflow-x:auto;white-space:pre;flex-wrap:nowrap;font-size:26px;font-weight:700;padding:2px 0;min-height:48px}#general-entry{font:inherit;color:#F5F6F7;display:inline-block;flex:none;width:auto;min-width:1ch;background:transparent;border:0;border-radius:0;margin:0;padding:0;min-height:36px}#general-prefix,#general-equals{flex:none}#general-answer{display:block;min-height:58px;font-size:clamp(24px,6vw,44px);line-height:1.3;text-align:right;font-weight:700;overflow-wrap:anywhere;color:#F5F6F7}#general-error{color:#FFB4AB;margin:0;line-height:1.4}#general-error:empty{display:none}#general-units{align-self:flex-start;color:#FFBE45;border:0;background:transparent;padding:0;min-height:30px;font-size:17px}.keypad{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.keypad button{min-height:52px;font-size:25px;padding:7px}.keypad #general-clear{grid-column:span 2}.keypad #general-clear,.keypad #general-history,.keypad [data-general-key=Feet],.keypad [data-general-key=Inch],.keypad [aria-label="Space"],.keypad [aria-label="Fraction Slash"]{font-size:17px}button:disabled{opacity:.45;cursor:default}.history-record{border:1px solid #69737C;border-radius:10px;padding:16px;background:#22272B;font-size:20px;font-weight:600;overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.5}@media(max-width:720px){.tool-bar{gap:10px}.precision-control{max-width:138px}.tool-bar>button{padding:10px}.keypad{gap:6px}.general-display{padding:12px}dialog{padding:16px}.dialog-header{align-items:start}.dialog-header button{flex-shrink:0}}

.diagram-heading{color:#F5F6F7;font-size:19px;margin:24px 0 16px}.equal-offset-diagram{margin:0}.equal-offset-diagram .pipe{stroke:#FFBE45;stroke-width:3}.equal-offset-diagram .dimension{stroke:#F5F6F7;stroke-width:1}.equal-offset-diagram .witness{stroke:#C0C7CD;stroke-dasharray:3 3;fill:none}.equal-offset-diagram .leader{stroke:#C0C7CD;fill:none}.equal-offset-diagram .measurement{fill:#FFBE45}.diagram-expanded{display:grid;gap:12px}.diagram-expanded dd{text-align:left;color:#FFBE45;font-weight:400;overflow-wrap:anywhere}

.reference-choice{border:0;padding:0;margin:0 0 18px;min-width:0}.reference-choice legend{font-weight:600;margin-bottom:8px}.reference-choice>div{display:flex;gap:8px}.reference-choice button{flex:1;white-space:normal}#calculator-picker [data-page]+[data-page]{margin-top:8px}

.geometry-diagram{margin:0}.geometry-diagram .measurement{fill:#FFBE45}

#settings-open{flex:0 0 auto}.settings-precision{display:flex;gap:8px;flex-wrap:wrap}.settings-precision button{flex:1}#terminology>div{margin:0 0 22px}#terminology dt{font-weight:700;color:#F5F6F7;margin-bottom:6px}#terminology dd{text-align:left;font-weight:400;line-height:1.6}#settings-links a{display:block;min-height:48px;padding:12px 0;color:#FFBE45}#settings-close,#settings-disclaimer{display:block;width:100%;margin-top:16px}#settings-notice h2{margin-top:24px}#settings-precision-error,.entry-limit-error{color:#FFB4AB}.entry-limit-error:empty{display:none}.measurement-accessory{display:flex;flex-wrap:wrap;gap:6px;margin:-10px 0 20px}.measurement-accessory button{flex:1 1 20%;min-height:48px;margin:0!important;padding:8px}.measurement-accessory button:last-child{color:#FFBE45}#form .measurement-accessory+label{margin-top:8px}@media(max-width:450px){.tool-bar{flex-wrap:wrap}.tool-bar>button:first-child{flex-basis:60%}.precision-control{max-width:none;width:100%}.measurement-accessory button{flex-basis:22%}}

/* Shared screen chrome from accepted native App.tsx / PrecisionPreference.tsx.
   Calculator bodies and keypads remain a separate visual parity group. */
#app-shell{width:100%;max-width:650px;margin:0 auto;padding:calc(18px + env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
#app-shell.general-shell{padding:calc(10px + env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
.app-header{display:block;max-width:none;margin:0 0 16px;padding:10px 0;border:0}
.app-header h1{margin:0;color:#FFBE45;font-size:30px;font-weight:800;line-height:1.2}
.general-shell .app-header{padding:0;margin-bottom:8px}
.general-shell .app-header h1{font-size:14px;font-weight:700;letter-spacing:0;line-height:1.2}
#app-shell .tool-bar{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;margin:0 0 16px}
#app-shell.general-shell .tool-bar{margin-bottom:8px}
#choose-calculator{flex:1;min-width:0;padding:16px;background:#22272B;border:1px solid #69737C;border-radius:14px;text-align:left;font-size:21px;font-weight:700;line-height:1.2}
.general-shell #choose-calculator{padding:10px}
#app-shell #settings-open{flex:0 0 44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;text-align:center;color:#C0C7CD;font-size:25px;font-weight:400}
#offline-notice{display:block;width:100%;min-height:44px;margin:0 0 12px;padding:8px 10px;border-color:#FFBE45;text-align:left;color:#FFBE45;font-size:14px;line-height:1.35}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
dialog.native-screen{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;border:0;border-radius:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:#16191C;color:#F5F6F7;overscroll-behavior:contain}
#calculator-picker[open]{display:flex;flex-direction:column;overflow:hidden}
#calculator-picker .dialog-header{display:flex;flex-direction:column;align-items:stretch;gap:12px;margin:0;padding:18px;flex-shrink:0}
#calculator-picker h2,#calculator-picker h3,#settings h2,#settings h3{font-size:21px;font-weight:700;line-height:1.25;color:#F5F6F7;margin:0}
#calculator-picker nav{display:block;overflow-y:auto;min-height:0;width:100%;max-width:650px;margin:0 auto;padding:18px 18px 40px}
#calculator-picker section{display:flex;flex-direction:column;gap:10px;margin:0 0 16px}
#calculator-picker [data-page],#picker-close,#settings-back,#settings .settings-precision button{width:100%;min-height:50px;padding:14px 12px;border:1px solid #69737C;border-radius:10px;background:#2C3237;text-align:center;font-size:16px;font-weight:600;line-height:1.4;white-space:normal}
/* Picker choices are intrinsic-height column items, never responsive nav tiles. */
#calculator-picker [data-page],#picker-close{flex:0 0 auto;line-height:1.25}
#calculator-picker section:last-child{margin-bottom:0}
#calculator-picker [aria-pressed=true]{font-weight:800}
/* Initial modal focus announces the heading; interactive keyboard focus stays visible. */
#picker-title:focus{outline:none}
#calculator-picker [data-page]+[data-page]{margin:0}
#calculator-picker [aria-pressed=true],#settings .settings-precision [aria-pressed=true]{background:#FFBE45;border-color:#FFBE45;color:#171A1D}
#settings{overflow-y:auto}
#settings-main,#settings-notice{display:flex;flex-direction:column;gap:18px;padding:18px}
#settings h3.settings-label{font-size:16px;font-weight:600}
#settings .settings-precision{display:flex;flex-direction:column;gap:18px}
#settings p,#settings dl{margin:0;font-size:15px;line-height:22px;color:#C0C7CD}
#settings-precision-error:empty{display:none}
#settings #settings-precision-error{color:#FFB4AB}
#terminology{display:flex;flex-direction:column;gap:18px}
#terminology>div{margin:0}#terminology dt{font-size:15px;line-height:22px;margin:0}#terminology dd{font-size:15px;line-height:22px;margin:0}
#settings-links{display:flex;flex-direction:column;gap:18px}
#settings-links a,#settings-disclaimer{min-height:44px;padding:12px 0;color:#F5F6F7;font-size:16px;font-weight:600;line-height:22px;text-align:left;text-decoration:none}
#settings-disclaimer{margin:0;border:0;background:transparent}
#settings-close{margin:0;min-height:56px;padding:17px;background:#FFBE45;border:0;border-radius:10px;color:#171A1D;font-size:19px;font-weight:800}
#settings #settings-terms{color:#F5F6F7}
#offline-details{border-top:1px solid #69737C;padding-top:18px;overflow-wrap:anywhere}
#offline-details summary{min-height:44px;padding:10px 0;cursor:pointer;font-weight:600}
#offline-details>*+*{margin-top:14px!important}#offline-details button{width:100%}
body:has(dialog.native-screen[open]){overflow:hidden}

/* Standard / Rolling bodies: accepted App.tsx and ResultList.tsx, scoped so
   other calculators retain their existing presentation pending separate review. */
#calculator.native-body{display:flex;flex-direction:column;gap:16px}
.native-body>.card{padding:16px;border-radius:14px;display:flex;flex-direction:column;gap:16px}
.native-body h2{margin:0;font-size:1.3125rem;font-weight:700;line-height:1.2}
.native-body #form,.native-body #fields{display:flex;flex-direction:column;gap:16px}
.native-body .geometry-choices,.native-body .reference-choice>div{display:flex;flex-wrap:wrap;gap:10px}
.native-body .reference-choice{margin:0;border:0;padding:0}
.native-body .reference-choice legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.native-body .geometry-choices button,.native-body #form .reference-choice button{flex:1 1 40%;min-width:0;min-height:50px;padding:14px 12px;margin:0;border-radius:10px;font-size:1rem;font-weight:600;line-height:1.2;overflow-wrap:anywhere}
.native-body .geometry-choices [aria-pressed=true],.native-body #form .reference-choice [aria-pressed=true]{font-weight:800}
.native-body .geometry-field-grid{display:flex;flex-wrap:wrap;gap:14px}
.native-body .geometry-field{width:100%;min-width:0;display:flex;flex-direction:column}
.native-body .geometry-field label{display:flex;flex-direction:column;justify-content:space-between;gap:8px;flex:1;margin:0;font-size:1rem;font-weight:600;line-height:1.2}
.native-body input{margin:0;border-radius:10px;padding:14px;font-size:1.5rem;font-weight:700;min-height:58px;line-height:normal;font-variant-numeric:tabular-nums}
.native-body #form>.primary{width:100%;margin:0;border:0;border-radius:10px;padding:17px;min-height:56px;font-size:1.1875rem;font-weight:800;line-height:1.2}
.native-body #error{margin:0;min-height:0;font-size:1rem;line-height:23px}
.native-body #error:empty,.native-body #result:empty,.native-body #measurement-hint,.native-body #note,.native-body [aria-label=Results]>h2{display:none}
.native-body>.has-result{border:2px solid #FFBE45}
.native-body #result dl{display:flex;flex-direction:column;gap:14px;border-bottom:1px solid #69737C;padding-bottom:16px;margin:0 0 8px}
.native-body #result dl>div{display:flex;flex-direction:column;gap:5px;padding:12px 0 0;border-bottom:0;border-top:1px solid #69737C}
.native-body #result dl>div:first-child{padding:0;border-top:0;gap:8px}
.native-body #result dt{font-size:1rem;font-weight:400;color:#C0C7CD}
.native-body #result dd,.native-body #result dl>div:first-child dd{font-size:1.5rem;font-weight:700;text-align:left;color:#F5F6F7;font-variant-numeric:tabular-nums}
.native-body .measurement-accessory{margin:8px 0 0;gap:6px}
.native-body .entry-limit-error{margin:8px 0 0}
.native-body #diagram{min-width:0;width:100%}
.native-body #diagram svg{margin:0;width:100%;height:auto}
@media(min-width:24.375em){.native-geometry:not(.android-fields) .geometry-field{width:47%;flex-grow:1}}


.native-body .diagram-heading{display:block;font-size:1rem;font-weight:600;margin:8px 0 16px;color:#F5F6F7}
.native-body[data-geometry-family=standard] #diagram{background:#191E22;border-radius:10px;padding:10px;display:flex;flex-direction:column;gap:8px}
.native-body[data-geometry-family=standard] .diagram-heading{font-size:1.1875rem}
.native-body[data-geometry-family=rolling] #diagram svg{margin-top:16px}

/* Remaining native calculator screens use stacked fields, with per-screen
   notes, choices and diagram spacing from their own source components. */
.native-body #fields>label,.native-body .native-size-field{display:flex;flex-direction:column;gap:8px;margin:0;font-size:1rem;font-weight:600;line-height:1.2}
.native-body #fields>label[data-input-kind=angle],.native-body[data-geometry-family=arc] #fields>label,.native-body .native-size-field{gap:16px}
.native-body .native-size-field label{margin:0;font-size:1rem;line-height:1.2}
.native-body .native-note{font-size:.9375rem;line-height:22px;color:#C0C7CD;margin:0}
.native-body:not(.native-geometry) .geometry-choices button,.native-body:not(.native-geometry) #form .reference-choice button{padding:14px;font-weight:600}
.native-body:not(.native-geometry) .reference-choice legend{position:static;width:auto;height:auto;overflow:visible;clip-path:none;margin:0 0 16px;font-size:1rem;line-height:1.2}
.native-body[data-geometry-family=round] .reference-choice legend,.native-body[data-geometry-family=square] .reference-choice legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
.native-body[data-geometry-family=mitred] .geometry-choices button{flex-basis:100%}
.native-body #form #mitred-size{width:100%;margin:0;text-align:left;background:#191E22;border-radius:10px;padding:14px;min-height:58px;font-size:1.5rem;font-weight:700}
.native-body[data-geometry-family=equalOffset] .diagram-heading,.native-body[data-geometry-family=equal90] .diagram-heading{font-size:1.1875rem}
.native-body[data-geometry-family=round] #diagram svg,.native-body[data-geometry-family=rolling90] #diagram svg{margin-top:16px}
.native-body[data-geometry-family=square] #diagram svg{width:calc(100% + 16px);max-width:none;margin-left:-8px;margin-right:-8px}
#pipe-size-picker[open]{display:flex;flex-direction:column;overflow:hidden}
.pipe-size-header{padding:18px;flex-shrink:0}
#pipe-size-cancel{width:100%;min-height:56px;border:0;border-radius:10px;background:#FFBE45;color:#171A1D;padding:17px;font-size:1.1875rem;font-weight:800}
.pipe-size-list{overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:14px}
.pipe-size-list h2{margin:0;font-size:1.3125rem;font-weight:700}
#pipe-size-choices{display:flex;flex-direction:column;gap:14px}
#pipe-size-choices button{width:100%;min-height:50px;padding:14px;border-radius:10px;font-size:1rem;font-weight:600}

/* Native General layout: six unchanged rows, responsive minimum target sizes,
   a reserved display and scrollable History. Large text may scroll vertically. */
.viewport-insets{position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
#general{max-width:none;--general-gap:8px;--key-height:48px;--display-height:164px;display:flex;flex-direction:column;gap:var(--general-gap)}
#general-chrome{display:flex;flex-direction:column;gap:var(--general-gap)}
#general h2{margin:0;font-size:1.625rem;font-weight:700;line-height:normal}
#general[data-compact=true] h2{font-size:1.375rem}
#general .general-modes{gap:6px;margin:0}
#general .general-modes button{min-height:36px;padding:6px;border-radius:10px;font-size:1rem;font-weight:600;line-height:normal}
#general[data-compact=true] .general-modes button{min-height:32px}
#general .general-display{padding:4px 10px;margin:0;gap:0;justify-content:space-between;min-height:var(--display-height)}
#general-expression{position:relative;font-size:1.625rem;line-height:normal;min-height:0;padding:4px 0;align-items:center;flex-shrink:0}
#general-entry{min-height:0;line-height:normal;min-width:24px;font:inherit;padding:0;flex-shrink:0}
#general-measure{position:absolute;visibility:hidden;white-space:pre;pointer-events:none;font:inherit}
#general-answer{min-height:0;font-size:3rem;line-height:58px;white-space:nowrap;overflow-x:auto;overflow-wrap:normal;flex-shrink:0}
#general-error{font-size:.9375rem;line-height:18px;padding:2px 0;margin:0}
#general-units{min-height:30px;font-size:1.125rem;line-height:22px;font-weight:600;margin:0;padding:0}
#general .keypad{display:flex;flex-direction:column;gap:var(--general-gap)}
.general-key-row{display:flex;gap:6px}
#general .keypad button{flex:1;min-width:0;min-height:var(--key-height);padding:6px;border-radius:10px;font-size:1.875rem;font-weight:600;line-height:normal;white-space:nowrap}
#general .keypad #general-clear{flex:2;grid-column:auto}
#history[open]{display:flex;flex-direction:column;overflow:hidden}
#history .dialog-header{padding:16px;display:flex;flex-direction:column;gap:12px;align-items:stretch;margin:0;flex-shrink:0}
#history-title{margin:0;font-size:1.375rem;font-weight:700}
#history-close,#history-clear{min-height:48px;border-radius:10px;padding:6px;background:#2C3237;font-weight:600;text-align:center}
#history-close{font-size:1.125rem}#history-clear{font-size:.875rem;color:#FFBE45}
.history-content{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}
#history-records{display:flex;flex-direction:column;gap:12px}
#history-records:empty{display:none}
#history-empty{margin:0;font-size:1rem;font-weight:600}
#history .history-record{margin:0;padding:22px 10px;font-size:1.25rem;font-weight:600;line-height:normal;border-radius:12px;background:#22272B}

/* Native measurement rows: optional Ft/In row, then Space, slash, minus, Done. */
.native-body .measurement-accessory{display:block;margin:0;gap:0;background:transparent}
.measurement-row{display:flex;flex-wrap:wrap;background:#2C3237;border-top:1px solid #69737C}
.native-body #form .measurement-row button{flex:1;min-width:44px;min-height:48px;margin:0;padding:10px 4px;border:0;border-right:1px solid #69737C;border-radius:0;font-size:min(1.125rem,27px);font-weight:600;line-height:normal}
.native-body #form .measurement-row button:last-child{border-right:0;color:#F5F6F7}
.native-body #form .measurement-row:last-child button:last-child{color:#FFBE45}
.native-body .measurement-accessory.measurement-docked{position:fixed;z-index:1000;margin:0;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);background:#2C3237}
html{scroll-padding-bottom:calc(var(--measurement-dock-space,0px) + 16px)}
body{padding-bottom:var(--measurement-dock-space,0px)}

#general{--general-text-scale:1}
#general .general-modes button{font-size:calc(16px * var(--general-text-scale))}
#general-expression{font-size:calc(26px * var(--general-text-scale))}
#general-units{font-size:calc(18px * var(--general-text-scale));line-height:calc(22px * var(--general-text-scale))}
