/* Browser tools: noise generator, breathing circle, sleep calculator (11.10.2026). Own file, only linked on tool pages. */

.tool { margin: 0 0 56px; padding: 30px; border: 1px solid color-mix(in srgb, var(--line) 52%, transparent); border-radius: 14px; background: var(--surface); }
.tool > h2 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 36px); }
.tool > p { max-width: 62ch; margin: 0 0 20px; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 0 0 18px; }
.tool fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.tool legend, .tool label.field > span { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.tool-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-choices label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 999px; cursor: pointer; font-size: 16px; }
.tool-choices input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tool-choices label:has(input:checked) { border-color: var(--moss); background: color-mix(in srgb, var(--moss) 16%, transparent); font-weight: 600; }
.tool-choices label:has(input:focus-visible) { outline: 3px solid var(--clay); outline-offset: 2px; }
.tool select, .tool input[type=time] { min-height: 44px; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.tool input[type=range] { width: min(260px, 100%); min-height: 44px; accent-color: var(--moss); }
.tool select:focus-visible, .tool input:focus-visible, .tool button:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.tool-button { min-height: 48px; padding: 10px 26px; border: 0; border-radius: 999px; background: var(--clay-fill, var(--clay)); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.tool-button.secondary { background: transparent; color: var(--ink); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.tool-status, .tool-left { margin: 0; min-height: 1.5em; color: var(--muted); font-size: 15px; }
.tool-note { margin: 16px 0 0; color: var(--muted); font-size: 14px; }

.breath-stage { display: grid; place-items: center; min-height: 260px; margin: 6px 0 22px; }
.breath-circle { display: grid; place-items: center; width: 220px; height: 220px; border-radius: 50%; background: color-mix(in srgb, var(--sage) 38%, transparent); border: 2px solid var(--moss); transform: scale(.55); transition: transform var(--breath-ms, 600ms) ease-in-out; }
.breath-circle[data-size=mid] { transform: scale(.8); }
.breath-circle[data-size=full] { transform: scale(1); }
.breath-word { font-size: 22px; font-weight: 600; color: var(--ink); transform: none; text-align: center; }
.breath-circle[data-size=small] .breath-word, .breath-circle[data-size=rest] .breath-word { font-size: 22px; }
@media (prefers-reduced-motion: reduce) { .breath-circle { transition: none; } }

.sleep-times { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.sleep-times li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--line) 52%, transparent); border-radius: 12px; background: var(--paper); }
.sleep-times li.best { border-color: var(--moss); }
.sleep-times time { font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.sleep-times span { color: var(--muted); font-size: 15px; }
.sleep-times strong { color: var(--ink); }
[data-sleep-result] h3 { margin: 18px 0 0; font-size: 20px; }

@media (max-width: 560px) {
  .tool { padding: 22px 18px; }
  .breath-circle { width: 190px; height: 190px; }
  .breath-stage { min-height: 220px; }
}
