/* ClockIn: assets/breathe/breathe.css. Part of what was style.css (split in 1.42.2, rules moved as is). The load order in index.html matters: see CLAUDE.md */
/* ============================================================
   BREATHING (1.40.0), see assets/breathe.js
   While a breathing exercise runs, #focus-overlay gets .is-breathing:
   the clock face, its arrows and everything under the clock step aside
   and the breathing circle takes the face's box (--dial), always round.
   The circle is drawn in the drawer's --focus-hue (the break color on a
   break), so it follows the theme like the rest of the drawer. Outside
   the drawer (Settings and Dev previews) it uses the accent.
   ============================================================ */
.breathe-stage { position: absolute; inset: 0; display: grid; place-items: center; color: var(--focus-hue, var(--accent)); z-index: 2; }
.breathe-stage[hidden] { display: none; }
.breathe-anim { position: absolute; inset: 0; }
.breathe-anim .br-svg { width: 100%; height: 100%; display: block; }
.breathe-text { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); text-align: center; pointer-events: none; }
.breathe-word {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: clamp(26px, calc(var(--dial, 320px) * 0.12), 56px);
  line-height: 1.05;
  text-shadow: 0 0 18px color-mix(in srgb, var(--paper) 85%, transparent), 0 0 3px color-mix(in srgb, var(--paper) 70%, transparent);
  transition: opacity 400ms ease;
}
.breathe-count {
  font-family: var(--font-heading);
  font-size: clamp(18px, calc(var(--dial, 320px) * 0.075), 34px);
  font-variant-numeric: tabular-nums lining-nums;
  opacity: 0.75;
  min-height: 1.2em;
  text-shadow: 0 0 12px color-mix(in srgb, var(--paper) 85%, transparent);
}
.breathe-stage.is-lead .breathe-word { font-size: clamp(20px, calc(var(--dial, 320px) * 0.085), 40px); opacity: 0.8; }

/* The drawer while breathing */
.focus-overlay.is-breathing .focus-dial { width: var(--dial) !important; height: var(--dial); max-height: none; aspect-ratio: 1; padding: 0; margin-bottom: 0; }
.focus-overlay.is-breathing .focus-dial > :not(.breathe-stage) { visibility: hidden; }
.focus-overlay.is-breathing .focus-tip,
.focus-overlay.is-breathing .focus-tomatoes,
.focus-overlay.is-breathing .focus-today,
.focus-overlay.is-breathing .zen-stats,
.focus-overlay.is-breathing .zen-resume { display: none !important; }
.breathe-caption { display: none; }
.focus-overlay.is-breathing .breathe-caption {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: calc(-1 * var(--space-2));
  font-size: var(--font-size-sm); color: var(--ink-light); text-align: center; min-height: 1.5em;
}
.breathe-read-btn { font-size: var(--font-size-xs); color: var(--text-muted); }
.focus-breathe-btn { display: inline-flex; align-items: center; gap: 6px; }
.focus-breathe-btn.hidden { display: none; }
.focus-breathe-btn[aria-pressed="true"] { color: var(--focus-hue); border-color: var(--focus-hue); }

/* The animations (drawn in breathe.js, makeAnim) */
.br-svg { overflow: visible; }
.br-bg { fill: color-mix(in srgb, currentColor 6%, transparent); }
.br-rim { fill: none; stroke: color-mix(in srgb, currentColor 30%, transparent); stroke-width: 3; }
.br-wave-back { fill: currentColor; opacity: 0.3; }
.br-wave-front { fill: currentColor; opacity: 0.62; }
.br-petal { fill: currentColor; opacity: 0.22; }
.br-core { fill: currentColor; opacity: 0.55; }
.br-lotus-out { fill: currentColor; opacity: 0.26; }
.br-lotus-in { fill: currentColor; opacity: 0.42; }
.br-seed { fill: currentColor; }
.br-orb-in { stop-color: currentColor; stop-opacity: 0.85; }
.br-orb-mid { stop-color: currentColor; stop-opacity: 0.45; }
.br-orb-out { stop-color: currentColor; stop-opacity: 0.12; }
.br-halo { fill: currentColor; }
.br-ring { fill: none; stroke: currentColor; stroke-width: 3; }
.br-disc { fill: currentColor; opacity: 0.2; }
.br-seg { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; }
.br-seg-in { opacity: 0.9; }
.br-seg-out { opacity: 0.55; }
.br-seg-hold, .br-seg-hold2 { opacity: 0.25; }
.br-dot { fill: currentColor; stroke: var(--paper); stroke-width: 4; }

