/*
 * NoiseHaven: the tool's own components, styled in the site's design language (12 Nov 2026, automatic mode, on the
 * UltraCompress Pro template). The first part copies MicroTools' shared block (tokens, page, hero, buttons, toolbar and pill
 * tabs, fields, toasts, information sections). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, theme toggle,
 * focus rings) and /libs/shared-nav.css (the site's header and footer). The second part is the original's components (the
 * sound stage, your mix, the library, the panels of Sleep and Tones, the focus dial, the saved mixes, the windows and the
 * night screens) on the site's tokens: the original's ink-black buttons and chips became the site's gradient pills, its own
 * header, bottom tab bar on phones and footer are gone, and its player bar, fixed at the foot of the screen, now stays under
 * the site's header while the tool is on the screen. The original already kept to the site's one-layer rule (panels are a
 * line, not a frame). The stage's colours (--face, --ring, --head-ink, --label, --series ...) are read by stage.js. Light
 * is the default; dark applies when <html> has no data-theme. Written once from MicroTools' file and the original's styles,
 * then edited by hand: this file is the source.
 */


/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --glow: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --line: rgba(0, 0, 0, 0.1);
    --line-strong: rgba(0, 0, 0, 0.24);
    --ok: #166534;
    --bad: #b91c1c;
    --warn: #92400e;
    --head: 81px;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    /* the original's names, on the site's tokens */
    --panel: var(--surface);
    --muted: var(--text-2);
    --faint: var(--text-3);
    --border: var(--line);
    --border-strong: var(--line-strong);
    --focus: #7c3aed;
    /* the stage, the spectrum and the charts (read by stage.js) */
    --face: #ffffff;
    --ring: #e3e6ea;
    --ring-2: #eef0f3;
    --head-ink: #16191f;
    --label: #6b7280;
    --series: #7c3aed;
    --series-2: #0ea5e9;
    --series-wash: rgba(124, 58, 237, 0.1);
    --axis: #c8cad3;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.26);
    --ok: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --focus: #c4b5fd;
    --face: #05050b;
    --ring: #262635;
    --ring-2: #15151f;
    --head-ink: #e5e7eb;
    --label: #9ca3af;
    --series: #a78bfa;
    --series-2: #38bdf8;
    --series-wash: rgba(167, 139, 250, 0.14);
    --axis: #3a3a48;
}
@media (max-width: 639.98px) { :root { --head: 65px; } }

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container { max-width: calc(var(--app-max) + 2 * var(--content-gutter)); margin-top: 16px; }
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- The site header is the first thing on the page and stays at the top ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ----- Hero ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.25rem; font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text-strong); }
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- The site's text rules (p, ul, li, headings, tables) must not reach the tool: same weight as the site's ----- */
:where(.app-shell) p, :where(.app-shell) ul, :where(.app-shell) ol, :where(.app-shell) li, :where(.dialog) p, :where(.dialog) ul, :where(.dialog) li { margin: 0; line-height: 1.5; }
:where(.app-shell) ul, :where(.app-shell) ol { padding: 0; list-style: none; }
:where(.app-shell) h2, :where(.app-shell) h3, :where(.dialog) h2, :where(.dialog) h3 { margin: 0; line-height: 1.25; }
:where(.app-shell) table, :where(.dialog) table { width: auto; margin: 0; border-radius: 0; overflow: visible; background: none; }
:where(.app-shell) th, :where(.app-shell) td { border: 0; padding: 0; color: inherit; }
:where(.app-shell) pre, :where(.dialog) pre { margin: 0; }
.app-shell, .dialog { font-size: 1rem; }

