/* Gizmo World. Mobile first: the base style is the phone, larger screens only add. */
:root {
--bg: #f7f7fb;
--card: #ffffff;
--text: #1c1b2e;
--muted: #4f4e66;
--line: #cfcfe0;
--accent: #4338ca;
--accent-text: #ffffff;
--error: #b42318;
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme='light']) {
--bg: #14131f; --card: #1e1d2e; --text: #efeefa; --muted: #bdbcd6; --line: #3b3a55; --accent: #a5b4fc; --accent-text: #1e1b4b; --error: #ff8a80;
color-scheme: dark;
}
}
:root[data-theme='dark'] {
--bg: #14131f; --card: #1e1d2e; --text: #efeefa; --muted: #bdbcd6; --line: #3b3a55; --accent: #a5b4fc; --accent-text: #1e1b4b; --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; }
/* On a tool page the header line, with the Menu button at its end (top right), stays at the top of the screen while the page scrolls (owner, 2026-11-24). */
body[data-tool] .site-header { position: sticky; top: 0; z-index: 30; background: var(--bg); }
.header-tools { margin-inline-start: auto; }
.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[type='button']:focus-visible, input:focus-visible, select:focus-visible, h1:focus-visible, h3:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, input[type='button'], input[type='submit'], .button { 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, input[type='button']:hover, input[type='submit']:hover, .button:hover { filter: brightness(1.08); }
input[type='text'], input[type='number'], input[type='date'], select, textarea { 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; }
/* A row of buttons is plain inline buttons in one block, not a flex row: NVDA reads the items of a flex row one per line, and the buttons of an inline row as one line (owner, 2026-11-24). font-size 0 on the block removes the spaces between them; the gap is a margin on each. */
.row:not(.arrange-row) { display: block; font-size: 0; margin: 1rem 0; }
.row:not(.arrange-row) > * { vertical-align: top; margin-inline-end: 0.6rem; margin-bottom: 0.6rem; }
.row:not(.arrange-row) { margin-bottom: calc(1rem - 0.6rem); }
.row.arrange-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1em 0; }
.video-wrap video { width: 100%; max-height: 22rem; background: #000; border-radius: 0.6rem; }
.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; justify-content: center; text-align: center; }
.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'], input[type='number'], input[type='date'], select, textarea { 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[type='button'] { min-height: 2.5rem; padding: 0.35rem 0.9rem; }
/* a narrow phone: Home, the Theme list and Install stay on ONE line (the portable copy has all three), so the header does not grow and push the tool down */
@media (max-width: 480px) { .brand, .home-link { white-space: nowrap; } .site-header { gap: 0.5rem; flex-wrap: wrap; } .header-tools { flex-wrap: wrap; gap: 0.4rem; } .header-tools select { max-width: 6.8rem; } .header-tools input[type='button'] { padding-inline: 0.6rem; } }
.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 tools: a big read-out, the line for messages, the list of tools on the home page */
.display { font-size: 3.5rem; line-height: 1.1; font-weight: 700; text-align: center; margin: 1rem 0; font-variant-numeric: tabular-nums; }
.note { min-height: 1.6em; font-weight: 600; }
/* an empty result stays in the page (blank, not display:none): a live region that appears from nothing is often not announced by a screen reader */
.result:empty { min-height: 1.6em; padding: 0; border: 0; background: none; }
.result { font-size: 1.4rem; font-weight: 700; }
textarea { display: block; }
.row button, .row input[type='button'] { min-height: 3.25rem; min-width: 6.5rem; font-size: 1.1rem; }
/* Read aloud: Read, Paste and Clear always share one row, each taking a third of the width (owner, 2026-11-24). */
/* Three equal columns sized to fit from 280px wide, with equal gaps, and no wider than 26rem in total on large screens (the row is centred). */
/* Plain inline buttons in one block (not a grid or flex row, which NVDA reads one item per line): the three are read as one line, and drawn as three equal columns. font-size 0 on the block removes the spaces between them. */
body[data-tool="read"] .row { display: block; font-size: 0; white-space: nowrap; max-width: 26rem; margin-inline: auto; }
body[data-tool="read"] .row button, body[data-tool="read"] .row input[type='button'] { --gap: 0.6rem; box-sizing: border-box; display: inline-block; vertical-align: top; width: calc((100% - 2 * var(--gap) - 1px) / 3); min-width: 0; margin: 0; margin-inline-end: var(--gap); padding-inline: 0.4rem; font-size: 1.1rem; }
body[data-tool="read"] .row > :last-child { margin-inline-end: 0; }
#laps { list-style: none; padding-inline-start: 0; }

/* ---- The look: every tool has its own colour (--h is its hue). Icons and motion are decoration only: they are hidden from screen readers, and the motion stops for anyone who asks their device for less of it. */
.hue-timer { --h: 238; } .hue-coin { --h: 254; } .hue-dice { --h: 271; } .hue-yesno { --h: 287; } .hue-eightball { --h: 303; } .hue-letter { --h: 312; } .hue-card { --h: 328; }
.hue-read { --h: 336; } .hue-counter { --h: 353; } .hue-stopwatch { --h: 9; } .hue-clock { --h: 25; } .hue-picker { --h: 42; } .hue-random { --h: 58; }
.hue-bill { --h: 74; } .hue-percent { --h: 91; } .hue-breathing { --h: 107; } .hue-metronome { --h: 123; } .hue-tuner { --h: 33; } .hue-countdown { --h: 140; } .hue-daycount { --h: 156; }
.hue-age { --h: 173; } .hue-units { --h: 189; } .hue-wordcount { --h: 205; } .hue-password { --h: 222; }
.hue-qr { --h: 182; } .hue-selfie { --h: 345; } .hue-xo { --h: 16; }
body, .tool-list li, .title-row { --tool: hsl(var(--h, 245) 65% 29%); --tool-soft: hsl(var(--h, 245) 80% 94%); --tool-text: #ffffff; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme='light']) body, :root:not([data-theme='light']) .tool-list li, :root:not([data-theme='light']) .title-row { --tool: hsl(var(--h, 245) 85% 72%); --tool-soft: hsl(var(--h, 245) 35% 20%); --tool-text: #14131f; }
}
:root[data-theme='dark'] body, :root[data-theme='dark'] .tool-list li, :root[data-theme='dark'] .title-row { --tool: hsl(var(--h, 245) 85% 72%); --tool-soft: hsl(var(--h, 245) 35% 20%); --tool-text: #14131f; }
body { background: var(--bg) linear-gradient(180deg, hsl(245 90% 94%) 0, var(--bg) 24rem) no-repeat; }
:root[data-theme='dark'] body { background: var(--bg) linear-gradient(180deg, #25235a 0, var(--bg) 24rem) no-repeat; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) body { background: var(--bg) linear-gradient(180deg, #25235a 0, var(--bg) 24rem) no-repeat; } }
.brand { font-weight: 800; letter-spacing: 0.01em; }
/* A spin box with a minus and a plus button (the Timer's Hours, Minutes and Seconds); the buttons are for people who see the page */
.spin-row { display: flex; gap: 0.75rem; max-width: 28rem; margin: 0.9rem 0; }
.spin-field { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin: 0.9rem 0; }
.spin-row .spin-field { flex: 1 1 0; align-items: center; margin: 0; }
.spin-row .spin-field label { text-align: center; }
.spin-field label { order: 0; }
.spin-field button.step[data-step='1'] { order: 1; }
.spin-field input[type='text'], .spin-field input[type='number'] { order: 2; }
.spin-field button.step[data-step='-1'] { order: 3; }
.spin-field input[type='text'], .spin-field input[type='number'] { width: 100%; max-width: 5.5rem; text-align: center; font-weight: 700; }
button.step { min-width: 2.75rem; padding: 0; font-size: 1.5rem; line-height: 1; border-radius: 50%; touch-action: manipulation; user-select: none; -webkit-user-select: none; background-repeat: no-repeat; background-position: center; }
/* The + and − are drawn, not written: the button has no text, so its one name is the aria-label (TalkBack read text and name as two items). */
button.step[data-step='1'] { background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor); background-size: 1rem 2px, 2px 1rem; }
button.step[data-step='-1'] { background-image: linear-gradient(currentColor, currentColor); background-size: 1rem 2px; }
.counter-pm #add, .counter-pm #subtract { background-repeat: no-repeat; background-position: center; }
.counter-pm #add { background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor); background-size: 2.2rem 4px, 4px 2.2rem; }
.counter-pm #subtract { background-image: linear-gradient(currentColor, currentColor); background-size: 2.2rem 4px; }
/* A slider with its label before it and its number after it (the Timer's Hours, Minutes and Seconds) */
.slider-field { display: grid; grid-template-columns: 5.5rem 1fr 2.5rem; align-items: center; gap: 0.75rem; max-width: 28rem; }
.slider-field input[type='range'] { width: 100%; min-height: 2.75rem; accent-color: var(--tool, var(--accent)); }
.slider-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
/* Two short fields next to each other (Timer: minutes and seconds). Each keeps its own label; the order for a screen reader is the same. */
.pair { display: flex; gap: 1rem; }
.pair .field { flex: 1 1 0; max-width: 10rem; min-width: 0; }
.pair input[type='text'], .pair select { max-width: none; }
.tile { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 0.9rem; color: #fff; background: linear-gradient(145deg, hsl(var(--h, 245) 80% 56%), hsl(calc(var(--h, 245) + 35) 72% 40%)); box-shadow: 0 0.3rem 0.8rem -0.2rem hsl(var(--h, 245) 70% 30% / 0.5); }
.tool-icon { width: 1.6rem; height: 1.6rem; }
.title-row { display: flex; align-items: center; gap: 0.9rem; margin: 1rem 0 0.5rem; }
.title-row h1 { margin: 0; }
.title-row .tile { width: 3.5rem; height: 3.5rem; border-radius: 1.1rem; }
.title-row .tool-icon { width: 2rem; height: 2rem; }
body[data-tool] main button, body[data-tool] main input[type='button'] { background: var(--tool); border-color: var(--tool); color: var(--tool-text); border-radius: 0.9rem; box-shadow: 0 0.25rem 0 0 hsl(var(--h, 245) 60% 25% / 0.35); transition: transform 0.12s, box-shadow 0.12s, filter 0.12s; }
body[data-tool] main button:hover, body[data-tool] main input[type='button']:hover { filter: brightness(1.1); transform: translateY(-1px); }
body[data-tool] main button:active, body[data-tool] main input[type='button']:active { transform: translateY(3px); box-shadow: none; }
body[data-tool] .result { border-inline-start: 0.4rem solid var(--tool); background: var(--tool-soft); border-radius: 0.8rem; }
body[data-tool] .result:empty { background: none; border: 0; }
/* Short answers are shown big and centred: a letter, a coin side, yes or no, a number, dice, a 8 ball sentence (owner, 2026-11-19). */
body[data-tool="letter"] .result:not(:empty):not(.is-message), body[data-tool="coin"] .result:not(:empty):not(.is-message), body[data-tool="yesno"] .result:not(:empty):not(.is-message) { text-align: center; font-size: clamp(3.5rem, 24vw, 7rem); line-height: 1.1; padding: 1.2rem 0.75rem; margin-block: 1.4rem; }
body[data-tool="random"] .result:not(:empty):not(.is-message), body[data-tool="dice"] .result:not(:empty):not(.is-message) { text-align: center; font-size: clamp(2.6rem, 14vw, 4.5rem); line-height: 1.15; padding: 1rem 0.75rem; margin-block: 1.4rem; }
body[data-tool="eightball"] .result:not(:empty):not(.is-message) { text-align: center; font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 1.2; padding: 1.2rem 0.75rem; margin-block: 1.4rem; }
body[data-tool] h2 { border-top-color: var(--tool); }
body[data-tool] input[type='text']:focus, body[data-tool] input[type='number']:focus, body[data-tool] input[type='date']:focus, body[data-tool] select:focus, body[data-tool] textarea:focus { border-color: var(--tool); }
body[data-tool] .display { color: var(--tool); }

/* The list of tools on the home page: cards with a coloured icon, the short name as the link and the description under it. The whole card opens the tool. */
body:not([data-tool]) main { max-width: 64rem; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.tool-list li { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: center; padding: 0.9rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem; box-shadow: 0 0.15rem 0.5rem -0.2rem rgba(40, 30, 110, 0.25); }
.tool-list li .tile { grid-row: 1 / span 2; }
.tool-list a { font-size: 1.25rem; font-weight: 800; color: var(--text); text-decoration: none; }
/* The whole card is ONE link (the icon, the name and the description are inside it, and the padding is the link's own), so every point of the card is the link, the mouse (and NVDA's mouse reading) finds it anywhere, and there is no stretched layer and no dead space. */
/* No gaps between the tools (owner, 2026-11-22): the cards touch, a thin line inside each card separates it from the one above, and the space around the text is the link's own padding. On a phone the cards run from edge to edge. */
.tool-list li:not(:has(.move-buttons)) { display: block; padding: 0; border: 0; border-radius: 0; box-shadow: inset 0 1px 0 var(--line); }
.tool-list li:last-child:not(:has(.move-buttons)) { box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
.tool-list li:has(.move-buttons) { border-width: 1px 0 0; border-radius: 0; box-shadow: none; }
.tool-list li:last-child:has(.move-buttons) { border-bottom-width: 1px; }
@media (max-width: 575.98px) { .tool-list { margin: 0 -1rem; } }
.tool-list li:not(:has(.move-buttons)) > a { display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: center; padding: 0.9rem 1rem; border-radius: inherit; }
.tool-list li:has(.move-buttons) > a { display: contents; }
.tool-list li:has(.move-buttons) .tool-name { grid-column: 2; }
.tool-list .tool-desc { font-weight: 400; }
.tool-list a:focus-visible { outline: none; }
.tool-list li:focus-within { outline: 3px solid var(--tool); outline-offset: -3px; }
.tool-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.35; }
@media (min-width: 36rem) { .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .tool-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: no-preference) {
.tool-list li { transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s; animation: rise 0.5s both; animation-delay: calc(var(--h, 0) * 1.1ms); }
.tool-list li:hover { transform: translateY(-4px); box-shadow: 0 0.8rem 1.4rem -0.6rem hsl(var(--h, 245) 60% 30% / 0.55); border-color: var(--tool); }
.tool-list li .tile { transition: transform 0.25s; }
.tool-list li:hover .tile { transform: rotate(-8deg) scale(1.12); }
.title-row .tile { animation: pop 0.5s both; }
@keyframes rise { from { opacity: 0; transform: translateY(0.8rem); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.5) rotate(-12deg); } 70% { transform: scale(1.12) rotate(4deg); } 100% { transform: none; } }
}
.header-tools .home-link { font-weight: 600; }
/* the small pictures before Home and Tools (hidden from a screen reader, the words stay) */
.nav-icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-inline-end: 0.35em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.speak-option { margin: 1.5rem 0 0.25rem; line-height: 1.3; }
.speak-option + .speak-option { margin-top: 0.25rem; }

/* The Counter: minus and plus side by side on one line, Reset on the line below (owner, 2026-11-17). */
/* Plain inline buttons (not flex items): a screen reader treats a flex item as a line of its own, but reads inline buttons of one paragraph on ONE line. Reset is a block, so it is the next line. */
/* One-handed use (owner, 2026-11-17): Reset at the top (small, away from the thumb), then the number, then Plus and Minus big at the bottom where the thumb rests.
The page order, Tab and a screen reader follow the same order as the screen (the owner's rule): Reset, the number, Plus, Minus. */
.counter-area { display: flex; flex-direction: column; min-height: 26rem; min-height: 62svh; }
.counter-area > [role='region']:has(.counter-reset) { margin-bottom: 1rem; }
.counter-area > [role='region']:has(.counter-pm) { margin-top: auto; }
.counter-pm { display: block; text-align: center; }
.counter-pm #subtract, .counter-pm #add { display: inline-block; width: calc(50% - 0.6rem); min-width: 0; min-height: 5.5rem; font-size: 2.4rem; line-height: 1; vertical-align: top; }
.counter-pm #add { margin-right: 0.6rem; }
.counter-reset { display: block; text-align: center; }
.counter-reset #reset { min-width: 8rem; min-height: 3rem; font-size: 1rem; }
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
input[type='number']::-webkit-outer-spin-button, input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* The Timer's sliders: Hours, Minutes and Seconds on ONE line; in each column, top to bottom: the label, Plus above, the slider, Minus below (the page order is the same). */
.spin-row:has(input[type='range']) { flex-direction: row; max-width: 28rem; gap: 0.6rem; }
.spin-row .spin-field:has(input[type='range']) { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; gap: 0.4rem; margin: 0; }
.spin-row .spin-field:has(input[type='range']) label { order: 0; text-align: center; flex: none; }
.spin-row .spin-field:has(input[type='range']) button.step[data-step='1'] { order: 1; }
.spin-field input[type='range'] { order: 2; flex: none; width: 100%; min-width: 0; max-width: none; min-height: 2.75rem; accent-color: var(--accent, currentColor); }
.spin-row .spin-field:has(input[type='range']) button.step[data-step='-1'] { order: 3; }

/* Times are always written left to right, also on the Hebrew pages (owner, 2026-11-17): Hours, Minutes, Seconds from left to right, and the clock digits. */
.spin-row, .display { direction: ltr; }

/* A slider is always drawn left to right (low to high), also on Hebrew pages. */
.spin-field input[type='range'] { direction: ltr; }

/* Dice (owner, 2026-11-17): the two options on one line around the middle, the result under them, the Roll button at the bottom where the thumb rests. Page order = screen order. */
.dice-area { display: flex; flex-direction: column; min-height: 26rem; min-height: 62svh; }
.dice-row { display: flex; gap: 1rem; align-items: flex-start; margin-top: auto; }
.dice-row > .spin-field, .dice-row > .field { flex: 1 1 0; min-width: 0; margin: 0; }
.dice-row .field select { max-width: none; width: 100%; }
.dice-area > [role='region']:has(.dice-roll) { margin-top: auto; }
.dice-roll { text-align: center; }
.dice-roll #roll { width: 100%; min-height: 4.5rem; font-size: 1.6rem; }

/* A tool installed as an app (theme.js sets class tool-app on <html>): the links that leave the tool are not shown, and nothing offers to install what is already installed. */
html.tool-app #back-link, html.tool-app #back-link + .sep, html.tool-app .brand, html.tool-app .home-link, html.tool-app .web-only, html.tool-app #install-app, html.tool-app #install-steps { display: none; }

/* Arrange tools on the home page: Move up and Move down on each tool while arranging */
.arrange-row { margin: 0.5rem 0 0.25rem; }
#arrange-status:empty { min-height: 0; margin: 0; }
.home-lead { margin: 0.2rem 0 0.9rem; font-size: 1.1rem; opacity: 0.85; }
.tool-list .move-buttons { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; position: relative; z-index: 1; }
.tool-list .move-buttons button, .tool-list .move-buttons input[type='button'] { display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.5rem; padding: 0.3rem 0.7rem; font-size: 1.25rem; line-height: 1.2; font-weight: 700; }
.tool-list li .tool-desc { grid-column: 2; }
/* A tool the person hid: gone from the page, but shown dimmed with a dashed edge while editing, so it can be shown again (home.js). [hidden] must beat the grid display above. */
.tool-list li[hidden] { display: none; }
.tool-list li.tool-off { border-style: dashed; }
.tool-list li.tool-off .tile, .tool-list li.tool-off > a, .tool-list li.tool-off .tool-desc { opacity: 0.55; }
.tool-list .move-buttons [hidden] { display: none; }
.tool-list li:has(.move-buttons) .tile { grid-row: 1 / span 3; }

/* Dragging a tool by its grip while arranging (home.js) */
.tool-list li .grip { position: absolute; inset-inline-end: 0.5rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 2.75rem; height: 3.5rem; color: var(--muted, currentColor); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; z-index: 2; }
.tool-list li.dragging { z-index: 5; opacity: 0.92; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28); }
.tool-list li.dragging .grip { cursor: grabbing; }
.tool-list li.drop-before { box-shadow: 0 -5px 0 0 var(--tool); }
.tool-list li.drop-after { box-shadow: 0 5px 0 0 var(--tool); }
body.is-dragging { user-select: none; -webkit-user-select: none; cursor: grabbing; }

/* The Privacy page, opened from a tool installed as an app: a Back button at the top, always in view (theme.js sets class tool-app) */
.app-back-row { display: none; margin: 0; padding: 0.5rem 0.75rem; position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
html.tool-app .app-back-row { display: block; }

/* The Sort row: Sort at the start (left in English, right in Hebrew); while sorting, Done at the start and Reset at the end of one line */
.arrange-row { justify-content: flex-start; }.arrange-row.is-sorting { flex-wrap: nowrap; justify-content: space-between; }
/* Show all and Reset order sit together at the end of the line (Show all first, so it is left of Reset order in English and right of it in Hebrew) */
.arrange-end { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; min-width: 0; }
.arrange-end[hidden], .arrange-end [hidden] { display: none; }

/* THUMB REACH (owner, 2026-11-17): on a phone or any touch screen the main action of a tool (class thumb-action: the small fields and the button, or the row of buttons) stays at the bottom of the screen,
where the thumb rests: in a short tool it sits at the bottom of the page, in a tall one it sticks to the bottom while the rest scrolls. The page order is the same as the screen order. */
@media (max-width: 700px), (pointer: coarse) {
.tool-area { display: flex; flex-direction: column; min-height: 60svh; }
.tool-area .thumb-action { position: sticky; bottom: 0; z-index: 5; background: var(--bg); border-top: 1px solid var(--line); padding: 0.4rem 0 max(0.5rem, env(safe-area-inset-bottom)); }
.tool-area > .thumb-action { margin-top: auto; }
/* a row of buttons that sits inside a group of fields: the group fills the area and the row is at its bottom */
.tool-area > [data-enter-region]:has(.thumb-action) { flex: 1 1 auto; display: flex; flex-direction: column; margin-top: auto; }
.tool-area > [data-enter-region] > .thumb-action { margin-top: auto; }
html:has(.tool-area) { scroll-padding-bottom: 12rem; }
}

/* The Edit button of the home page: a small hand (a picture only) and the word */
/* Edit is a plain input button whose value is the word Edit (a screen reader reads it once); only the pencil is drawn, as a background picture, and the word is not shown (font-size 0, like the arrow buttons). White pencil on the dark button, dark on the light button of the dark theme. */
#arrange-start { width: 3rem; min-width: 3rem; padding: 0; font-size: 0; color: transparent; background-repeat: no-repeat; background-position: center; background-size: 1.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19.5 8.5a2.1 2.1 0 0 0-3-3L5 17z'/%3E%3Cpath d='M14.5 7.5l3 3'/%3E%3C/g%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) #arrange-start { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%231e1b4b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19.5 8.5a2.1 2.1 0 0 0-3-3L5 17z'/%3E%3Cpath d='M14.5 7.5l3 3'/%3E%3C/g%3E%3C/svg%3E"); } }
:root[data-theme='dark'] #arrange-start { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%231e1b4b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19.5 8.5a2.1 2.1 0 0 0-3-3L5 17z'/%3E%3Cpath d='M14.5 7.5l3 3'/%3E%3C/g%3E%3C/svg%3E"); }

/* A bigger grip (owner, 2026-11-17, a friend could not drag): the whole height of the card at its end, wide enough for a finger; the picture inside does not take the touch itself */
.tool-list li:has(.grip) { padding-inline-end: 3.9rem; }
.tool-list li .grip { inset-block: 0; inset-inline-end: 0; top: 0; bottom: 0; transform: none; width: 3.5rem; height: auto; border-radius: 0 1rem 1rem 0; -webkit-touch-callout: none; touch-action: none; }
[dir='rtl'] .tool-list li .grip { border-radius: 1rem 0 0 1rem; }
.tool-list li .grip svg { pointer-events: none; }

/* The Clock: the date under the time */
.clock-date { text-align: center; font-size: 1.25rem; margin: 0 0 1rem; }

/* The Timer: the line under its time that says Time is up (empty, but there, until then) */
.alert-line { text-align: center; font-size: 1.6rem; font-weight: 700; margin: 0.25rem 0 1rem; min-height: 1.6em; color: var(--tool, inherit); }

/* The Random picker: the picked name, large, right under the lead line */
.pick-result { text-align: center; font-size: 2.6rem; font-weight: 800; line-height: 1.2; min-height: 1.3em; margin: 0.5rem 0 1rem; overflow-wrap: anywhere; color: var(--tool, inherit); }

/* A small question box (the Random picker asks before it clears the list) */
dialog { border: 2px solid var(--line, #bbb); border-radius: 0.8rem; padding: 1rem 1.25rem; background: var(--bg, #fff); color: var(--text, inherit); max-width: 22rem; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog-buttons { display: block; font-size: 0; margin: 1rem 0 0; }
.dialog-buttons > input { font-size: 1rem; margin-inline-end: 0.6rem; }
/* The Menu is as wide as its content needs (the footer items stay on one row), up to the width of the screen (owner, 2026-11-24). */
#options-panel { width: max-content; max-width: calc(100% - 1.5rem); }

/* Move up and Move down (owner, 2026-11-18): a real input button on top of a drawn arrow. The wrapper looks like the button and draws the arrow in the text colour, so it follows the theme;
the input is transparent, covers the wrapper, and has the name (aria-label), the focus and the click. */
.arrow-wrap { position: relative; display: inline-block; min-width: 2.75rem; min-height: 2.5rem; padding: 0; }
.arrow-wrap::before { content: ""; position: absolute; inset: 0; margin: auto; width: 1.25rem; height: 1.25rem; background: currentColor; pointer-events: none;
-webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat; }
.arrow-wrap.arrow-up { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E"); }
.arrow-wrap.arrow-down { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M19 12l-7 7-7-7'/%3E%3C/svg%3E"); }
.arrow-wrap > input[type='button'] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; box-shadow: none; color: transparent; cursor: pointer; font-size: 0; filter: none; min-width: 0; min-height: 0; }
.arrow-wrap:has(> input:focus-visible) { outline: 3px solid #f90; outline-offset: 2px; }
/* The Show tick box of each tool while editing the home page (home.js): a real tick box with its label, big enough for a finger */
.show-check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.2rem 0.5rem; font-weight: 600; }
.show-check input { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; }
.show-check label { cursor: pointer; }
/* The move buttons: Up, then Down (the order of the Tab key and of the screen, mirrored in Hebrew), each in its own slot; the Show box is always on its own line below. */
.move-buttons { direction: ltr; } /* Up, then Down, from left to right in Hebrew too (owner, 2026-11-22: Hebrew the same as English) */
[dir='rtl'] .move-buttons .show-check { direction: rtl; }
.move-buttons .arrow-ghost { display: inline-block; min-width: 2.75rem; min-height: 2.5rem; visibility: hidden; }
.move-buttons .show-check { flex-basis: 100%; }
.hidden-info { margin-top: 1.25rem; font-size: 0.95rem; font-weight: 400; opacity: 0.85; }
.hidden-info[hidden] { display: none; }

/* THE INSTALLED APP only (display-mode: standalone), home page (owner, 2026-11-22): the title "Gizmo World – online tools" and the line "Accessible tools for everyday use." are not drawn and not read; the website keeps them. */
@media (display-mode: standalone) {
body:not([data-tool]) main > #title, body:not([data-tool]) .home-lead { display: none; }
/* Edit (Save while editing) is drawn at the top right, in the header line, ONLY in the app (owner, 2026-11-22). It is the same button as on the website, in the same place in the page (right after the header); the line around it takes no space of its own, and Show all and Reset order stay in the page flow below while editing. */
body:not([data-tool]) { position: relative; }
body:not([data-tool]) .arrange-row { display: contents; }
body:not([data-tool]) #arrange-start, body:not([data-tool]) #arrange-done { position: absolute; top: 12px; inset-inline-end: 1rem; margin: 0; z-index: 2; }
body:not([data-tool]) .arrange-end { margin: 0.5rem 0; }
}

/* THE HOME PAGE ON THE WEB: the least empty space above the tools that still reads comfortably (owner, 2026-11-23): about 8px between neighbours, 4px between the title and the line under it. */
body:not([data-tool]) main > #title { margin: 1rem 0 0.375rem; }
body:not([data-tool]) .home-lead { margin: 0 0 0.625rem; }
body:not([data-tool]) .arrange-row { margin: 0 0 0.25rem; }

/* EDIT MODE of the home page (owner, 2026-11-23): each tool is TWO lines. Line 1: the name, a short dash and the description, all on one line and cut with "..." when it is too long. Line 2: Up, Down and the Show box, side by side, starting at the card's left edge. The drag handle only covers line 1. The dash is drawn by the stylesheet in front of the description, which a screen reader does not read, so the link's name stays just the tool's name. */
.tool-list li:has(.move-buttons) { display: block; padding: 0.9rem 1rem; }
.tool-list li:has(.move-buttons) > a { display: flex; align-items: center; gap: 0.35rem; min-width: 0; margin-inline-end: 3rem; white-space: nowrap; font-size: 1.05rem; }
.tool-list li:has(.move-buttons) .tile { flex: none; margin-inline-end: 0.55rem; }
.tool-list li:has(.move-buttons) .tool-name { flex: none; }
.tool-list li:has(.move-buttons) .tool-desc { display: block; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
.tool-list li:has(.move-buttons) .tool-desc::before { content: '\2013\00a0'; }
.tool-list li:has(.move-buttons) .move-buttons { margin: 0.5rem 0 0; flex-wrap: wrap; align-items: center; }
.tool-list li:has(.move-buttons) .show-check { flex-basis: auto; padding: 0.2rem 0.25rem; }
.tool-list li:has(.grip) .grip { bottom: auto; height: 3.75rem; }
/* On the very narrowest screens (under 375px) the Show box does not fit beside the arrows for the longer tool names, so on those screens it is under the arrows for EVERY tool, and the cards stay alike. */
@media (max-width: 374px) { .tool-list li:has(.move-buttons) .show-check { flex-basis: 100%; } }

/* ALL THE HOME CARDS ARE THE SAME HEIGHT (owner, 2026-11-23): the name on one line, the description on at most two lines (cut with "..." when longer; a screen reader still gets the whole text), and a fixed height of 6.3rem (about 101px, it grows with the reader's text size). Edit mode has its own two-line layout above. */
.tool-list li:not(:has(.move-buttons)) > a { height: 6.3rem; overflow: hidden; }
.tool-list li:not(:has(.move-buttons)) .tool-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-list li:not(:has(.move-buttons)) .tool-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* The Options button of a tool: a small dot in its corner while Speak results aloud or Notify is on */
/* The Menu button is a hamburger drawn with three gradient lines in the text colour (no text, no markup inside; its one name is the aria-label). */
#options-btn { width: 2.75rem; min-width: 2.75rem; padding: 0; font-size: 0; background-repeat: no-repeat;
background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
background-size: 1.2rem 2px, 1.2rem 2px, 1.2rem 2px; background-position: center calc(50% - 0.4rem), center 50%, center calc(50% + 0.4rem); }
#options-btn.on { background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), radial-gradient(circle at calc(100% - 0.45rem) 0.45rem, var(--accent-text) 0.22rem, transparent 0.25rem);
background-size: 1.2rem 2px, 1.2rem 2px, 1.2rem 2px, 100% 100%; background-position: center calc(50% - 0.4rem), center 50%, center calc(50% + 0.4rem), 0 0; }
/* In an installed app the footer line of a tool page is not shown: its Theme list and links are in the Menu (footer.js moves them there and adds footer-in-menu). In a browser tab the footer stays. */
body.footer-in-menu .site-footer { display: none; }
#options-form .menu-part { margin: 0.4rem 0; }
/* The guitar tuner: the answer big and centred, the cents under it, the six string buttons always on one row */
body[data-tool="tuner"] .result { text-align: center; font-size: clamp(2rem, 10vw, 2.8rem); line-height: 1.2; min-height: 4.2rem; padding: 1rem 0.75rem; margin-block: 1.4rem 0.4rem; }
.cents-line { text-align: center; min-height: 1.5em; margin: 0 0 1rem; color: var(--muted); }
/* Plain inline buttons (not a flex row), so NVDA reads the six on one line like any row of buttons; the strings keep their order, lowest on the left, in Hebrew too. */
.strings { --gap: 0.25rem; direction: ltr; white-space: nowrap; margin: 0 0 1rem; font-size: 0; } /* a small gap between keys on every screen size */
.strings[hidden] { display: none; }
.strings input[type='button'] { box-sizing: border-box; width: calc((100% - 5 * var(--gap) - 1px) / 6); min-width: 0; margin: 0 var(--gap) 0 0; padding-inline: 0; text-align: center; vertical-align: top; font-size: 1rem; }
.strings input[type='button']:last-child { margin-right: 0; }
/* Any note: the keys of a piano in three rows of plain inline buttons: the octave buttons, the black keys (each over the gap between two white keys, with the gap between E and F left empty), the white keys. */
.strings.piano { --w: calc((100% - 6 * var(--gap) - 1px) / 7); }
.strings.piano .keys-row { margin-bottom: 0.4rem; }
.strings.piano input[type='button'] { width: var(--w); margin: 0 0 0 var(--gap); }
.strings.piano .white:first-child { margin-left: 0; }
.strings.piano .sharp:first-child { margin-left: calc((var(--w) + var(--gap)) / 2); }
.strings.piano .sharp.skip { margin-left: calc(var(--w) + 2 * var(--gap)); }
.strings.piano input.oct { width: calc(2 * var(--w) + var(--gap)); margin-left: 0; }
.strings.piano input.oct.up { margin-left: calc(3 * var(--w) + 4 * var(--gap)); }
/* From 500 px wide up (a landscape phone, a computer) the keys stop stretching across the page: a comfortable width, centred. Below 500 px they fill the width as before. */
@media (min-width: 500px) { .strings { max-width: 30rem; margin-inline: auto; } }
.strings.piano input.oct { font-size: 0.85rem; }

/* Read aloud: the reading screen (owner, 2026-11-24). While it reads, only this screen shows: Stop at the top (start side), the speed list at the other end, the text in pieces with the piece being
read marked and kept in the vertical middle of its box, and at the bottom, in one row, Previous paragraph, Previous sentence, Pause or Resume, Next sentence, Next paragraph. All in the normal flow
of the page: a full-height column, nothing is fixed or absolute except the button inside each icon (the same icon button as Move up and Move down). */
#reader[hidden] { display: none; }
body.reading-mode { overflow: hidden; }
body.reading-mode header, body.reading-mode footer, body.reading-mode #install-steps, body.reading-mode .title-row, body.reading-mode .lead, body.reading-mode .tool-area > :not(#reader):not(#status) { display: none; }
body.reading-mode main { max-width: none; padding: 0; }
body.reading-mode .tool-area { display: flex; flex-direction: column; height: 100dvh; }
#reader { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.reader-top { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.reader-top { gap: 0.4rem; padding-inline: 0.75rem; }
.reader-stop > span:empty, .reader-bar > span:empty { display: none; }
.reader-stop { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.4rem; }
.reader-top #status { flex: 1; min-width: 0; margin: 0; padding: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.reader-speed { display: flex; align-items: center; gap: 0.4rem; }
@media (max-width: 339px) { .reader-speed label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.reader-speed select { width: auto; min-height: 2.75rem; }
.reading-view { position: relative; overflow: auto; padding-inline: 1rem; font-size: 1.3rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.reading-view::before, .reading-view::after { content: ""; display: block; height: 50%; }
.reading-view .now { background: var(--accent); color: var(--accent-text); border-radius: 4px; }
.reader-bar { direction: ltr; display: flex; gap: 0.5rem; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.reader-bar .arrow-wrap { flex: 1 1 0; min-width: 0; min-height: 3.5rem; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); }
.reader-bar .arrow-wrap[hidden] { display: none; }
.reader-bar .arrow-wrap::before { width: 1.6rem; height: 1.6rem; }
.icon-prev-par { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M11 5L2 12l9 7zM21 5l-9 7 9 7z'/%3E%3C/svg%3E"); }
.icon-prev { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M7 5v14M19 5L9 12l10 7z'/%3E%3C/svg%3E"); }
.icon-pause { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M7 5h3.5v14H7zM13.5 5H17v14h-3.5z'/%3E%3C/svg%3E"); }
.icon-play { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M8 5l11 7-11 7z'/%3E%3C/svg%3E"); }
.icon-next { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M17 5v14M5 5l10 7-10 7z'/%3E%3C/svg%3E"); }
.icon-next-par { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M13 5l9 7-9 7zM3 5l9 7-9 7z'/%3E%3C/svg%3E"); }
body[data-tool] main .reader-bar .arrow-wrap > input[type='button'] { background: transparent; box-shadow: none; color: transparent; }
