.tool-overlay-breathing_exercise {
  padding: 0;
  place-items: stretch;
}

.tool-overlay-breathing_exercise .tool-panel {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  overflow: hidden;
  background: #0f1e2a;
}

.tool-overlay-breathing_exercise .tool-panel-header {
  padding: 9px 12px;
  background: linear-gradient(125deg, #28606c, #4b7e94 58%, #7783b7);
}

.tool-overlay-breathing_exercise .tool-panel-header h2 {
  font-size: 17px;
}

.tool-overlay-breathing_exercise .tool-panel-header small {
  font-size: 10px;
}

.tool-overlay-breathing_exercise .tool-panel-body {
  padding: 0;
  overflow: hidden;
}

.breath-app {
  height: 100%;
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  color: #f8fbfd;
  background:
    radial-gradient(circle at 16% 10%, rgba(160,224,213,.22), transparent 30%),
    radial-gradient(circle at 84% 4%, rgba(255,215,167,.18), transparent 28%),
    linear-gradient(180deg, #0e1d28, #162c3b);
}

.breath-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.breath-topbar p {
  margin: 0 0 3px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.breath-topbar h3 {
  margin: 0;
  font: 850 21px/1.1 Arial,Helvetica,sans-serif;
}

.breath-theme-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.breath-theme {
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  color: #f8fbfd;
  text-align: left;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.breath-theme.selected {
  border-color: rgba(157,226,192,.85);
  box-shadow: 0 0 0 3px rgba(157,226,192,.2);
}

.breath-theme-art {
  height: 64%;
  min-height: 220px;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255,255,255,.08);
}

.breath-theme strong {
  display: block;
  margin-top: 10px;
  font-size: 15px;
}

.breath-theme small,
.breath-privacy,
.breath-control-card small,
.breath-final-card small {
  color: rgba(255,255,255,.68);
  font-size: 11px;
  line-height: 1.35;
}

.breath-mode-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.breath-mode-actions .button,
.breath-control-card .button,
.breath-final-card .button {
  min-height: 0;
  padding: 9px 13px;
  border-radius: 11px;
  font-size: 12px;
}

.breath-privacy {
  margin: 0;
  text-align: center;
}

.breath-running {
  grid-template-rows: auto minmax(0, 1fr);
}

.breath-progress {
  display: flex;
  gap: 5px;
}

.breath-progress span {
  width: 34px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.24);
}

.breath-progress span.done {
  background: #9de2c0;
}

.breath-progress span.current {
  outline: 2px solid rgba(255,255,255,.56);
  outline-offset: 2px;
}

.breath-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 10px;
}

.breath-scene-wrap {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  background: #d6f0f4;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.breath-control-card {
  align-self: stretch;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.breath-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
}

.breath-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #9de2c0, #ffdc9a);
  transition: width .12s linear;
}

.breath-control-card strong {
  color: #fff;
  font: 850 22px/1.15 Arial,Helvetica,sans-serif;
}

