/* A quiet, persistent guide. Real photos and notes retain their space as poses
   change, so controls never jump when a photo loads or a timer is paused. */
.yoga-flow {
  display: grid;
  gap: 18px;
  padding: 16px 18px 18px;
  background: #fff;
  overflow-anchor: none;
}
.yoga-guide-tools { display: flex; justify-content: center; gap: 8px; min-height: 40px; }
.yoga-guide-tools > button {
  min-width: 108px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #f8f9fa;
  font-size: 11px;
  line-height: 1.2;
}
.yoga-guide-stage {
  --yoga-stage-gap: 16px;
  --yoga-note-height: 60px;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 210px;
}
.yoga-has-notes .yoga-guide-stage { height: 282px; }
.yoga-has-media .yoga-guide-stage { height: clamp(320px, 94vw, 438px); }
.yoga-has-media.yoga-has-notes .yoga-guide-stage { height: clamp(392px, 108vw, 510px); }
.yoga-flow .yoga-guide-heading {
  position: static;
  margin: 0;
}
.yoga-flow .yoga-pose-counter {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  height: 26px;
  padding: 4px 12px;
  border: 1px solid #dfe5db;
  border-radius: 999px;
  background: #f7f9f3;
  color: #687260;
  font-size: 10px;
  line-height: 16px;
  font-weight: 650;
  letter-spacing: .1px;
  white-space: nowrap;
}
#app .yoga-flow .yoga-pose-title {
  position: absolute;
  top: var(--yoga-title-center, 84px);
  left: 0;
  transform: translateY(-50%);
  z-index: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  width: 100%;
  margin: 0;
  font-size: clamp(28px, 7.7vw, 30px);
  line-height: 1.15;
  letter-spacing: -.45px;
  font-weight: 800;
  color: var(--ink);
}
.yoga-guide-content {
  display: contents;
  min-width: 0;
  min-height: 0;
}
.yoga-guide-media {
  position: absolute;
  top: var(--yoga-photo-top, 144px);
  left: 0;
  right: 0;
  height: var(--yoga-photo-height, 180px);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.yoga-flow .yoga-guide-media .yoga-photo-large {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 12px;
  background: transparent;
  object-fit: contain;
}
.yoga-flow [hidden] { display: none !important; }
.yoga-guide-photo-status { position: absolute; inset: 45% 0 auto; text-align: center; }
.yoga-guide-notes-slot {
  position: absolute;
  top: var(--yoga-notes-top, 334px);
  left: 0;
  right: 0;
  height: var(--yoga-notes-height, 60px);
  min-height: 0;
  min-width: 0;
}
.yoga-flow .yoga-guide-notes {
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c6ccbf transparent;
  color: #667080;
  font-size: 14px;
  line-height: 24px;
  font-weight: 450;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-align: center;
  border-radius: 5px;
}
.yoga-guide-notes:focus-visible { outline: 2px solid #7e963f; outline-offset: 3px; }
#app .yoga-flow:is([data-yoga-stage="ready"], [data-yoga-stage="saved"]) .yoga-pose-title { top: 50%; }
.yoga-guide-clock {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 15px 18px;
  border: 1px solid #edf0f2;
  border-radius: 14px;
  background: #f8f9fa;
}
.yoga-flow .yoga-countdown {
  margin: 0;
  color: var(--ink);
  font-size: 48px;
  line-height: 1;
  letter-spacing: -1.5px;
}
.yoga-flow .yoga-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: #91ad4e;
}
.yoga-progress::-webkit-progress-bar { background: #e5e9e0; border-radius: 999px; }
.yoga-progress::-webkit-progress-value { background: #a7c65a; border-radius: 999px; }
.yoga-progress::-moz-progress-bar { background: #a7c65a; border-radius: 999px; }
.yoga-total-remaining { margin: 0; color: #788190; font-size: 11px; line-height: 18px; }
.yoga-total-remaining span { margin-left: 6px; color: #394454; font-weight: 750; font-variant-numeric: tabular-nums; }
.yoga-guide-footer { display: grid; gap: 10px; }
.yoga-flow .yoga-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}
.yoga-flow .yoga-controls > button { min-height: 48px; padding: 8px 6px; border-radius: 10px; }
.yoga-flow .yoga-discard { margin: 0; min-height: 44px; border-color: #e5c9c9; color: #9c4d4d; }

/* Native fullscreen uses the document so Discard confirmation stays visible.
   The same layout works as an in-app fullscreen fallback on mobile Safari. */
html.yoga-focus, body.yoga-focus { overflow: hidden; overscroll-behavior: none; }
body.yoga-focus { padding: 0; }
body.yoga-focus .app-header, body.yoga-focus .bottom-nav { display: none !important; }
body.yoga-focus .app-shell { max-width: none; min-height: 0; border: 0; }
body.yoga-focus #app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  overflow: auto;
  z-index: 60;
  background: #fff;
}
body.yoga-focus #app > .page-head { display: none; }
body.yoga-focus #app > .yoga-flow {
  width: 100%;
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  gap: 10px;
  grid-template-rows: 40px minmax(0, 1fr) auto auto;
}
body.yoga-focus .yoga-flow .yoga-guide-stage { --yoga-stage-gap: 12px; height: 100%; }
body.yoga-focus .yoga-guide-notes { font-size: 14px; line-height: 20px; }
body.yoga-focus .yoga-guide-clock { align-self: center; padding: 10px 16px; gap: 7px; }
body.yoga-focus .yoga-countdown { font-size: 44px; }
body.yoga-focus .yoga-guide-tools { align-self: start; }
body.yoga-focus .yoga-guide-footer { align-self: end; gap: 8px; }
body.yoga-focus #toast { bottom: max(16px, env(safe-area-inset-bottom)); }
@media (orientation: portrait) and (max-height: 620px) {
  body.yoga-focus #app > .yoga-flow { gap: 8px; }
  body.yoga-focus .yoga-flow .yoga-guide-stage { --yoga-stage-gap: 10px; --yoga-note-height: 40px; }
}
@media (orientation: landscape) and (min-width: 560px) {
  body.yoga-focus #app > .yoga-flow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 40px minmax(0, 1fr) auto;
    grid-template-areas: 'tools tools' 'stage clock' 'stage footer';
    column-gap: 24px;
  }
  body.yoga-focus .yoga-guide-tools { grid-area: tools; justify-self: stretch; }
  body.yoga-focus .yoga-guide-stage { grid-area: stage; --yoga-note-height: 40px; }
  body.yoga-focus .yoga-guide-clock { grid-area: clock; align-self: center; }
  body.yoga-focus .yoga-guide-footer { grid-area: footer; }
}
/* Never disable browser zoom. Very small/zoomed layouts may scroll to keep
   controls reachable; ordinary phone portrait/landscape stays within view. */
@media (max-height: 330px), (max-width: 280px) {
  body.yoga-focus #app > .yoga-flow { height: auto; min-height: 100%; }
  body.yoga-focus .yoga-flow .yoga-guide-stage { height: 360px; }
}