/* ----- Small helpers ----- */
main [hidden], .dialog [hidden], .menu [hidden] { display: none !important; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.mono { font-family: var(--mono); }
.meta { color: var(--muted); font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.82rem; font-weight: 400; line-height: 1.45; }
.hint:empty { display: none; }
.hint.block { display: block; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--link-hover); }
.app-shell code, .dialog code { font-family: var(--mono); font-size: 0.85em; padding: 1px 6px; border-radius: 6px; background: var(--code-bg); color: var(--code-text); }
kbd { font-family: var(--mono); font-size: 0.78rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--chip-border); border-bottom-width: 2px; background: var(--chip); color: var(--text-strong); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ----- Buttons: the original's classes in the site's pills ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--surface-border); border-radius: 9999px; background: var(--surface); color: var(--text-strong); font-family: inherit; font-weight: 600; font-size: 0.925rem; line-height: 1.2; padding: 10px 20px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease; }
.btn:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn.primary { background: var(--gradient-brand); color: #fff; border-color: transparent; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn.primary:hover:not(:disabled) { color: #fff; box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { border-color: var(--brand); }
.btn.danger { color: var(--danger); border-color: rgba(185, 28, 28, 0.35); }
.btn.danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; }
.small-btn { min-height: 36px; padding: 7px 14px; font-size: 0.85rem; }
.small-btn .ico { width: 16px; height: 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--surface-border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; padding: 0; font-family: inherit; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.icon-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sq-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: inline-grid; place-items: center; padding: 0; cursor: pointer; text-decoration: none; }
.sq-btn:hover { background: var(--panel-2); color: var(--link); }
.sq-btn[aria-pressed="true"] { color: var(--link); }

/* ----- Toolbar and the seven tools as pill tabs ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; display: flex; flex-direction: column; gap: 20px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 26px; background: var(--surface-2); max-width: 100%; }
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 9999px; background: transparent; font-family: inherit; font-size: 0.875rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.tab .ico { width: 16px; height: 16px; }
.tab:hover { color: var(--link); }
.tab[aria-current="page"] { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.tab .short, .tab .tiny { display: none; }
@media (max-width: 1279.98px) { .tab .long { display: none; } .tab .short { display: inline; } }
@media (max-width: 899.98px) { .tab .ico { display: none; } }
@media (max-width: 639.98px) {
    .app-toolbar { flex-direction: column-reverse; align-items: stretch; }
    .toolbar-right { justify-content: flex-start; } /* away from the site's round theme button at the right edge */
    .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; border-radius: 22px; }
    .tab { padding: 8px 4px; min-width: 0; }
    .tab .short { display: none; }
    .tab .tiny { display: inline; }
}
.shell-hint { margin: 0; }