.breath-hold-button {
  width: 100%;
  min-height: 94px;
  border: 0;
  border-radius: 24px;
  color: #16323a;
  background: linear-gradient(135deg, #9de2c0, #fff1b7);
  font: 850 18px/1.1 Arial,Helvetica,sans-serif;
  box-shadow: 0 16px 35px rgba(0,0,0,.18);
  cursor: pointer;
  touch-action: none;
}

.breath-hold-button:active {
  transform: translateY(2px) scale(.99);
}

.breath-scene {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 340px;
  overflow: hidden;
  --breath-progress: 0;
}

.breath-scene-balloon {
  background: linear-gradient(180deg, #bfeaf3, #eaf7f5 72%, #b5dcc2);
}

.breath-balloon {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 150px;
  height: 178px;
  border-radius: 50% 50% 47% 47%;
  background: radial-gradient(circle at 36% 28%, #ffd0da 0 16%, #ff8aa0 17% 72%, #df6078 100%);
  transform: translate(-50%, -50%) scale(calc(.7 + var(--breath-progress) * .72));
  box-shadow: 0 22px 55px rgba(113,68,83,.22);
  transition: transform .08s linear;
}

.breath-balloon span {
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 30px;
  height: 26px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #df6078;
}

.breath-string {
  position: absolute;
  left: 50%;
  top: calc(60% + var(--breath-progress) * 55px);
  width: 3px;
  height: 140px;
  border-radius: 99px;
  background: rgba(68,92,102,.45);
}

.breath-breeze {
  position: absolute;
  left: 20%;
  bottom: 22%;
  width: 60%;
  height: 40px;
  border-top: 6px solid rgba(255,255,255,.55);
  border-radius: 50%;
}

.breath-scene-fire {
  background: linear-gradient(180deg, #214757, #385b45 58%, #1f3b25);
}

.breath-sky,
.breath-sun,
.breath-cloud,
.breath-trail {
  position: absolute;
}

.breath-jungle {
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: linear-gradient(180deg, transparent, rgba(13,55,30,.85));
}

.breath-jungle i {
  position: absolute;
  bottom: 0;
  width: 18%;
  height: 82%;
  border-radius: 60% 60% 0 0;
  background: #2f7442;
}

.breath-jungle i:nth-child(1) { left: 5%; height: 70%; }
.breath-jungle i:nth-child(2) { left: 28%; height: 92%; }
.breath-jungle i:nth-child(3) { right: 26%; height: 76%; }
.breath-jungle i:nth-child(4) { right: 4%; height: 88%; }

.breath-fire {
  position: absolute;
  left: 50%;
  bottom: 20%;
  width: 180px;
  height: 190px;
  transform: translateX(-50%) scale(calc(1 - var(--breath-progress) * .76));
  transform-origin: 50% 100%;
  opacity: calc(1 - var(--breath-progress) * .88);
  transition: transform .08s linear, opacity .08s linear;
}

.breath-fire span {
  position: absolute;
  bottom: 0;
  left: 50%;
  border-radius: 55% 55% 45% 45%;
  transform: translateX(-50%) rotate(45deg);
}

.breath-fire span:nth-child(1) {
  width: 120px;
  height: 120px;
  background: #ff7938;
}

.breath-fire span:nth-child(2) {
  width: 86px;
  height: 86px;
  bottom: 20px;
  background: #ffd15c;
}

.breath-fire span:nth-child(3) {
  width: 48px;
  height: 48px;
  bottom: 36px;
  background: #fff3ab;
}

.breath-smoke {
  position: absolute;
  left: 49%;
  bottom: calc(31% + var(--breath-progress) * 90px);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(231,238,232,.45);
  filter: blur(14px);
  opacity: calc(var(--breath-progress) * .75);
}

.breath-scene-hill {
  background: #9adcf5;
}

.breath-hill-bg {
  position: absolute;
  inset: -4% -70% -4% -44%;
  background-image: url("/images/tools/breathing-hill-bg-v1.webp");
  background-size: auto 108%;
  background-repeat: no-repeat;
  background-position:
    calc(0% + var(--breath-progress) * 34%)
    center;
  transform:
    scale(calc(1.04 + var(--breath-progress) * .035))
    translateX(calc(var(--breath-progress) * 9%));
  transform-origin: left center;
  transition: transform .08s linear, background-position .08s linear;
}

.breath-hill-car {
  position: absolute;
  left: calc(5% + var(--breath-progress) * 48%);
  bottom: calc(14% + var(--breath-progress) * 16%);
  width: min(24%, 180px);
  height: auto;
  transform:
    translateX(-50%) translateY(calc(var(--breath-progress) * 1px))
    rotate(calc(-13deg + var(--breath-progress) * 17deg))
    scale(calc(.66 + var(--breath-progress) * .05));
  filter: drop-shadow(0 18px 18px rgba(36,72,47,.24));
  transition: left .08s linear, bottom .08s linear, transform .08s linear;
}

@media (max-width: 520px) {
  .breath-hill-bg {
    inset: -4% -70% -4% -44%;
    background-size: auto 108%;
    background-position:
      calc(0% + var(--breath-progress) * 34%)
      center;
    transform:
      scale(calc(1.04 + var(--breath-progress) * .035))
      translateX(calc(var(--breath-progress) * 9%));
  }
  .breath-hill-car {
    left: calc(4% + var(--breath-progress) * 49%);
    bottom: calc(13% + var(--breath-progress) * 16%);
    width: min(31%, 145px);
    transform:
      translateX(-50%) translateY(calc(var(--breath-progress) * 1px))
      rotate(calc(-14deg + var(--breath-progress) * 18deg))
      scale(calc(.62 + var(--breath-progress) * .06));
  }
}

.breath-scene-plane {
  background: linear-gradient(180deg, #76c9ee 0%, #c7edf8 58%, #8fcf72 59%, #5ea552 100%);
}

.breath-cloud {
  width: 180px;
  height: 62px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  filter: blur(.2px);
}

.breath-cloud.one { left: 10%; top: 18%; }
.breath-cloud.two { right: 12%; top: 34%; transform: scale(.75); }

.breath-plane-sky {
  position: absolute;
  inset: 0 0 41%;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,245,179,.9) 0 42px, rgba(255,245,179,0) 43px),
    linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,0));
}

.breath-plane-earth {
  position: absolute;
  inset: auto -8% -18%;
  height: 56%;
  border-radius: 52% 52% 0 0;
  background:
    radial-gradient(circle at 24% 22%, rgba(255,255,255,.22) 0 8%, transparent 9%),
    linear-gradient(145deg, #9eda73, #4f9a4e);
}

.breath-plane-ground-motion {
  position: absolute;
  left: -180%;
  right: -75%;
  bottom: -2%;
  height: 40%;
  transform: translateX(var(--plane-shift));
  transition: transform .08s linear;
}

.breath-plane-ground-motion::before {
  content: "";
  position: absolute;
  inset: 20% 0 0;
  opacity: .45;
  background-image:
    radial-gradient(circle, rgba(49,96,48,.25) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(255,255,255,.23) 0 3px, transparent 4px);
  background-size: 118px 48px, 163px 62px;
  background-position:
    calc(var(--plane-shift) * .35) 14px,
    calc(var(--plane-shift) * .52) 34px;
}

.breath-plane-ground-motion i,
.breath-plane-ground-motion b {
  position: absolute;
  display: block;
  transform: translateX(var(--plane-shift));
  transition: transform .08s linear;
}

.breath-plane-ground-motion i {
  width: 46px;
  height: 22px;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 30% 30%, #b7e486 0 18%, transparent 19%),
    linear-gradient(180deg, #5faa51, #387d3d);
  box-shadow:
    18px 2px 0 -8px #4f9448,
    -13px 5px 0 -7px #6eb35a;
}

.breath-plane-ground-motion b {
  width: 18px;
  height: 8px;
  border-radius: 50%;
  background: rgba(60,105,61,.28);
}

.breath-plane-ground-motion i:nth-child(1) { left: 8%; bottom: 26%; transform: translateX(calc(var(--plane-shift) * .55)) scale(.85); }
.breath-plane-ground-motion i:nth-child(2) { left: 19%; bottom: 14%; transform: translateX(calc(var(--plane-shift) * .88)) scale(1.15); }
.breath-plane-ground-motion i:nth-child(3) { left: 31%; bottom: 31%; transform: translateX(calc(var(--plane-shift) * .7)) scale(.72); }
.breath-plane-ground-motion i:nth-child(4) { left: 44%; bottom: 18%; transform: translateX(calc(var(--plane-shift) * 1.08)) scale(1.05); }
.breath-plane-ground-motion i:nth-child(5) { left: 57%; bottom: 29%; transform: translateX(calc(var(--plane-shift) * .82)) scale(.9); }
.breath-plane-ground-motion i:nth-child(6) { left: 70%; bottom: 12%; transform: translateX(calc(var(--plane-shift) * 1.18)) scale(1.22); }
.breath-plane-ground-motion i:nth-child(7) { left: 82%; bottom: 34%; transform: translateX(calc(var(--plane-shift) * .74)) scale(.78); }
.breath-plane-ground-motion i:nth-child(8) { left: 94%; bottom: 18%; transform: translateX(calc(var(--plane-shift) * 1.02)) scale(1.08); }

.breath-plane-ground-motion b:nth-of-type(1) { left: 14%; bottom: 42%; transform: translateX(calc(var(--plane-shift) * .62)); }
.breath-plane-ground-motion b:nth-of-type(2) { left: 27%; bottom: 19%; transform: translateX(calc(var(--plane-shift) * .95)) scale(1.5); }
.breath-plane-ground-motion b:nth-of-type(3) { left: 52%; bottom: 45%; transform: translateX(calc(var(--plane-shift) * .78)) scale(1.2); }
.breath-plane-ground-motion b:nth-of-type(4) { left: 68%; bottom: 34%; transform: translateX(calc(var(--plane-shift) * 1.12)) scale(.9); }
.breath-plane-ground-motion b:nth-of-type(5) { left: 79%; bottom: 22%; transform: translateX(calc(var(--plane-shift) * .86)) scale(1.35); }
.breath-plane-ground-motion b:nth-of-type(6) { left: 90%; bottom: 47%; transform: translateX(calc(var(--plane-shift) * 1.05)) scale(.8); }

.breath-plane-img {
  position: absolute;
  left: calc(48% + var(--plane-drift));
  bottom: calc(15% + var(--breath-progress) * 54%);
  width: min(64%, 520px);
  height: auto;
  transform: translateX(-50%) rotate(calc(-4deg - var(--breath-progress) * 8deg));
  filter: drop-shadow(0 22px 20px rgba(29,67,79,.22));
  transition: left .08s linear, bottom .08s linear, transform .08s linear;
}

.breath-trail {
  left: calc(18% + var(--breath-progress) * 7%);
  bottom: calc(22% + var(--breath-progress) * 54%);
  width: calc(22% + var(--breath-progress) * 12%);
  height: 36px;
  border-radius: 99px;
  border-top: 4px solid rgba(255,255,255,.78);
  border-bottom: 3px solid rgba(255,255,255,.52);
  background: transparent;
  filter: drop-shadow(0 2px 4px rgba(255,255,255,.3));
}

.breath-complete {
  place-items: center;
}

.breath-final-card {
  width: min(520px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 24px;
  color: #18333d;
  text-align: center;
  background: rgba(255,255,255,.96);
  box-shadow: 0 22px 70px rgba(0,0,0,.28);
}

.breath-final-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #173d45;
  background: #9de2c0;
  font: 900 34px/1 Arial,Helvetica,sans-serif;
}

.breath-final-card h3 {
  margin: 0 0 8px;
  font: 900 24px/1.1 Arial,Helvetica,sans-serif;
}

.breath-final-card p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
}

.breath-final-card small {
  display: block;
  margin-bottom: 14px;
  color: #55707a;
}

@media (max-width: 900px) {
  .breath-theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .breath-theme-art {
    min-height: 150px;
  }
  .breath-stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .breath-control-card {
    padding: 11px;
  }
  .breath-control-card strong {
    font-size: 17px;
  }
  .breath-hold-button {
    min-height: 66px;
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .breath-app {
    padding: 8px;
    gap: 8px;
  }
  .breath-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .breath-topbar h3 {
    font-size: 17px;
  }
  .breath-progress span {
    width: 24px;
  }
  .breath-theme-grid {
    gap: 7px;
  }
  .breath-theme {
    padding: 7px;
    border-radius: 14px;
  }
  .breath-theme-art {
    min-height: 112px;
  }
  .breath-mode-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .breath-scene {
    min-height: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breath-meter span,
  .breath-balloon,
  .breath-fire,
  .breath-hill-car,
  .breath-plane-img {
    transition: none;
  }
}