/* Settings > Breathing */
.breathe-steps { display: grid; grid-template-columns: repeat(4, minmax(0, max-content)); gap: var(--space-3) var(--space-5); margin: var(--space-3) 0; }
.breathe-step { display: flex; flex-direction: column; gap: 4px; }
.breathe-step-field { display: flex; align-items: center; gap: var(--space-2); }
.breathe-step input { width: 64px; }
.breathe-steps.is-locked { opacity: 0.55; }
@media (max-width: 700px) { .breathe-steps { grid-template-columns: repeat(2, minmax(0, max-content)); } }
.br-picker { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.br-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 104px; padding: var(--space-3) var(--space-2) var(--space-2); border-radius: var(--radius-md, 10px); cursor: pointer; border: 1.5px solid transparent; color: var(--ink); }
.br-pick:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.br-pick-art { display: block; width: 72px; height: 72px; color: var(--accent); opacity: 0.85; }
.br-pick-art .br-svg { width: 100%; height: 100%; display: block; }
.br-pick-name { font-size: var(--font-size-xs); color: var(--text-muted); }
.br-pick:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.br-pick:has(input:checked) .br-pick-art { opacity: 1; }
.br-pick:has(input:checked) .br-pick-name { color: var(--ink); font-weight: var(--weight-bold); }
.br-pick:has(input:focus-visible) { outline: 2px solid var(--focus-ring, var(--ink)); outline-offset: 2px; }
.breathe-safety-body { max-width: 62ch; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--warning, #D9921C); background: color-mix(in srgb, var(--warning, #D9921C) 8%, transparent); border-radius: var(--radius-sm); }
.breathe-safety-body p { margin: 0 0 var(--space-2); line-height: 1.5; }
.breathe-safety-body p:last-child { margin-bottom: 0; font-weight: var(--weight-bold); }
.breathe-agree-row { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: var(--space-2) !important; margin: var(--space-3) 0 var(--space-2); color: var(--ink) !important; cursor: pointer; }
.breathe-agree-row input { margin-top: 3px; flex: none; width: 16px; height: 16px; padding: 0; }

/* The safety window */
.modal-card.breathe-safety-card { max-width: 520px; }
.breathe-safety-lead { margin: 0; color: var(--text-muted); }
.breathe-safety-card .breathe-safety-body { max-width: none; }
#breathe-safety-go:disabled { opacity: 0.45; cursor: not-allowed; }

/* Settings > Dev > Breathing previews */
.br-dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-4); margin: var(--space-3) 0; }
.br-dev-card { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.br-dev-art { width: 140px; height: 140px; color: var(--accent); }
.br-dev-art .br-svg { width: 100%; height: 100%; display: block; }
.br-dev-name { font-weight: var(--weight-bold); font-size: var(--font-size-sm); }
.br-prev-word { font-size: var(--font-size-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.br-dev-sounds { margin-top: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  .breathe-word { transition: none; }
}

/* ============================================================
   1.41.3 Breathing
   ============================================================ */
/* Custom pattern fields styled like every other number field in Settings
   (same height as Session length, same border, radius and background). */
#tab-settings .breathe-step input[type="number"] {
  box-sizing: border-box;
  width: 84px;
  height: var(--btn-h-md);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: var(--font-size-base);
}
#tab-settings .breathe-step input[type="number"]:focus-visible { outline: 2px solid var(--focus-ring, var(--ink)); outline-offset: 1px; }
#tab-settings .breathe-step input[type="number"]:disabled { cursor: not-allowed; }
.breathe-step .field-label { width: auto; font-size: var(--font-size-sm); color: var(--ink-light); }
/* The small line under Inhale / Exhale in the circle. */
.breathe-sub {
  font-size: clamp(13px, calc(var(--dial, 320px) * 0.045), 18px);
  opacity: 0.8;
  min-height: 1.3em;
  text-shadow: 0 0 12px color-mix(in srgb, var(--paper) 85%, transparent);
}
#settings-page-breathe .field-controls { display: inline-flex; }

/* 1.41.4: the little x in the health tip's top right corner. The tip gets
   room on the right so the x never sits on the button. */
.focus-tip { position: relative; }
.focus-dial-row > .focus-tip { padding-right: calc(var(--space-3) + 26px); }
.focus-tip-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-light);
  cursor: pointer;
}
.focus-tip-close:hover, .focus-tip-close:focus-visible { background: color-mix(in srgb, var(--focus-hue) 16%, transparent); color: var(--ink); }
@media (max-width: 600px) {
  .focus-dial-row > .focus-tip { padding-top: calc(var(--space-3) + 18px); }
}


