:root {
  --warm-50: #fef8f3;
  --warm-100: #fdecd6;
  --warm-200: #fbd5ad;
  --warm-400: #f4a460;
  --warm-600: #d17842;
  --warm-800: #7d3a1f;
  --warm-900: #4a2212;
  --white: #ffffff;
  --black: #1a1410;
  --shadow-sm: 0 2px 8px rgba(125, 58, 31, 0.08);
  --shadow-md: 0 4px 16px rgba(125, 58, 31, 0.12);
  --shadow-lg: 0 12px 40px rgba(125, 58, 31, 0.16);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Theme: Ocean */
[data-theme="ocean"] {
  --warm-50: #f0f9fc;
  --warm-100: #d4eef7;
  --warm-200: #a9ddf0;
  --warm-400: #4a9eca;
  --warm-600: #2c6b8f;
  --warm-800: #1a4158;
  --warm-900: #0f2433;
}

/* Theme: Forest */
[data-theme="forest"] {
  --warm-50: #f3f8f3;
  --warm-100: #dfeede;
  --warm-200: #bfddbe;
  --warm-400: #6b9b6e;
  --warm-600: #4a7c4d;
  --warm-800: #2d4a2f;
  --warm-900: #1a2a1b;
}

/* Theme: Lavender */
[data-theme="lavender"] {
  --warm-50: #f9f6fc;
  --warm-100: #ede5f5;
  --warm-200: #dbc9eb;
  --warm-400: #9b87c4;
  --warm-600: #7564a8;
  --warm-800: #4a3d68;
  --warm-900: #2b233d;
}

/* Theme: Sunset */
[data-theme="sunset"] {
  --warm-50: #fef5f4;
  --warm-100: #fde4e1;
  --warm-200: #fbc6c1;
  --warm-400: #e8796f;
  --warm-600: #c95d54;
  --warm-800: #7d3932;
  --warm-900: #4a211e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--warm-50) 0%, var(--warm-100) 100%);
  color: var(--warm-900);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
  transition: background 0.4s ease;
}

/* ========== Theme Selector (Floating) ========== */
.theme-selector {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
}

.theme-selector__button {
  width: 48px;
  height: 48px;
  border: 2px solid var(--warm-200);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  transition: all 200ms ease;
  box-shadow: var(--shadow-md);
}

.theme-selector__button:hover {
  transform: scale(1.08) rotate(15deg);
  border-color: var(--warm-400);
  box-shadow: var(--shadow-lg);
}

.theme-selector__button:active {
  transform: scale(0.95);
}

.theme-selector__icon {
  display: block;
  line-height: 1;
}

.theme-selector__menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 180px;
  border: 1px solid var(--warm-100);
}

.theme-selector__menu[hidden] {
  display: none;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: left;
  font-size: 0.95rem;
  color: var(--warm-900);
}

.theme-option:hover {
  background: var(--warm-50);
  transform: translateX(2px);
}

.theme-option.is-active {
  background: var(--warm-100);
  font-weight: 600;
}

.theme-option__swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.theme-option__name {
  flex: 1;
}

@media (max-width: 600px) {
  .theme-selector {
    top: 1rem;
    right: 1rem;
  }

  .theme-selector__button {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
}

/* ========== Mobile Menu Toggle ========== */
.menu-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 48px;
  height: 48px;
  border: 2px solid var(--warm-200);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: none;
  place-items: center;
  font-size: 1.5rem;
  transition: all 200ms ease;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  font-family: inherit;
}

.menu-toggle:hover {
  transform: scale(1.08);
  border-color: var(--warm-400);
  box-shadow: var(--shadow-lg);
}

.menu-toggle:active {
  transform: scale(0.95);
}

.menu-toggle__icon {
  display: block;
  line-height: 1;
}

/* ========== Audio Toggle ========== */
.audio-toggle {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border: 2px solid var(--warm-200);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  transition: all 200ms ease;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  font-family: inherit;
}

.audio-toggle:hover {
  transform: scale(1.08);
  border-color: var(--warm-400);
  box-shadow: var(--shadow-lg);
}

.audio-toggle:active {
  transform: scale(0.95);
}

.audio-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--warm-100), var(--warm-200));
  border-color: var(--warm-400);
}

.audio-toggle__icon {
  display: block;
  line-height: 1;
}

@media (max-width: 600px) {
  .audio-toggle {
    top: 4.5rem;
    right: 1rem;
  }
}

/* ========== Mobile Exercise Menu ========== */
.exercises-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 85vw);
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 300ms ease;
  z-index: 1001;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.exercises-menu.is-open {
  transform: translateX(0);
}

