/* calc.css — the shelf's own layer over /login/ui.css (tokens, wordmark, card,
   buttons, foot). A calculator page is: a headline, the controls, a comparison,
   one folded explanation, two actions. It scrolls like a document — no locked
   root, no fixed layers (IOS.md §15) — and it is a browser page, not an
   installed app. */

body { padding: 5vh 16px 40px; }
.page { max-width: 520px; align-items: stretch; }
.wordmark { margin-bottom: 14px; }
.wordmark.small { font-size: 15px; margin-bottom: 18px; align-self: flex-start; }
.wordmark.small .kind { color: var(--dim-2); font-weight: 600; margin-left: 6px; }

.title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.title .glyph { width: 44px; height: 44px; border-radius: var(--r-tile); background: var(--panel); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 24px; flex: none; }
.title h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.title p { margin: 2px 0 0; color: var(--dim); font-size: 14px; }

.card { padding: 18px 18px 16px; margin-bottom: 14px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 0 0 12px; font-weight: 600; }

/* The headline: one big number in the rounded face, then the sentence that
   says what it means. Nothing else on the page is this size. */
.hero .big { font-family: var(--font-round); font-weight: 700; font-size: clamp(2.2rem, 11vw, 3rem); letter-spacing: -0.02em; line-height: 1.05; margin: 0; font-variant-numeric: tabular-nums; }
.hero .big small { display: block; font-size: .42em; font-weight: 600; color: var(--dim); letter-spacing: 0; margin-top: 2px; }
.hero .say { margin: 8px 0 0; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.hero .say b { color: var(--ink); font-weight: 600; }
.hero .say.warn b { color: var(--warn); }
.hero .say.bad b { color: var(--bad); }
.hero .say.good b { color: var(--good); }

/* A field: label and value on one line, the value a real number input that
   opens the keypad; a range under it; preset chips under that. */
.field { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; padding-top: 0; }
.field .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field .head label { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.field .val { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.field .val input { width: 6.5ch; min-width: 4ch; text-align: right; font: 600 20px var(--font-round); color: var(--ink); background: none; border: 0; border-bottom: 1.5px solid var(--line); padding: 0 2px; outline: none; -moz-appearance: textfield; appearance: textfield; }
.field .val input:focus { border-bottom-color: var(--link); }
.field .val input::-webkit-outer-spin-button, .field .val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field .val .unit { font-size: 14px; color: var(--dim); font-weight: 500; }
.field .val .pre { font-size: 18px; color: var(--dim); font-weight: 600; font-family: var(--font-round); }
.field input[type=range] { width: 100%; margin: 12px 0 0; display: block; accent-color: var(--link); height: 28px; touch-action: pan-x; }
.field input[type=time] { font: 700 26px var(--font-round); color: var(--ink); background: var(--pill); border: 0; border-radius: 10px; padding: 6px 12px; outline: none; min-width: 8.5ch; width: auto; }
.field input[type=date] { font: 600 17px var(--font-round); color: var(--ink); background: var(--pill); border: 0; border-radius: 10px; padding: 7px 12px; outline: none; width: 13ch; min-width: 13ch; }
.field input[type=time]::-webkit-calendar-picker-indicator, .field input[type=date]::-webkit-calendar-picker-indicator { display: none; }
.field.time .head { justify-content: space-between; }
.field.time .head label:empty { display: none; }
.field.time .head:has(label:empty) { justify-content: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button { padding: 6px 11px; font-size: 13px; background: var(--pill); color: var(--ink-2); border-radius: 999px; font-weight: 500; min-height: 0; }
.chips button.on { background: var(--ink); color: var(--bg); }

/* Segmented: two or three ways to ask the same question. */
.seg { display: flex; background: var(--pill); border-radius: 10px; padding: 3px; gap: 2px; margin: 0 0 14px; }
.seg button { flex: 1; padding: 8px 6px; font-size: 14px; font-weight: 600; background: none; color: var(--ink-2); border-radius: 8px; min-height: 0; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Rows of results: name left, number right, an optional second line. */
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li .n { color: var(--ink-2); flex: 1 1 55%; }
.rows li .n small { display: block; color: var(--dim); font-size: 13px; margin-top: 1px; }
.rows li .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; flex: 0 1 auto; max-width: 48%; }
.rows li .v small { display: block; color: var(--dim); font-weight: 500; font-size: 13px; }
.rows li.best .v { color: var(--good); }
.rows li.worst .v { color: var(--bad); }
.rows li .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }

/* Times: a row of tap-sized cards, the number the point. */
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.times .t { background: var(--panel-2); border-radius: var(--r-mid); padding: 12px 8px; text-align: center; }
.times .t b { display: block; font: 700 22px var(--font-round); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.times .t span { display: block; font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.times .t.pick { outline: 2px solid var(--link); outline-offset: -2px; }

/* The chart is a plain SVG drawn by the page: 2px lines, a recessive grid,
   labels at the line ends, a crosshair readout above it under a finger. */
.chart { width: 100%; height: auto; display: block; margin-top: 6px; touch-action: pan-y; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--dim); font-size: 11px; font-family: var(--font); }
.chart .s { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .lab { font-size: 11.5px; font-weight: 600; font-family: var(--font); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.chart .cross { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.readout { min-height: 20px; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; display: flex; gap: 12px; flex-wrap: wrap; }
.readout b { color: var(--ink-2); font-weight: 600; }
:root { --s1: #b91c6b; --s2: #007aff; --s3: #c2570a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #e0559a; --s2: #0a84ff; --s3: #d9782a; } }
:root[data-theme="dark"] { --s1: #e0559a; --s2: #0a84ff; --s3: #d9782a; }

/* The fold: what is worth reading, folded, in the shape every app's
   Technical uses. Prose lives here and nowhere else on the page. */
details.fold { background: var(--panel); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: 14px; }
details.fold summary { padding: 15px 18px; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "›"; color: var(--dim); font-size: 20px; transform: rotate(90deg); transition: transform .15s; }
details.fold[open] summary::after { transform: rotate(-90deg); }
details.fold .body { padding: 0 18px 16px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
details.fold .body p { margin: 0 0 10px; }
details.fold .body p:last-child { margin-bottom: 0; }
details.fold .body table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 6px 0 10px; }
details.fold .body td, details.fold .body th { padding: 5px 0; border-top: 1px solid var(--line); text-align: left; font-size: 13.5px; }
details.fold .body th { color: var(--dim); font-weight: 500; border-top: 0; }
details.fold .body td.num, details.fold .body th.num { text-align: right; }

/* Two actions, one row: pin here, share the scenario. */
.actions { display: flex; gap: 8px; margin: 4px 0 18px; }
.actions button { flex: 1; }
.actions button.ghost.on { background: var(--ink); color: var(--bg); }
.actions button .ok { display: none; }
.actions button.on .ok { display: inline; }
.actions button.on .no { display: none; }

.foot { text-align: center; }

/* The shelf */
.tiles { display: grid; gap: 10px; width: 100%; }
.tile { display: flex; align-items: center; gap: 14px; background: var(--panel); border-radius: var(--r-mid); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.tile:active { background: var(--panel-2); }
.tile .glyph { width: 42px; height: 42px; border-radius: var(--r-tile); background: var(--panel-2); display: grid; place-items: center; font-size: 22px; flex: none; }
.tile b { font-size: 16px; display: block; }
.tile span { font-size: 13.5px; color: var(--dim); line-height: 1.4; }
.lead { color: var(--ink-2); font-size: 15.5px; line-height: 1.5; margin: 0 0 16px; }

/* Ready-made drives (speed): two by two, a name and the drive under it. */
.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.scenes .scene { background: var(--panel); border-radius: var(--r-mid); box-shadow: var(--shadow); padding: 12px 14px; text-align: left; color: var(--ink); min-height: 0; display: block; }
.scenes .scene b { display: block; font-size: 15px; }
.scenes .scene span { display: block; font-size: 13px; color: var(--dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.scenes .scene.on { outline: 2px solid var(--link); outline-offset: -2px; }
.card h2 .hint { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--dim-2); }
.chart.tall { touch-action: none; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.chart.tall text { pointer-events: none; }
/* a drag on the chart must not start a text selection on the page around it */
body.dragging, body.dragging * { user-select: none !important; -webkit-user-select: none !important; }
.chart .zone { fill: var(--dim); font-size: 10.5px; font-weight: 600; font-family: var(--font); }
details.fold .body .field:first-of-type { padding-top: 4px; }
details.fold .body h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 0 0 6px; font-weight: 600; }