/* ----- Fields ----- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-weight: 600; font-size: 0.875rem; color: var(--text-strong); }
.input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px; background: var(--field); border: 1px solid var(--field-border); border-radius: 12px; font-family: inherit; font-size: 0.95rem; color: var(--text); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--glow); }
.input::placeholder { color: var(--placeholder); }
.input[aria-invalid="true"] { border-color: var(--bad); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.55; }
textarea.input.mono, .input.mono { font-family: var(--mono); font-size: 0.875rem; }
.input.mini { min-height: 36px; padding: 6px 10px; font-size: 0.875rem; border-radius: 10px; }
.select { width: auto; max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; cursor: pointer; }
.select option { color: #0a0a14; background: #fff; }
.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); padding: 4px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check-row.small { font-size: 0.85rem; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.inline-field .input { width: auto; color: var(--text); }
.opt-line { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.seg button .ico { width: 15px; height: 15px; }
.seg button:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.seg button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 13px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--chip); font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--text-2); cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chip .n { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.chip:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.85; }
.search-wrap { position: relative; display: block; min-width: 0; }
.search-wrap > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap .input { padding-left: 38px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; padding: 1px 9px; border-radius: 9999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ----- Toasts ----- */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; background: #0a0a14; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); border-left: 4px solid var(--brand); border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); min-width: 260px; max-width: 460px; font-size: 0.875rem; font-weight: 500; overflow-wrap: anywhere; animation: slideIn 0.3s ease; transition: opacity 0.3s ease, transform 0.3s ease; }
.toast button { background: none; border: 0; padding: 0; color: #c4b5fd; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ----- Information sections ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow); padding: 20px; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.step-card { position: relative; padding-top: 24px; }
.step-num { position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-brand); color: #fff; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--text-strong); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

@media (max-width: 639.98px) { .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
:where(.app-shell) h4, :where(.dialog) h4 { margin: 0; line-height: 1.3; }

/* ===== NoiseHaven components ===== */

/* ----- Each view ----- */
.screen { display: flex; flex-direction: column; gap: 28px; width: 100%; min-width: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); color: var(--text-strong); }
.view-title:focus { outline: none; }
.lead { margin-top: 4px; color: var(--muted); max-width: 72ch; }
.block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-height: 34px; }
.block-head h3, .panel-head h3 { font-size: 1.08rem; color: var(--text-strong); }
.count { color: var(--muted); font-weight: 500; font-size: 0.9rem; margin-left: 6px; }
.empty { color: var(--muted); font-size: 0.9rem; }
.actions.end { justify-content: flex-end; }
.actions.center { justify-content: center; }
.banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 8px; border-radius: 12px; background: var(--tint-brand); border: 1px solid var(--tint-brand-border); font-size: 0.925rem; color: var(--text); }
.banner > .ico { color: var(--link); }
.banner-text { flex: 1 1 200px; font-weight: 600; overflow-wrap: anywhere; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.note .ico { color: var(--warn); margin-top: 2px; }
.field-row { display: flex; gap: 12px 16px; flex-wrap: wrap; }
.input.narrow { width: auto; min-width: 140px; }
.label { display: inline-flex; align-items: center; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 0.925rem; color: var(--text); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.chip .ico { width: 16px; height: 16px; }
.chip[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.seg { align-self: flex-start; }
.range { width: 100%; min-height: 32px; accent-color: var(--brand); margin: 0; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row .end { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--gradient-brand); transition: width 0.3s; }
.btn.big { min-height: 52px; font-size: 1rem; padding: 10px 22px; }
.btn[aria-pressed="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }

/* the switch: a 44 px box, the track and the knob drawn inside it */
.switch { width: 48px; height: 44px; flex: none; padding: 0; position: relative; border: 0; background: transparent; cursor: pointer; }
.switch::before { content: ""; position: absolute; left: 1px; right: 1px; top: 8px; height: 28px; border-radius: 14px; background: var(--line-strong); transition: background 0.2s ease; }
.switch::after { content: ""; position: absolute; top: 12px; left: 5px; width: 20px; height: 20px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s ease; }
.switch[aria-checked="true"]::before { background: var(--gradient-brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.925rem; color: var(--text); }

/* ----- The player: under the site's header while the tool is on the screen ----- */
.player {
    position: sticky; top: calc(var(--head) + 8px); z-index: 30;
    display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(120px, 220px) auto auto; gap: 12px; align-items: center;
    padding: 8px; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 16px; box-shadow: var(--surface-shadow);
}
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: var(--gradient-brand); color: #fff; cursor: pointer; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.play-btn .ico { width: 22px; height: 22px; }
.play-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); }
.play-btn.loading { opacity: 0.6; }
.np { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.np-name { font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-sub { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vol { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vol .icon-btn.quiet { border-color: transparent; background: transparent; color: var(--muted); width: 32px; }
#timerQuick { width: auto; min-width: 40px; padding: 0 8px; gap: 6px; }
#timerQuick .qt { font-size: 0.85rem; font-weight: 600; }
@media (max-width: 640px) {
    .player { grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 6px; }
    .vol .range { display: none; }
    .vol.open .range { display: block; position: absolute; left: 8px; right: 8px; top: calc(100% + 8px); width: auto; background: var(--surface); border: 1px solid var(--surface-border); border-radius: 12px; padding: 10px 14px; min-height: 48px; box-shadow: var(--surface-hover-shadow); }
}

/* ----- Mix: the stage on the left, your sounds and the library on the right ----- */
.mix { display: grid; gap: 28px 48px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) {
    .mix { grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr); }
    .stage-col { position: sticky; top: calc(var(--head) + 96px); }
}
.stage-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; align-items: center; }
.layers-col { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.stage {
    position: relative; aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 50%;
    width: min(100%, 560px, calc(100svh - var(--head) - 330px)); min-width: min(100%, 260px);
    touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; scroll-margin-top: calc(var(--head) + 96px);
}
.stage:focus-visible { outline-offset: 4px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.grab { cursor: grab; }
.stage.dragging { cursor: grabbing; }
.stage-hint { position: absolute; left: 16%; right: 16%; top: 64%; text-align: center; color: var(--muted); font-size: 0.85rem; pointer-events: none; }
.stage-bar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: min(100%, 560px); }
.spectrum-wrap { position: relative; width: min(100%, 560px); padding-bottom: 18px; }
.spectrum { display: block; width: 100%; height: 48px; }
.spec-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.spec-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.spec-axis span:last-child { transform: translateX(-70%); }
.whole { width: min(100%, 560px); display: flex; flex-direction: column; gap: 2px; }

/* your sounds */
.layers { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.layers:empty { border-top: 0; }
.layer { border-bottom: 1px solid var(--line); }
.layer.chosen { background: linear-gradient(90deg, var(--tint-brand), transparent 70%); }
.layer-main { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; }
.swatch { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--c, #8a8f98); color: #ffffff; border: 1px solid rgba(0, 0, 0, 0.08); }
.swatch.light { color: #16191f; border-color: var(--line-strong); }
.swatch .ico { width: 20px; height: 20px; stroke-width: 1.8; }
.layer.muted .swatch { opacity: 0.4; }
.layer-body { min-width: 0; display: flex; flex-direction: column; }
.layer-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.layer-name { flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.layer-pct { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.layer-btns { display: flex; gap: 4px; }
.layer-btns .icon-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; color: var(--muted); }
.layer-btns .icon-btn:hover { color: var(--link); border-color: var(--line); }
.layer-btns .icon-btn[aria-pressed="true"] { color: var(--bad); }
.layer-btns .icon-btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.layer-more { padding: 4px 0 16px 52px; display: grid; gap: 10px 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .layer-more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.layer-more .field { gap: 0; }
.layer-more .label { font-size: 0.82rem; justify-content: space-between; }
.layer-more .switch-row { font-size: 0.85rem; align-self: end; }
.layer-empty { padding: 4px 0; color: var(--muted); }

/* ready-made mixes: one, two, three or four across, so twelve always fill their rows */
.ready-wrap { container-type: inline-size; }
.ready-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 500px) { .ready-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 860px) { .ready-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1160px) { .ready-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ready, .sound, .journey { font-family: inherit; color: var(--text); cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.ready { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; padding: 10px 12px 10px 8px; border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); }
.ready:hover, .sound:hover, .journey:hover { border-color: var(--brand); transform: translateY(-2px); }
.ready[aria-current="true"], .sound[aria-pressed="true"], .journey[aria-checked="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.mini { width: 56px; height: 56px; display: block; }
.mini-face { fill: var(--face); stroke: var(--ring); stroke-width: 1.5; }
.mini-head { fill: var(--head-ink); }
.ready-name { font-weight: 700; display: block; color: var(--text-strong); }
.ready-good, .ready-sounds { display: block; font-size: 0.8rem; color: var(--muted); }
.ready-sounds { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the library */
.lib-search { position: relative; flex: 1 1 200px; max-width: 320px; }
.lib-search > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lib-search .input { padding-left: 38px; min-height: 40px; }
.sound-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.sound { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 12px; align-items: center; text-align: left; padding: 8px 10px 8px 8px; border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); min-height: 64px; }
.sound-name { display: block; font-weight: 600; color: var(--text-strong); }
.sound-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.sound-state { width: 20px; height: 20px; color: var(--muted); }
.sound[aria-pressed="true"] .sound-state { color: var(--link); }
.family-head { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); font-weight: 600; margin-top: 8px; }
.family-head:first-child { margin-top: 0; }

/* ----- Panels on Sleep and Tones: a line above each, no frame ----- */
.card-grid { display: grid; gap: 20px 40px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.panel { display: flex; flex-direction: column; gap: 14px; padding: 18px 0 20px; border-top: 1px solid var(--line-strong); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.panel-head h3 .ico { color: var(--link); }
.state { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.state.on { color: #fff; background: var(--gradient-brand); border-color: transparent; }
.big-time { font-size: clamp(2.6rem, 7vw, 3.6rem); font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--text-strong); }
.big-time.off { color: var(--muted); }
.step { font-size: 0.95rem; margin-top: 4px; color: var(--text-strong); }

/* sleep diary */
.diary { margin-top: 8px; }
.rate-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--surface-border); border-radius: 16px; background: var(--surface); box-shadow: var(--surface-shadow); }
.rate-q { font-weight: 700; font-size: 1.05rem; color: var(--text-strong); }
.rate-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rate-row button { min-height: 44px; padding: 8px 16px; border-radius: 9999px; border: 1px solid var(--chip-border); background: var(--surface); font-family: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; }
.rate-row button:hover { border-color: var(--brand); color: var(--link); }
.rate-row button[aria-checked="true"] { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.diary-grid { display: grid; gap: 24px 48px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .diary-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.diary-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.night-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.night-when { font-weight: 600; color: var(--text-strong); }
.night-what { font-size: 0.82rem; color: var(--muted); grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.night-rate { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 8px; }
.night-rate select { min-height: 36px; padding: 4px 30px 4px 10px; }
.diary-side { display: flex; flex-direction: column; gap: 10px; }
.diary-side h4 { font-size: 0.95rem; color: var(--text-strong); margin: 0; }
.helps { display: flex; flex-direction: column; gap: 8px; }
.help-row { display: grid; grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.4fr); gap: 10px; align-items: center; font-size: 0.875rem; }
.help-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.help-bar i { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--series); flex: none; }
.help-bar span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ----- Focus ----- */
.focus { display: grid; gap: 28px 56px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .focus { grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); } }
.focus-dial-col { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.focus-dial { position: relative; width: min(100%, 320px); aspect-ratio: 1 / 1; }
.focus-dial svg { width: 100%; height: 100%; display: block; }
.fr-track { fill: var(--face); stroke: var(--ring); stroke-width: 6; }
.fr-arc { fill: none; stroke: var(--brand); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.focus.break .fr-arc { stroke: var(--series-2); }
.focus-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.focus-phase { font-weight: 600; color: var(--muted); }
.focus-time { font-size: clamp(2.8rem, 9vw, 3.6rem); font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--text-strong); }
.focus-dots { display: flex; gap: 6px; min-height: 10px; }
.focus-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--muted); }
.focus-dots i.done { background: var(--brand); border-color: var(--brand); }
.focus-dots i.now { border-color: var(--brand); }
.focus-set { display: flex; flex-direction: column; gap: 16px; }
.own-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; }
@media (min-width: 560px) { .own-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* minutes focused, one column a day */
.week { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; height: 180px; max-width: 640px; border-bottom: 1px solid var(--axis); }
.wk-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; padding: 0; border: 0; background: transparent; cursor: default; font-family: inherit; }
.wk-col:focus-visible { outline-offset: -2px; }
.wk-bar { width: min(24px, 60%); background: var(--series); border-radius: 4px 4px 0 0; min-height: 0; transition: filter 0.15s; }
.wk-col:hover .wk-bar, .wk-col:focus-visible .wk-bar { filter: brightness(1.15); }
.wk-val { font-size: 0.78rem; color: var(--text); font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 640px; font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: 6px; }
.week-days .today { color: var(--text-strong); font-weight: 700; }
.week-empty { position: absolute; left: 0; right: 0; top: 40%; text-align: center; color: var(--muted); font-size: 0.9rem; padding: 0 12px; }
.chart-tip { position: absolute; pointer-events: none; z-index: 2; top: 4px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; font-size: 0.82rem; line-height: 1.35; white-space: nowrap; }
.chart-tip b { font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* ----- Tones ----- */
.beat-read { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.beat-hz { font-size: clamp(2.4rem, 6vw, 3.2rem); font-weight: 300; line-height: 1; letter-spacing: -0.02em; color: var(--text-strong); }
.beat-band { color: var(--muted); font-weight: 600; }
.journeys { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.journey { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); }
.journey b { font-weight: 700; color: var(--text-strong); }
.journey span { font-size: 0.8rem; color: var(--muted); }
.journey svg { width: 100%; height: 34px; margin-top: 4px; }
.journey .jl { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.journey .jw { fill: var(--series-wash); stroke: none; }
.journey .jp { stroke: var(--text-strong); stroke-width: 1.5; }

/* ----- Saved ----- */
.mine { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mine-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mine-pic { grid-column: 1; grid-row: 1 / span 2; }
.mine-name, .mine-sub { grid-column: 2; }
.mine-name { align-self: end; font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-sub { align-self: start; font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-row .actions { grid-column: 1 / -1; margin-top: 8px; }
@media (min-width: 900px) {
    .mine-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .mine-row .actions { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
}

/* ----- Windows ----- */
.dialog { margin: auto; border: 1px solid var(--surface-border); border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 16px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); }
.dialog.wide { width: min(760px, calc(100vw - 16px)); }
.dialog::backdrop { background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(6px); }
.dialog[open] { animation: pop 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-body h2 { font-size: 1.2rem; color: var(--text-strong); }
.dialog .help { overflow: auto; }
.help h3 { margin-top: 8px; font-size: 1rem; color: var(--text-strong); }
.help p, .help li { color: var(--text); font-size: 0.925rem; }
.examples { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; list-style: disc; }

/* ----- Night screens: bedside clock, alarm, breathing (the original's) ----- */
.night { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000000; color: var(--night, #ffb35c); font-family: 'Inter', system-ui, sans-serif; }
.night::backdrop { background: #000000; }
.night [hidden] { display: none !important; }
:where(.night) p, :where(.night) h2 { margin: 0; color: inherit; line-height: 1.35; }   /* the site's base colours every p dark: the night screens' text takes the screen's colour (same weight as the site's rule, so each line's own colour below still wins) */
/* The three brightness levels (Dim 0.55, Dimmer 0.3, Darkest 0.14 in --night-dim) start from the dimmest each colour may be and
   still be read on black: the clock (large text) at 3:1, the small lines at 4.5:1. The original's Darkest was about 1.2:1. The colour
   itself is dimmed (mixed with black) rather than the text made see-through, which looks the same on black and which contrast tools read. */
.night[data-colour="white"] { --night: #e6e6e6; --cmin: 0.4; --smin: 0.52; }
.night[data-colour="amber"] { --night: #ffb35c; --cmin: 0.47; --smin: 0.61; }
.night[data-colour="red"] { --night: #ff4a3d; --cmin: 0.66; --smin: 0.85; }
.night-inner { background: #000000; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); text-align: center; user-select: none; -webkit-user-select: none; }
.night-clock { font-size: min(30vmin, 220px); font-weight: 200; line-height: 1; letter-spacing: -0.02em; color: color-mix(in srgb, var(--night, #ffb35c) calc((var(--cmin, 0.47) + (1 - var(--cmin, 0.47)) * (var(--night-dim, 0.3) - 0.14) * 0.7) * 100%), #000000); font-variant-numeric: tabular-nums; }
.night-date, .night-mix, .night-timer { color: color-mix(in srgb, var(--night, #ffb35c) calc((var(--smin, 0.61) + (1 - var(--smin, 0.61)) * (var(--night-dim, 0.3) - 0.14) * 0.7) * 100%), #000000); font-size: 1rem; }
.night-timer { font-size: 1.25rem; }
.night-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; max-width: 760px; transition: opacity 0.3s; }
.night.quiet .night-controls:not(.show) { opacity: 0; pointer-events: none; }
.night-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 8px 16px; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.06); color: #e6e6e6; font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }
.night-btn:hover { background: rgba(255, 255, 255, 0.14); }
.night-btn.big { min-height: 64px; min-width: 150px; font-size: 1.2rem; }
.night-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9999px; border: 1px solid rgba(255, 255, 255, 0.28); }
.night-seg button { min-height: 38px; padding: 4px 14px; border: 0; border-radius: 9999px; background: transparent; color: #a8a8a8; font-family: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; }
.night-seg button[aria-checked="true"] { background: rgba(255, 255, 255, 0.16); color: #ffffff; }
.night-check { display: inline-flex; align-items: center; gap: 8px; color: #c8c8c8; min-height: 44px; padding: 0 6px; cursor: pointer; }
.night-check input { width: 20px; height: 20px; accent-color: #ffb35c; }
.night-tip { color: rgba(255, 255, 255, 0.6); font-size: 0.875rem; transition: opacity 0.3s; }
.night.quiet .night-tip { opacity: 0; }
.ring h2 { font-size: clamp(1.4rem, 5vw, 2.2rem); font-weight: 400; color: #e6e6e6; max-width: 34ch; }
.ring .night-clock { opacity: 1; color: #ffb35c; }
.breath { --night: #9ec5ff; }
.orb-wrap { position: relative; width: min(78vmin, 420px); aspect-ratio: 1 / 1; display: grid; place-items: center; }
.breath-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.br-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 2; }
.br-fill { fill: none; stroke: rgba(158, 197, 255, 0.6); stroke-width: 2; stroke-linecap: round; }
.breath-orb { position: absolute; width: 84%; height: 84%; border-radius: 50%; background: radial-gradient(circle at 50% 45%, rgba(158, 197, 255, 0.42), rgba(158, 197, 255, 0.08) 70%, rgba(158, 197, 255, 0) 72%); transform: scale(0.55); transition-property: transform; transition-timing-function: ease-in-out; }
.breath-text { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #e6eeff; }
.breath-text span:first-child { font-size: clamp(1.4rem, 5vmin, 2rem); font-weight: 400; }
.breath-text span:last-child { font-size: 1.1rem; opacity: 0.6; }

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .toasts { bottom: 16px; right: 16px; left: 16px; align-items: stretch; }
    .toast { min-width: 0; max-width: none; }
    .dialog-body { padding: 16px; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
    .layer-more { padding-left: 0; }
}
@media (max-width: 899.98px) and (min-width: 640px) {
    .info-section .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell *, .app-shell *::before, .app-shell *::after, .dialog, .night *, .night *::before, .night *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .btn:hover, .icon-btn:hover, .chip:hover, .seg button:hover, .info-card:hover, .ready:hover, .sound:hover, .journey:hover, .play-btn:hover { transform: none; }
    .breath-orb { display: none; }
}
@media (forced-colors: active) {
    .swatch { border: 2px solid CanvasText; }
    .wk-bar, .help-bar i { background: Highlight; }
}
@media print {
    .app-toolbar, .player, .shell-hint, .app-shell .actions { display: none !important; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026). */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"], main .btn,
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]) { min-height: 44px; }
    main input[type="range"] { min-height: 44px; }
    main .icon-btn { width: 44px; height: 44px; min-width: 44px; }
    main .layer-btns .icon-btn { width: 44px; height: 44px; }
    main .vol .icon-btn.quiet { width: 44px; }
    main .tab { min-width: 44px; }
    main .seg button, main .chip, main .rate-row button, main .select, main .night-rate select { min-height: 44px; }
    main .layer-name { min-height: 44px; }
    main #timerQuick { min-width: 44px; }   /* the id rule above would keep it at 40 */
    main .check { min-height: 44px; align-items: center; }
    main :is(p, li, .hint, .label, .input, .seg button, .chip, .tab, .muted, .empty, .link, .check, .lead, .note, .sound-desc, .ready-good, .ready-sounds, .np-sub, .night-what, .mine-sub, .state, .count, .switch-row, .help-row, .help-bar span, .journey span, .layer-pct, .range-row .end) { font-size: 1rem; }
    main :is(.big-time, .focus-time, .beat-hz) { font-size: clamp(2.6rem, 12vw, 3.4rem); }
    .dialog button, .dialog .btn, .dialog input:not([type="checkbox"]), .dialog select { min-height: 44px; }
    .dialog .icon-btn { width: 44px; height: 44px; }
    .dialog :is(p, li, .hint, .label, .input) { font-size: 1rem; }
    .night-seg button { min-height: 44px; }
    .night-tip { font-size: 1rem; }
}