.exercises-menu__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--warm-100);
}

.exercises-menu__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--warm-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exercises-menu__close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  color: var(--warm-600);
  cursor: pointer;
  border-radius: 50%;
  transition: all 200ms ease;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.exercises-menu__close:hover {
  background: var(--warm-50);
  color: var(--warm-800);
  transform: rotate(90deg);
}

.exercises-menu__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  z-index: 1000;
}

.menu-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 600px) {
  .menu-toggle {
    display: grid;
  }

  .menu-toggle__icon {
    font-size: 1.3rem;
  }
}

/* ========== Container ========== */
.container {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(2rem, 5vw, 3rem);
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1.5rem;
  }
}

/* ========== Exercises Sidebar ========== */
.exercises {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.exercises__title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-600);
  margin-bottom: 0.4rem;
}

.exercises__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.theme-option.is-active {
  background: var(--warm-100);
  font-weight: 600;
}

.theme-option__swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.theme-option__name {
  flex: 1;
}

/* ========== Container ========== */
.container {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 3rem);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* ========== Exercises Sidebar ========== */
.exercises {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.exercises__title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-600);
  margin-bottom: 0.4rem;
}

.exercises__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.exercises__item {
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.75rem 0 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
  font-family: inherit;
}

.exercises__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--warm-400);
  transition: height 200ms ease;
}

.exercises__item:hover::before {
  height: 60%;
}

.exercises__item.is-active {
  color: var(--warm-800);
}

.exercises__item.is-active::before {
  height: 100%;
  background: var(--warm-600);
}

.exercises__item-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.exercises__item-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-600);
  background: rgba(244, 164, 96, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.exercises__item-goal {
  display: block;
  font-size: 0.85rem;
  color: var(--warm-800);
  opacity: 0.7;
}

/* ========== Stage ========== */
.stage {
  display: grid;
  gap: clamp(1.2rem, 3vw, 1.8rem);
  place-items: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.stage__header {
  text-align: center;
  width: 100%;
}

.stage__title {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
  color: var(--warm-900);
}

.stage__subtitle {
  font-size: 0.95rem;
  color: var(--warm-800);
  opacity: 0.75;
}

/* ========== Breath Visualization ========== */
.breath {
  position: relative;
  width: min(70vw, 280px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 2rem;
}

.breath__progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.breath__track {
  fill: none;
  stroke: var(--warm-100);
  stroke-width: 3;
}

.breath__bar {
  fill: none;
  stroke: var(--warm-400);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 0.3s linear;
}

.breath__orb {
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--white), var(--warm-200));
  box-shadow: 
    0 0 0 1px rgba(244, 164, 96, 0.1),
    0 8px 32px rgba(209, 120, 66, 0.24),
    inset 0 2px 8px rgba(255, 255, 255, 0.8);
  transition: transform 1s ease-in-out;
  will-change: transform;
}

.breath__phase {
  position: absolute;
  bottom: -2.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--warm-800);
  opacity: 0.8;
  text-align: center;
  white-space: nowrap;
}

/* ========== Guidance ========== */
.guidance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.guidance__text {
  font-size: 0.95rem;
  color: var(--warm-800);
  line-height: 1.5;
}

.guidance__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--warm-400), var(--warm-600));
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 200ms ease;
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 1rem 2rem;
  border: 2px solid var(--warm-200);
  border-radius: 50px;
  background: var(--white);
  color: var(--warm-800);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--warm-400);
  background: var(--warm-50);
  transform: translateY(-2px);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ========== Meta ========== */
.meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
  min-width: 100px;
}

.meta__item dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warm-600);
}

.meta__item dd {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--warm-900);
}

/* ========== Drawer (Info Panel) ========== */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.3);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  z-index: 1100;
}

.backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 90vw);
  height: 100vh;
  background: var(--white);
  box-shadow: -8px 0 40px rgba(125, 58, 31, 0.15);
  transform: translateX(100%);
  transition: transform 300ms ease;
  z-index: 1200;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--warm-100);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.drawer__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warm-900);
}

.drawer__close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--warm-600);
  cursor: pointer;
  border-radius: 50%;
  transition: all 200ms ease;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.drawer__close:hover {
  background: var(--warm-50);
  color: var(--warm-800);
}

.drawer__body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drawer__intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--warm-800);
}

.drawer__section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-600);
  margin-bottom: 0.6rem;
}

.drawer__section p,
.drawer__section li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--warm-800);
}