/* ============================================================
   1.49.0 WHILE YOU BREATHE, see breathe.js
   The pills (data-breathe-only) show only while breathing: pattern and
   session length at the top left (the presets, modes and Resume
   Previous step aside), the sound pill at the top right (the theme pill
   steps aside). The clock face arrows stay and switch the animation; the
   face name line shows the animation's name.
   Clear screen (.breathe-clear): everything but the circle fades slowly,
   and comes back quickly when the mouse moves.
   ============================================================ */
[data-breathe-only] { display: none !important; }
.focus-overlay.is-breathing [data-breathe-only] { display: inline-flex !important; }
.focus-overlay.is-breathing .focus-top-left > :not([data-breathe-only]),
.focus-overlay.is-breathing .focus-theme { display: none !important; }
.focus-overlay.is-breathing .focus-top-left { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.breathe-time-name { min-width: 6ch; }
.breathe-sound-pill .focus-theme-name { min-width: 11ch; }
.breathe-mute-btn .breathe-spk-off { display: none; }
.breathe-mute-btn.is-muted .breathe-spk-on { display: none; }
.breathe-mute-btn.is-muted .breathe-spk-off { display: block; }
.breathe-mute-btn.is-muted { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.breathe-sound-pill.is-muted .focus-theme-name { opacity: 0.45; }
/* 2.0.6 (Omar, iPhone: the pills were too wide). On a phone Box and Custom
   are just their icons (Relax keeps its numbers), and the sound pill is as
   wide as the pill above it, like the theme pill: Mute, the arrows, and the
   music note (the sound's name while you step) in the middle. */
@media (max-width: 700px) {
  .focus-top [data-breathe-pat="box"] .focus-preset-nums,
  .focus-top [data-breathe-pat="custom"] .focus-preset-nums { display: none; }
  #breathe-sound-pill { width: 0; min-width: 100%; justify-content: space-between; }
  #breathe-sound-pill .focus-theme-name { flex: 1 1 0; min-width: 0; max-width: none; padding: 0 2px; }
  #breathe-sound-pill .focus-theme-arrow { min-width: 0; } /* 32px each, so the note has room */
  #breathe-sound-pill .focus-theme-name.is-icon { min-width: 20px; }
}

.focus-overlay.is-breathing :is(.focus-top, .focus-what-wrap, .focus-face-arrow, .focus-face-name, .breathe-caption, .focus-controls, .focus-status) { transition: opacity 300ms ease; }
.focus-overlay.breathe-clear :is(.focus-top, .focus-what-wrap, .focus-face-arrow, .breathe-caption, .focus-controls, .focus-status) {
  opacity: 0 !important; pointer-events: none; transition: opacity 1800ms ease;
}
html[data-breathe-clear] .topbar { opacity: 0; pointer-events: none; transition: opacity 1800ms ease; }
.focus-overlay.breathe-clear { cursor: none; }
@media (prefers-reduced-motion: reduce) {
  .focus-overlay.is-breathing :is(.focus-top, .focus-what-wrap, .focus-face-arrow, .focus-face-name, .breathe-caption, .focus-controls, .focus-status),
  .focus-overlay.breathe-clear :is(.focus-top, .focus-what-wrap, .focus-face-arrow, .breathe-caption, .focus-controls, .focus-status) { transition: none; }
}

/* 1.49.1 Just Breathing: Just The Clock while breathing shows the breathing
   circle, grown to the big dial (zen-pomodoro.css hides the stage there). */
.focus-overlay.is-just-clock.is-breathing .breathe-stage { display: grid !important; }

/* 1.49.3 Square, Triangle, Breath Line and Squares (breathe.js makeAnim). */
.br-track { fill: none; stroke: currentColor; stroke-opacity: 0.18; stroke-width: 10; stroke-linejoin: round; }
.br-tri-bg { fill: color-mix(in srgb, currentColor 6%, transparent); }
.br-tri-fill { fill: currentColor; opacity: 0.16; }
.br-sq-in { fill: currentColor; opacity: 0.14; }
.br-trail { fill: none; stroke: currentColor; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.br-trail-thin { stroke-width: 8; }
.br-ghost { fill: none; stroke: currentColor; stroke-opacity: 0.2; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.br-sqs { fill: none; stroke: currentColor; stroke-width: 4; }
/* Settings > Breathing: an animation that doesn't fit the pattern. */
.br-pick.is-off { opacity: 0.4; cursor: not-allowed; }
.br-pick.is-off:hover { background: none; }

/* 2.10.0: the Breathe button in the header, lit while you breathe. */
.focus-launchers .breathe-open-btn[aria-pressed="true"] { background: var(--chrome-hover, rgba(127, 127, 127, 0.16)); }
.focus-launchers .breathe-open-btn[aria-pressed="true"] svg { opacity: 1; }
#breathe-sep.hidden { display: none; } /* 2.10.2: the line in front of it goes with the button */
