/* OM SPACE Breathing Guide — scoped embed (from approved v3).
   All selectors are under .om-breathe. Do not copy html/body host rules.
   Full-viewport min-height is omitted. Background is transparent so the practice panel shows through. */
/* =====================================================================
       OM SPACE Breathing Guide — Scoped Embeddable Widget (.om-breathe)
       All tokens and rules are scoped to .om-breathe to prevent style leaks.
       ===================================================================== */
    .om-breathe {
      color-scheme: light only;
      --om-bg-cream: #F7F2E8;
      --om-bg-cream-soft: #EFE8D9;
      --om-bg-cream-tint: #FBF8F2;
      --om-teal-primary: #153A40;
      --om-teal-hover: #1E4D55;
      --om-teal-active: #0E2B30;
      --om-teal-secondary: #3A5A5F;
      --om-teal-muted: #49676C;
      --om-teal-border: #6B8285;
      --om-gold-accent: #C9A96E;
      --om-font-serif: var(--serif, Georgia, "Iowan Old Style", "Palatino Linotype", "OMSerif", "Songti SC", "Noto Serif CJK SC", "STSong", serif);
      --om-font-sans: var(--sans, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "OMSans", "Microsoft YaHei", sans-serif);
      --om-circle-size: clamp(216px, min(64vw, 38dvh), 300px);

      position: relative;
      width: 100%;
      min-height: 0;
      background-color: transparent;
      color: var(--om-teal-primary);
      font-family: var(--om-font-sans);
      line-height: 1.6;
      overflow-x: clip;
      display: flex;
      flex-direction: column;
      padding: 0;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
      box-sizing: border-box;
    }

    .om-breathe { color-scheme: light only; }

    .om-breathe *,
    .om-breathe *::before,
    .om-breathe *::after {
      box-sizing: border-box;
    }

    .om-breathe__shell {
      width: 100%;
      max-width: 560px;
      margin: 0 auto;
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: clamp(16px, 3dvh, 28px);
    }

    /* Header */
    .om-breathe__topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      width: 100%;
      min-height: 44px;
    }

    .om-breathe__brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: var(--om-teal-primary);
      text-decoration: none;
    }

    .om-breathe__brand-mark {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background-color: var(--om-gold-accent);
      box-shadow: 0 0 0 4px rgba(201, 169, 110, 0.22);
      flex-shrink: 0;
    }

    .om-breathe__brand-name {
      font-family: var(--om-font-serif);
      font-size: 0.9375rem;
      font-weight: 600;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--om-teal-primary);
    }

    .om-breathe__lang-toggle {
      display: inline-flex;
      align-items: center;
      background-color: var(--om-bg-cream-soft);
      border: 1px solid var(--om-teal-border);
      border-radius: 999px;
      padding: 2px;
      gap: 2px;
    }

    .om-breathe__lang-btn {
      appearance: none;
      -webkit-appearance: none;
      border: 0;
      background: transparent;
      color: var(--om-teal-primary);
      font-family: var(--om-font-sans);
      font-size: 0.875rem;
      font-weight: 500;
      min-width: 48px;
      min-height: 44px;
      padding: 0 12px;
      border-radius: 999px;
      cursor: pointer;
      touch-action: manipulation;
      transition: background-color 220ms ease, color 220ms ease;
    }

    .om-breathe__lang-btn:hover {
      background-color: rgba(21, 58, 64, 0.08);
    }

    .om-breathe__lang-btn[aria-pressed="true"] {
      background-color: var(--om-teal-primary);
      color: var(--om-bg-cream);
    }

    /* Main Stage */
    .om-breathe__main {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: clamp(18px, 3.2dvh, 32px);
      padding: 4px 0;
    }

    /* Header Copy Area */
    .om-breathe__copy {
      max-width: 480px;
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      transition: opacity 360ms ease;
    }

    .om-breathe__title {
      margin: 0 0 10px;
      font-family: var(--om-font-serif);
      font-size: clamp(1.5rem, 4.5vw, 2rem);
      font-weight: 500;
      line-height: 1.3;
      letter-spacing: 0.01em;
      color: var(--om-teal-primary);
    }

    .om-breathe__intro {
      margin: 0;
      max-width: 28em;
      font-size: clamp(0.95rem, 2.5vw, 1.03rem);
      color: var(--om-teal-secondary);
      line-height: 1.65;
      text-wrap: balance;
    }

    .om-breathe[data-lang="zh"] .om-breathe__intro,
    .om-breathe[data-lang="zh-Hant"] .om-breathe__intro {
      max-width: 100%;
      text-wrap: normal;
    }

    .om-breathe__clause {
      display: inline-block;
    }

    .om-breathe__session-meta {
      min-height: 26px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      font-size: 0.9375rem;
      color: var(--om-teal-secondary);
      font-variant-numeric: tabular-nums;
      letter-spacing: 0.02em;
    }

    .om-breathe__status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 2px 10px;
      border-radius: 999px;
      background-color: var(--om-bg-cream-soft);
      border: 1px solid var(--om-teal-border);
      color: var(--om-teal-primary);
      font-size: 0.8125rem;
      font-weight: 500;
    }

    /* Gentle Prompt & Completion Blocks */
    .om-breathe__message-block {
      max-width: 440px;
      width: 100%;
      opacity: 0;
      transition: opacity 600ms ease;
    }

    .om-breathe__message-block.is-visible {
      opacity: 1;
    }

    .om-breathe__message-heading {
      margin: 0 0 10px;
      font-family: var(--om-font-serif);
      font-size: clamp(1.25rem, 4.2vw, 1.75rem);
      font-weight: 500;
      line-height: 1.42;
      color: var(--om-teal-primary);
      text-wrap: balance;
    }

    .om-breathe__message-note {
      margin: 0;
      font-size: 0.95rem;
      color: var(--om-teal-secondary);
      text-wrap: balance;
    }

    /* Breathing Circle Stage */
    .om-breathe__circle {
      position: relative;
      width: var(--om-circle-size);
      height: var(--om-circle-size);
      display: grid;
      place-items: center;
      flex-shrink: 0;
      border-radius: 50%;
      contain: layout style;
      user-select: none;
      -webkit-user-select: none;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    .om-breathe__circle[data-interactive="true"] {
      cursor: pointer;
    }

    .om-breathe__circle[data-interactive="true"]:hover .om-breathe__ring {
      border-color: rgba(201, 169, 110, 0.78);
    }

    .om-breathe__circle[data-interactive="true"]:focus-visible {
      outline: 2.5px solid var(--om-teal-primary);
      outline-offset: 6px;
    }

    .om-breathe__layer {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      pointer-events: none;
      will-change: transform, opacity;
      transform: translateZ(0) scale(1);
    }

    .om-breathe__halo {
      background: radial-gradient(
        circle,
        rgba(201, 169, 110, 0.36) 0%,
        rgba(201, 169, 110, 0.20) 44%,
        rgba(201, 169, 110, 0.06) 64%,
        rgba(201, 169, 110, 0) 78%
      );
    }

    .om-breathe__ring {
      inset: 5%;
      border: 1.25px solid rgba(201, 169, 110, 0.52);
      background: radial-gradient(
        circle,
        rgba(201, 169, 110, 0.10) 0%,
        rgba(201, 169, 110, 0.02) 70%,
        transparent 100%
      );
      transition: border-color 240ms ease;
    }

    .om-breathe__core {
      inset: 8%;
      background: radial-gradient(
        circle at 46% 42%,
        rgba(255, 253, 248, 0.98) 0%,
        rgba(247, 242, 232, 0.94) 44%,
        rgba(227, 217, 198, 0.64) 76%,
        rgba(21, 58, 64, 0.15) 100%
      );
      border: 1px solid rgba(201, 169, 110, 0.38);
      box-shadow:
        inset 0 0 32px rgba(201, 169, 110, 0.28),
        inset 0 1px 14px rgba(255, 255, 255, 0.85),
        0 10px 28px rgba(21, 58, 64, 0.06);
    }

    .om-breathe__inner-glow {
      inset: 13%;
      background: radial-gradient(
        circle,
        rgba(255, 252, 244, 0.92) 0%,
        rgba(201, 169, 110, 0.26) 54%,
        rgba(201, 169, 110, 0) 78%
      );
    }

    /* Phase Label — Sequential Non-Overlapping Soft Transition & WebKit-Safe Wrapping */
    .om-breathe__label-wrap {
      position: relative;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-width: 0;
      max-width: calc(var(--om-circle-size) * 0.56);
      padding: 0 4px;
      pointer-events: none;
    }

    .om-breathe__label {
      display: block;
      width: 100%;
      min-width: 0;
      max-width: 100%;
      font-family: var(--om-font-serif);
      font-size: clamp(0.95rem, 3.1vw, 1.25rem);
      font-weight: 500;
      line-height: 1.32;
      color: var(--om-teal-primary);
      text-align: center;
      overflow-wrap: break-word;
      word-wrap: break-word;
      text-wrap: balance;
      opacity: 1;
      transform: translate3d(0, 0, 0);
      will-change: opacity, transform;
      transition: opacity 220ms ease-out, transform 220ms ease-out;
    }

    .om-breathe__label.is-exiting {
      opacity: 0;
      transform: translate3d(0, -10px, 0);
      transition: opacity 160ms ease-in, transform 160ms ease-in;
    }

    .om-breathe__label.is-entering {
      opacity: 0;
      transform: translate3d(0, 10px, 0);
      transition: none;
    }

    /* Progress Bar */
    .om-breathe__progress {
      width: min(260px, 76%);
      height: 3px;
      border-radius: 999px;
      background-color: rgba(21, 58, 64, 0.14);
      overflow: hidden;
    }

    .om-breathe__progress-fill {
      width: 100%;
      height: 100%;
      background-color: var(--om-gold-accent);
      transform-origin: left center;
      transform: scaleX(0);
      will-change: transform;
    }

    /* Controls Area */
    .om-breathe__controls {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 14px;
    }

    .om-breathe__action-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      gap: 12px;
      width: 100%;
    }

    .om-breathe__btn {
      appearance: none;
      -webkit-appearance: none;
      font-family: var(--om-font-sans);
      font-size: 1rem;
      font-weight: 500;
      letter-spacing: 0.02em;
      min-height: 48px;
      min-width: 132px;
      padding: 10px 26px;
      border-radius: 999px;
      cursor: pointer;
      touch-action: manipulation;
      transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease, transform 180ms ease;
    }

    .om-breathe__btn:active {
      transform: scale(0.985);
    }

    .om-breathe__btn--primary {
      background-color: var(--om-teal-primary);
      color: var(--om-bg-cream);
      border: 1.5px solid var(--om-teal-primary);
      min-width: 164px;
    }

    .om-breathe__btn--primary:hover {
      background-color: var(--om-teal-hover);
      border-color: var(--om-teal-hover);
    }

    .om-breathe__btn--primary:active {
      background-color: var(--om-teal-active);
      border-color: var(--om-teal-active);
    }

    .om-breathe__btn--secondary {
      background-color: var(--om-bg-cream-tint);
      color: var(--om-teal-primary);
      border: 1.5px solid var(--om-teal-border);
    }

    .om-breathe__btn--secondary:hover {
      background-color: var(--om-bg-cream-soft);
      border-color: var(--om-teal-primary);
    }

    .om-breathe__link-btn {
      appearance: none;
      -webkit-appearance: none;
      border: 0;
      background: transparent;
      color: var(--om-teal-secondary);
      font-family: var(--om-font-sans);
      font-size: 0.9375rem;
      font-weight: 500;
      min-height: 44px;
      min-width: 44px;
      padding: 8px 16px;
      border-radius: 999px;
      cursor: pointer;
      touch-action: manipulation;
      text-decoration: underline;
      text-underline-offset: 4px;
      text-decoration-color: rgba(58, 90, 95, 0.45);
      transition: color 200ms ease, text-decoration-color 200ms ease, background-color 200ms ease;
    }

    .om-breathe__link-btn:hover {
      color: var(--om-teal-primary);
      text-decoration-color: var(--om-teal-primary);
      background-color: rgba(21, 58, 64, 0.05);
    }

    .om-breathe__hint {
      margin: 0;
      font-size: 0.875rem;
      color: var(--om-teal-muted);
      letter-spacing: 0.015em;
      text-wrap: balance;
    }

    /* Footer */
    .om-breathe__footer {
      text-align: center;
      font-size: 0.8125rem;
      color: var(--om-teal-muted);
      padding-top: 4px;
    }

    /* Accessible Focus States */
    .om-breathe button:focus-visible {
      outline: 2.5px solid var(--om-teal-primary);
      outline-offset: 3px;
    }

    /* Scoped Utilities */
    .om-breathe .is-hidden {
      display: none !important;
    }

    .om-breathe .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    /* Reduced Motion — Opacity-only transitions, zero scaling/translation */
    @media (prefers-reduced-motion: reduce) {
      .om-breathe__btn:active {
        transform: none;
      }

      .om-breathe__label {
        transform: none;
        will-change: opacity;
        transition: opacity 220ms ease;
      }

      .om-breathe__label.is-exiting {
        opacity: 0;
        transform: none;
        transition: opacity 160ms ease;
      }

      .om-breathe__label.is-entering {
        opacity: 0;
        transform: none;
        transition: none;
      }

      .om-breathe__message-block {
        transition: opacity 500ms ease;
      }

      .om-breathe__layer {
        will-change: opacity;
      }
    }

    /* Short Landscape Viewports */
    @media (max-height: 620px) {
      .om-breathe {
        --om-circle-size: clamp(180px, min(46vw, 35dvh), 224px);
      }

      .om-breathe__main {
        gap: 14px;
      }

      .om-breathe__title {
        font-size: 1.375rem;
        margin-bottom: 6px;
      }
    }


    /* Embed-only: hide standalone chrome if present; never fight the host page language. */
    .om-breathe.is-embed .om-breathe__topbar,
    .om-breathe.is-embed .om-breathe__footer,
    .om-breathe.is-embed .om-breathe__lang-toggle {
      display: none !important;
    }

    /* Optional polish: at 360px the EN pattern hint should wrap after a full phase, not after a trailing ·.
       Slightly tighter tracking helps the line; wrap is also handled by the hint string (space before ·). */
    @media (max-width: 380px) {
      .om-breathe[data-lang="en"] .om-breathe__hint {
        font-size: 0.8125rem;
        letter-spacing: 0;
      }
    }