.drawer__section ol,
.drawer__section ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .exercises {
    flex-direction: column;
    align-items: stretch;
  }

  .exercises__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
  }

  .exercises__item {
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
  }

  .exercises__item::before {
    display: none;
  }

  .exercises__item.is-active {
    background: var(--warm-100);
    border-bottom-color: var(--warm-600);
  }

  .exercises__item-goal {
    display: none;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0;
  }

  .container {
    grid-template-columns: 1fr;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .exercises {
    display: none;
  }

  .stage {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
  }

  .breath {
    width: min(75vw, 260px);
    margin-bottom: 1.5rem;
  }

  .breath__phase {
    font-size: 0.85rem;
    bottom: -2rem;
  }

  .guidance {
    max-width: 100%;
    padding: 0 1rem;
  }

  .guidance__text {
    font-size: 0.9rem;
  }

  .btn {
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
  }

  .btn-secondary {
    padding: 0.9rem 1.75rem;
    font-size: 0.95rem;
  }

  .meta {
    gap: 1rem;
    padding: 0 1rem;
  }

  .meta__item {
    min-width: 70px;
  }

  .meta__item dt {
    font-size: 0.65rem;
  }

  .meta__item dd {
    font-size: 0.85rem;
  }

  .drawer {
    width: 100vw;
  }

  .drawer__header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .drawer__title {
    font-size: 1.3rem;
  }

  .drawer__body {
    padding: 1.5rem;
  }

  .drawer__intro {
    font-size: 1rem;
  }

  .drawer__section h4 {
    font-size: 0.85rem;
  }

  .drawer__section p,
  .drawer__section li {
    font-size: 0.9rem;
  }
}

/* ========== Custom Breath Creator ========== */
.exercises__custom-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-my-sequences {
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--warm-300);
  border-radius: 12px;
  background: var(--warm-50);
  color: var(--warm-700);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
  width: 100%;
}

.btn-my-sequences:hover {
  border-color: var(--warm-400);
  background: var(--warm-100);
  color: var(--warm-800);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(125, 58, 31, 0.15);
}

.btn-create-custom {
  padding: 0.75rem 1.25rem;
  border: 2px dashed var(--warm-300);
  border-radius: 12px;
  background: transparent;
  color: var(--warm-700);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
  width: 100%;
}

.btn-create-custom:hover {
  border-color: var(--warm-400);
  background: var(--warm-50);
  color: var(--warm-800);
  border-style: solid;
}

#custom-backdrop {
  z-index: 1250;
}

.custom-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: min(500px, 90vw);
  max-height: 90vh;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 1300;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: all 250ms ease;
}

.custom-modal:not([hidden]) {
  display: flex;
}

.custom-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.custom-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem 1rem;
  border-bottom: 2px solid var(--warm-100);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
  border-radius: 20px 20px 0 0;
}

.custom-modal__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--warm-900);
}

.custom-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--warm-600);
  cursor: pointer;
  border-radius: 50%;
  transition: all 200ms ease;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.custom-modal__close:hover {
  background: var(--warm-50);
  color: var(--warm-800);
  transform: rotate(90deg);
}

.custom-modal__form {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warm-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--warm-200);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--warm-900);
  background: var(--white);
  transition: all 200ms ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--warm-400);
  box-shadow: 0 0 0 3px rgba(244, 164, 96, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.custom-modal__preview {
  padding: 1rem;
  background: var(--warm-50);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--warm-800);
  border-left: 4px solid var(--warm-400);
}

.custom-modal__preview strong {
  color: var(--warm-600);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-modal__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.custom-modal__actions .btn,
.custom-modal__actions .btn-secondary {
  flex: 1;
  min-width: 140px;
}

.saved-list {
  padding: 0 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.saved-list__title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-600);
  margin-bottom: 0.5rem;
}

.saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--warm-50);
  border-radius: 10px;
  border: 1px solid var(--warm-100);
  transition: all 200ms ease;
}

.saved-item:hover {
  border-color: var(--warm-300);
  background: var(--white);
}

.saved-item__info {
  flex: 1;
}

.saved-item__name {
  font-weight: 600;
  color: var(--warm-900);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.saved-item__pattern {
  font-size: 0.8rem;
  color: var(--warm-700);
  opacity: 0.8;
}

.saved-item__actions {
  display: flex;
  gap: 0.5rem;
}

.saved-item__btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--warm-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--warm-700);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
}

.saved-item__btn:hover {
  border-color: var(--warm-400);
  background: var(--warm-50);
  color: var(--warm-800);
}

.saved-item__btn--delete:hover {
  border-color: #e85d5d;
  background: #fee;
  color: #c00;
}

