/* === DIAPHRAGMATIC BREATHING PAGE === */

/* Tighter than the shared default (48px) — this page already has a tall settings
   panel and circle stage below the header. */
.page-header { margin-bottom: 24px; }

/* ── Settings panel ── */
.settings {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 18px 6px;
  margin-bottom: 6px;
}

/* During an active or paused session: visible but not editable. */
.settings.locked {
  opacity: 0.55;
  pointer-events: none;
}

.settings-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.settings-row:last-child { border-bottom: none; }
.settings-row[hidden] { display: none; }

.settings-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  flex: 0 0 auto;
  min-width: 110px;
}

.seg-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}

.seg {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  min-width: 64px;
}

.seg:hover { border-color: var(--green-mid); color: var(--green-dark); }

.seg.active {
  background: var(--green-light);
  border-color: var(--green-mid);
  color: var(--green-dark);
  font-weight: 500;
}

.seg-title { font-weight: 600; font-size: 0.92rem; }
.seg-sub { font-size: 0.7rem; opacity: 0.8; }

.custom-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 auto;
}

.num-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.num-field input {
  width: 64px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
}

.num-field input:focus {
  outline: none;
  border-color: var(--green-mid);
}

/* ── Pre-start instruction (collapsible) ── */
.pre-instruction {
  background: var(--green-light);
  border-left: 3px solid var(--green-mid);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.55;
}

.pre-instruction[hidden] { display: none; }

.pre-instruction summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.pre-instruction summary::-webkit-details-marker { display: none; }

.pre-instruction summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid var(--green-mid);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}

.pre-instruction[open] summary::before { transform: rotate(90deg); }

.pre-instruction p {
  margin: 8px 0 0;
}

/* ── Circle stage ── */
.circle-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0 8px;
}

.circle-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dia-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,122,90,0.16) 0%, transparent 68%);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.2s linear, opacity 0.2s linear, background 0.6s;
}

.dia-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--green-light);
  border: 3px solid var(--green-mid);
  transform: translate(-50%, -50%) scale(0.55);
  transition: transform 0.1s linear, background 0.6s, border-color 0.6s;
}

/* Phase color modes — applied via .phase-* classes */
.dia-circle.phase-inhale {
  background: #DCEAF7;
  border-color: #6AA1C8;
}
.dia-circle.phase-hold {
  background: #E9ECEE;
  border-color: #9AA5AC;
}
.dia-circle.phase-exhale {
  background: #FCE8D6;
  border-color: #E0996B;
}

.dia-glow.phase-inhale  { background: radial-gradient(circle, rgba(106,161,200,0.20) 0%, transparent 68%); }
.dia-glow.phase-hold    { background: radial-gradient(circle, rgba(154,165,172,0.16) 0%, transparent 68%); }
.dia-glow.phase-exhale  { background: radial-gradient(circle, rgba(224,153,107,0.20) 0%, transparent 68%); }

.circle-text {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

.circle-phase {
  font-size: 1rem;
  font-weight: 500;
  color: var(--green-dark);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.circle-seconds {
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hint-text {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  /* Reserve two lines so the layout below does not jump when the hint wraps. */
  min-height: 3rem;
  max-width: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Session info pills ── */
.session-info {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.info-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 6px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 90px;
}

.info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.info-val {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ── Done banner ── */
.done-banner {
  text-align: center;
  padding: 28px 20px;
  background: var(--green-light);
  border-radius: var(--radius);
  margin: 24px 0;
}

.done-emoji {
  font-size: 2.4rem;
  color: var(--green-dark);
  margin-bottom: 6px;
}

.done-msg {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.done-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Info-section helpers ── */
.numbered-steps {
  list-style: decimal;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.info-section a {
  color: var(--green-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.info-section a:hover { color: var(--green-mid); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .page-header { margin-bottom: 16px; }
  .settings { padding: 14px 14px 4px; margin-bottom: 14px; }
  .settings-label { min-width: 100%; margin-bottom: 4px; }
  .seg { padding: 6px 12px; font-size: 0.82rem; min-width: 56px; }
  .circle-stage { gap: 8px; margin: 4px 0 8px; }
  .circle-wrap { width: 190px; height: 190px; }
  .dia-circle { width: 165px; height: 165px; }
  .circle-phase { font-size: 0.9rem; margin-bottom: 2px; }
  .circle-seconds { font-size: 2rem; }
  .hint-text { font-size: 0.88rem; min-height: 2.6rem; }
  .pre-instruction { font-size: 0.85rem; padding: 10px 12px; margin-bottom: 16px; }
  .session-info { gap: 8px; margin-bottom: 10px; }
  .info-pill { padding: 6px 14px; min-width: 80px; }
}