@media (max-width: 600px) {
  .btn-create-custom {
    display: none;
  }

  .custom-modal {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .custom-modal__header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-radius: 0;
  }

  .custom-modal__title {
    font-size: 1.2rem;
  }

  .custom-modal__form {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .saved-list {
    padding: 0 1.5rem 1.5rem;
  }
}

/* ========== Shared Breath Popup ========== */
#shared-backdrop {
  z-index: 1400;
}

.shared-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: min(420px, 90vw);
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(125, 58, 31, 0.25);
  z-index: 1450;
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shared-popup:not([hidden]) {
  display: block;
}

.shared-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.shared-popup__icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: bounce-in 600ms ease;
}

@keyframes bounce-in {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.shared-popup__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warm-900);
  margin-bottom: 1rem;
}

.shared-popup__name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--warm-600);
  margin-bottom: 0.75rem;
}

.shared-popup__pattern {
  font-size: 0.95rem;
  color: var(--warm-700);
  background: var(--warm-50);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border-left: 4px solid var(--warm-400);
}

.shared-popup__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shared-popup__actions .btn,
.shared-popup__actions .btn-secondary {
  width: 100%;
  justify-content: center;
}

@media (max-width: 600px) {
  .shared-popup {
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 20px;
  }

  .shared-popup__icon {
    font-size: 3rem;
  }

  .shared-popup__title {
    font-size: 1.3rem;
  }

  .shared-popup__name {
    font-size: 1.1rem;
  }
}

/* ========== Sequences Modal ========== */
#sequences-backdrop {
  z-index: 1400;
}

.sequences-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, 90vw);
  max-height: 70vh;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(125, 58, 31, 0.25);
  z-index: 1450;
  opacity: 0;
  pointer-events: none;
  transition: all 300ms ease;
  display: flex;
  flex-direction: column;
}

.sequences-modal:not([hidden]) {
  display: flex;
}

.sequences-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sequences-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2rem 1rem;
  border-bottom: 2px solid var(--warm-100);
}

.sequences-modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warm-900);
  margin: 0;
}

.sequences-modal__close {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--warm-100);
  color: var(--warm-700);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: all 200ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sequences-modal__close:hover {
  background: var(--warm-200);
  color: var(--warm-900);
  transform: rotate(90deg);
}

.sequences-modal__content {
  padding: 1.5rem 2rem 2rem;
  overflow-y: auto;
  flex: 1;
}

.sequences-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--warm-600);
}

.sequences-empty p {
  margin: 0;
  font-size: 1.1rem;
}

.sequences-empty__hint {
  font-size: 0.9rem !important;
  margin-top: 0.5rem !important;
  opacity: 0.7;
}

.sequences-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sequence-card {
  background: var(--warm-50);
  border: 2px solid var(--warm-200);
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 200ms ease;
}

.sequence-card:hover {
  border-color: var(--warm-300);
  box-shadow: 0 4px 12px rgba(125, 58, 31, 0.1);
  transform: translateY(-2px);
}

.sequence-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sequence-card__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--warm-900);
  margin: 0;
}

.sequence-card__date {
  font-size: 0.8rem;
  color: var(--warm-500);
}

.sequence-card__pattern {
  font-size: 0.9rem;
  color: var(--warm-700);
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--white);
  border-radius: 8px;
  border-left: 3px solid var(--warm-400);
}

.sequence-card__actions {
  display: flex;
  gap: 0.5rem;
}

.sequence-card__btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 2px solid var(--warm-300);
  background: var(--white);
  color: var(--warm-700);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
}

.sequence-card__btn:hover {
  border-color: var(--warm-400);
  background: var(--warm-50);
  transform: translateY(-1px);
}

.sequence-card__btn--delete {
  flex: 0 0 auto;
  width: 40px;
  padding: 0;
  border-color: var(--warm-200);
  color: var(--warm-500);
  font-size: 1.3rem;
}

.sequence-card__btn--delete:hover {
  border-color: #ef4444;
  background: #fee;
  color: #dc2626;
}

@media (max-width: 600px) {
  .sequences-modal {
    width: 95vw;
    max-height: 80vh;
    border-radius: 20px;
  }

  .sequences-modal__header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .sequences-modal__title {
    font-size: 1.3rem;
  }

  .sequences-modal__content {
    padding: 1rem 1.5rem 1.5rem;
  }

  .sequence-card {
    padding: 1rem;
  }

  .sequence-card__actions {
    flex-wrap: wrap;
  }

  .sequence-card__btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
}
