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

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

input[type="checkbox"] {
  accent-color: #6d28d9;
}

/* ==========================================
   Global Micro-Interactions & Animations
   ========================================== */

/* Smooth transitions on all interactive elements */
a, button, input, select, textarea, .switch {
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Subtle lift on hover for all buttons */
button:not(:disabled):hover,
.action-btn:not(:disabled):hover {
  transform: translateY(-1px);
}
button:not(:disabled):active,
.action-btn:not(:disabled):active {
  transform: translateY(0) scale(0.97);
}

/* Focus ring for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6d28d9;
  outline-offset: 2px;
  transition: outline-offset 0.15s ease;
}

/* Smooth image loads */
img {
  transition: opacity 0.3s ease;
}

/* Flow item card press effect */
.flow-item:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Smooth scroll for all scrollable containers */
.flow-items,
.asana-category-buttons,
.home-action-bar,
.recommended-inline-list,
#asanaList,
.settings-body,
.build-left-panel,
.build-right-panel {
  scroll-behavior: smooth;
}

/* Modal backdrop fade */
.settings-modal-overlay,
.breath-picker-overlay,
.onboarding-overlay {
  animation: overlayFadeIn 0.25s ease;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal content slide-up */
.settings-panel,
.breath-picker-content,
.onboarding-carousel,
.pose-detail-content {
  animation: modalSlideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Checkbox & toggle tick animation */
input[type="checkbox"] {
  transition: all 0.15s ease;
}
input[type="checkbox"]:checked {
  animation: checkPop 0.2s ease;
}
@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Staggered list item entrance */
@keyframes listItemIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Category filter button press */
.category-btn:active {
  transform: scale(0.93);
}

/* SVG icon hover rotation for interactive icons */
.settings-gear-btn:hover svg {
  transform: rotate(45deg);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.settings-gear-btn svg {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Toggle switch smooth slide */
.slider:before {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease;
}
input:checked + .slider:before {
  box-shadow: 0 1px 4px rgba(109, 40, 217, 0.3);
}

/* Input field focus glow */
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Tooltip-style hover labels */
[title]:hover {
  cursor: pointer;
}

/* Ripple-like feedback on tap for touch devices */
@media (hover: none) {
  button:active, .action-btn:active, .home-action-btn:active, .category-btn:active {
    opacity: 0.7;
    transition: opacity 0.1s ease;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* App Store Floating Banner */
.app-store-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  width: 100%;
  margin: 0;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.3);
}

/* Push page content below the fixed banner */
body:has(.app-store-banner:not(.hidden)) {
  padding-top: 58px;
}

body:has(.app-store-banner.hidden) {
  padding-top: 0;
}

.app-store-banner.hidden {
  display: none;
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

.banner-app-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.banner-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.banner-app-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.banner-app-subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-open-btn {
  background-color: #fff;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 18px;
  border-radius: 20px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  transition: background-color 0.2s;
}

.banner-open-btn:hover {
  background-color: #f3f0ff;
}

.banner-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  flex-shrink: 0;
}

.banner-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 480px) {
  .app-store-banner {
    top: 0;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    gap: 10px;
  }
  .banner-app-icon {
    width: 38px;
    height: 38px;
  }
  .banner-app-name { font-size: 13px; }
  .banner-open-btn { padding: 5px 14px; font-size: 12px; }
}

button, input, select, textarea {
  font-family: inherit;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f7;
  color: #1d1d1f;
  margin: 0;
  padding: 0;
  border: 0;
}

body.flow-mode {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.accent-bar {
  width: 100%;
  height: 6px;
  background: #6d28d9;
  flex-shrink: 0;
  margin: 0;
  position: relative;
  z-index: 1;
}

header {
  background-color: #ffffff;
  padding: 8px 24px 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: none;
  position: relative;
}

header .settings-gear-btn {
  position: absolute;
  left: 24px;
}

header .header-buttons {
  position: absolute;
  right: 24px;
  gap: 8px;
}

header .import-flow-btn {
  background: none;
  border: 1px solid #d2d2d7;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #86868b;
  transition: all 0.2s ease;
}

header .import-flow-btn:hover {
  background: #f5f5f7;
  color: #1d1d1f;
  border-color: #86868b;
}

h1 {
  color: #1d1d1f;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.15rem;
  line-height: 1.4;
  text-align: center;
}

.build-flow-btn {
  display: none;
}

.past-flows {
  display: none;
}

.white-section {
  display: none;
}

#homeScreen {
  position: relative;
  min-height: 100vh;
  flex-direction: column;
}
#homeScreen.active {
  display: flex !important;
}
#homeScreen > main {
  flex: 1;
}

.flow-list {
  background-color: transparent;
  overflow: visible;
  margin: 0 24px;
  border-radius: 0;
  border: none;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px;
}

.flow-date {
  background-color: transparent;
  padding: 16px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flow-date h3 {
  display: none;
}

.flow-date-text {
  font-size: 14px;
  color: #86868b;
  font-weight: 400;
}

/* Floating Action Button */
.fab-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #6d28d9;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35);
  transition: all 0.2s ease;
  z-index: 900;
}

.fab-btn:hover {
  background-color: #5b21b6;
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.45);
  transform: scale(1.05);
}

.fab-btn:active {
  transform: scale(0.95);
}

/* Home Action Bar (inline under title) */
.home-action-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 24px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: wrap;
  background: #ffffff;
  border-bottom: 1px solid #d2d2d7;
}
.home-action-bar::-webkit-scrollbar { display: none; }

.home-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid #e0e0e0;
  background: white;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.home-action-btn:hover {
  background: #f5f5f7;
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.home-action-btn:active {
  transform: scale(0.97);
}
.home-action-btn.home-action-hero {
  background: #6d28d9;
  color: white;
  border-color: #6d28d9;
  font-weight: 600;
}
.home-action-btn.home-action-hero:hover {
  background: #5b21b6;
  border-color: #5b21b6;
}

/* Generate Flow FAB */
.generate-fab {
  position: fixed; bottom: 28px; right: 28px; height: 56px;
  border-radius: 28px; border: none; background: #6d28d9; color: #fff;
  cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(109,40,217,0.4);
  padding: 0 17px; gap: 0;
  overflow: hidden; white-space: nowrap;
  max-width: 56px;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              transform 0.3s ease;
}
.generate-fab svg { stroke: #fff; flex-shrink: 0; }
.generate-fab-label {
  max-width: 0; opacity: 0; overflow: hidden;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  margin-left: 0;
  transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease 0.05s,
              margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.generate-fab:hover {
  max-width: 240px;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(109,40,217,0.5);
}
.generate-fab:hover .generate-fab-label {
  max-width: 160px; opacity: 1; margin-left: 10px;
}
.generate-fab:active { transform: scale(0.95); }

/* Home Footer */
.home-footer {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 24px 20px; font-size: 12px; color: #999;
  margin-top: auto;
}
.home-footer a {
  color: #6d28d9; text-decoration: none; font-weight: 500;
  transition: color 0.2s;
}
.home-footer a:hover { color: #5b21b6; text-decoration: underline; }

/* Fun Global Range Sliders */
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #e0d4f5, #6d28d9); outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: #6d28d9; cursor: pointer;
  box-shadow: 0 2px 8px rgba(109,40,217,0.35); border: 3px solid #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15); box-shadow: 0 3px 12px rgba(109,40,217,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #6d28d9;
  cursor: pointer; box-shadow: 0 2px 8px rgba(109,40,217,0.35); border: 3px solid #fff;
}
input[type="range"]:focus { outline: none; }

.flow-count {
  color: #86868b;
  font-size: 14px;
  font-weight: 500;
  padding-left: 0;
}

.flow-items {
  background-color: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.flow-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 24px;
  position: relative;
  animation: flowItemFadeIn 0.3s ease-out both;
  background: #ffffff;
  border: 1px solid #d2d2d7;
  border-radius: 16px;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

.flow-item:hover {
  border-color: #b0b0b5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

@keyframes flowItemFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.flow-item::after {
  display: none;
}

.flow-item:last-child::after {
  display: none;
}

.flow-info {
  width: 100%;
}

.flow-info h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1d1d1f;
}

.flow-description {
  color: #86868b;
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flow-timestamps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 0;
  margin-bottom: 14px;
}

.timestamp {
  font-size: 13px;
  color: #86868b;
  display: flex;
  align-items: center;
}

.timestamp svg {
  margin-right: 4px;
}

.timestamp.active {
  color: #6d28d9;
  font-weight: 500;
}

.timestamp.active::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #6d28d9;
  border-radius: 50%;
  margin-right: 6px;
}

.flow-item.recent {
  border-left: 3px solid #6d28d9;
  background-color: rgba(109, 40, 217, 0.02);
}

.flow-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 8px;
}

.flow-btn {
  background-color: #6d28d9;
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.edit-btn,
.delete-btn,
.share-btn,
.analyse-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: #86868b;
  box-shadow: none;
}

.flow-btn:hover {
  background-color: #5b21b6;
  opacity: 0.85;
}

.flow-btn:active {
  transform: scale(0.97);
}

/* Triple-dot more button (mobile only) */
.flow-more-btn {
  display: none;
  background: none;
  border: none;
  color: #86868b;
  padding: 4px;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.flow-more-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.edit-btn,
.delete-btn,
.share-btn {
  background-color: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.edit-btn:hover,
.delete-btn:hover,
.share-btn:hover {
  opacity: 0.85;
  border-color: #6d28d9;
  color: #6d28d9;
}

.edit-btn:active,
.delete-btn:active,
.share-btn:active {
  transform: scale(0.97);
}

.edit-btn::after {
  content: "✎";
  font-size: 18px;
}

.delete-btn::after {
  content: "";
  font-size: 18px;
}

.share-btn::after {
  content: "↗";
  font-size: 18px;
}

.header-buttons {
  display: flex;
  gap: 15px;
}

.import-flow-btn {
  background-color: #fff;
  color: #333;
  border: 1px solid #333;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.import-flow-btn:hover {
  background-color: #f5f5f7;
  opacity: 0.85;
}

.import-flow-btn:active {
  transform: scale(0.97);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: auto;
  transition: opacity 0.3s ease;
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 36px;
  border-radius: 20px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  position: relative;
  animation: modalAppear 0.3s ease forwards;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: #333;
}

.modal h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 15px;
  text-align: center;
}

.modal-description {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
  text-align: center;
}



.import-error {
  text-align: center;
  color: #f44336;
  font-weight: bold;
  margin-top: 15px;
  display: none;
}

.screen {
  display: none !important;
  display: none !important;
}

.active {
  display: block !important;
  display: block !important;
}

.screen.active {
  display: block !important;
  animation: screenFadeIn 0.3s ease-out;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen.slide-up-enter.active {
  animation: screenSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes screenSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pose-transition {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

#buildScreen {
  padding: 0;
  background-color: #f5f5f7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.build-content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-height: 100vh;
}

/* Build Screen - override for new iPad layout */
#buildScreen.active {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  height: 100vh;
  overflow: hidden;
}

/* Build Screen Title (hidden in new layout) */
.build-title {
  display: none;
  color: #000;
  font-size: 48px;
  font-weight: 100;
  letter-spacing: 0.2rem;
  margin: 10px 0 20px 0;
  text-align: center;
  width: 100%;
}

/* Auto-save indicator */
#save-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

#save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.build-form {
  display: none; /* Hidden in new iPad layout - replaced by build-flow-info */
  width: 90%;
  max-width: 800px;
  margin: 30px 0;
  flex-direction: column;
  align-items: center;
}

#buildScreen .build-form input,
#buildScreen .build-form textarea {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 16px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease;
}

#buildScreen .build-form input:focus,
#buildScreen .build-form textarea:focus {
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
  outline: none;
}

#buildScreen .build-form textarea {
  height: 100px;
  resize: vertical;
}

.flow-duration {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flow-duration label {
  font-weight: bold;
  color: #333;
}

#flowTime {
  font-size: 18px;
  color: #6d28d9;
  font-weight: bold;
  margin: 0;
}

.asana-selection, .flow-sequence {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.asana-section-title {
  display: none; /* Hidden in new layout */
  font-size: 1.5rem;
  color: #333;
  margin: 0;
  text-align: center;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.asana-category-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.asana-category-buttons::-webkit-scrollbar { display: none; }

.category-btn {
  background-color: #ffffff;
  border: 1px solid #d2d2d7;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  transition: all 0.2s ease;
  box-shadow: none;
}

.category-btn:hover {
  background-color: #f5f5f7;
  color: #333;
  border-color: #c7c7cc;
}

.category-btn.active {
  background-color: #6d28d9;
  color: white;
  font-weight: 600;
  border-color: #6d28d9;
}

.category-btn.active:hover {
  background-color: #5b21b6;
  border-color: #5b21b6;
}
.chakra-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.chakra-filter { white-space: nowrap; }

/* Inline recommended poses */
.recommended-inline {
  padding: 8px 16px 4px;
  border-bottom: 1px solid #e5e5ea;
  overflow: hidden;
  animation: recommendedSlideIn 0.3s ease-out;
}
.recommended-inline.hiding {
  animation: recommendedSlideOut 0.25s ease-in forwards;
}
@keyframes recommendedSlideIn {
  from { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
  to { max-height: 200px; opacity: 1; padding-top: 8px; padding-bottom: 4px; }
}
@keyframes recommendedSlideOut {
  from { max-height: 200px; opacity: 1; padding-top: 8px; padding-bottom: 4px; }
  to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
}
.recommended-inline-title {
  font-size: 12px; font-weight: 600; color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none;
}
.recommended-inline-title:hover { color: #6d28d9; }
.recommended-inline-title .collapse-arrow {
  font-size: 10px; transition: transform 0.2s ease; display: inline-block;
}
.recommended-inline.collapsed .collapse-arrow {
  transform: rotate(-90deg);
}
.recommended-inline.collapsed .recommended-inline-list {
  max-height: 0; opacity: 0; padding-bottom: 0; margin-bottom: 0; overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.recommended-inline-list {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
  max-height: 200px; opacity: 1; transition: max-height 0.25s ease, opacity 0.2s ease;
}
.recommended-inline-list::-webkit-scrollbar { display: none; }
.recommended-inline-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 70px; max-width: 80px; cursor: pointer; padding: 6px;
  border-radius: 10px; transition: background 0.15s, transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}
.recommended-inline-item:hover { background: #f3f0ff; }
.recommended-inline-item img { width: 50px; height: 50px; object-fit: contain; border-radius: 8px; background: #f5f5f7; border: none; }
.recommended-inline-item span { font-size: 10px; text-align: center; color: #555; line-height: 1.2; word-break: break-word; }

.asana-scroll-container {
  position: relative;
  display: contents; /* Let children flow directly into parent grid */
  width: 100%;
  margin: 0;
}

.scroll-btn {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #6d28d9;
  color: white;
  border: none;
  font-size: 12px;
  display: none; /* Hidden by default, will be shown via JS when needed */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.scroll-btn:hover {
  background-color: #5b21b6;
  transform: scale(1.1);
}

.scroll-left {
  left: -18px;
}

.scroll-right {
  right: -18px;
}

.drag-drop-hint {
  color: #888;
  font-size: 14px;
  font-style: italic;
  margin-top: 15px;
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
  padding: 10px;
}

/* Card view for flow sequence */
.view-toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.view-toggle-btn {
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.view-toggle-btn.active {
  background-color: #6d28d9;
  color: white;
  border-color: #6d28d9;
}

.view-toggle-btn:hover:not(.active) {
  background-color: #e8e8e8;
}

/* Card view container - responsive grid that fills available space */
.flow-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Individual asana card */
.asana-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  border-radius: 14px;
  border: 1px solid #e8e8ed;
  box-shadow: none;
  padding: 14px 10px 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.asana-card:hover {
  background-color: #faf8ff;
  border-color: #6d28d9;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.08);
}

.asana-card.selected {
  border: 2px solid #6d28d9;
  background-color: #faf8ff;
  transform: none;
  box-shadow: none;
}

/* Card image container and image */
.card-image {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.card-image img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: contain;
  background-color: #f9f9fb;
  padding: 4px;
  border: 1px solid #e8e8ed;
  box-shadow: none;
  transition: all 0.2s ease;
}

.asana-card:hover .card-image img {
  transform: scale(1.05);
  border-color: #d4bfff;
}

/* Card text content */
.card-name {
  font-weight: 600;
  font-size: 12.5px;
  color: #333;
  margin-bottom: 4px;
  text-align: center;
  line-height: 1.3;
  min-height: 1.3em;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  width: 100%;
}

.asana-card:hover .card-name {
  color: #6d28d9;
}

/* Card duration input */
.card-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  font-size: 12px;
  color: #86868b;
  font-weight: 600;
}

.card-duration input {
  width: 36px;
  padding: 3px 2px;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-right: 1px;
  outline: none;
  transition: all 0.2s ease;
}

.card-duration input:focus {
  border-bottom-color: #6d28d9;
  color: #6d28d9;
  outline: none;
}

/* Card number badge */
.card-number {
  position: absolute;
  top: -6px;
  left: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background-color: #6d28d9;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 10px;
  z-index: 2;
  box-shadow: none;
}

/* Card checkbox */
.card-checkbox {
  position: absolute;
  top: 10px;
  left: 35px;
  z-index: 10;
  width: 20px;
  height: 20px;
  opacity: 0;
  cursor: pointer;
}

/* Card side & breath dropdowns */
.card-side,
.card-breath {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-side select,
.card-breath select {
  width: 100%;
  max-width: 110px;
  padding: 3px 20px 3px 6px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid transparent;
  background-color: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: #86868b;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2386868b' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 12px;
  transition: all 0.2s ease;
}

.card-side select:focus,
.card-breath select:focus {
  outline: none;
  border-bottom: 1px solid #6d28d9;
  color: #6d28d9;
  box-shadow: none;
}

.card-side select:hover,
.card-breath select:hover {
  color: #6d28d9;
}

/* Card actions */
.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}

.card-actions .table-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-actions .swap-btn {
  background-color: #4CAF50;
  color: white;
}

.card-actions .remove-btn {
  background-color: #ff6b6b;
  color: white;
}

.card-actions .table-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Remove button for card view - positioned in top right corner */
.card-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background-color: transparent;
  color: #ccc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  box-shadow: none;
  opacity: 0;
}

.asana-card:hover .card-remove-btn {
  opacity: 1;
}

.card-remove-btn:hover {
  background-color: #ff4444;
  color: white;
  transform: scale(1.1);
}

/* Section card styling for card view */
.section-card {
  width: 100%;
  grid-column: 1 / -1;
  margin: 12px 0 4px 0;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e8e8ed;
  box-shadow: none;
  overflow: hidden;
  transition: all 0.2s ease;
}

.section-card:hover {
  border-color: #d4bfff;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent;
  border-bottom: none;
}

.section-card-header.section-color-0 {
  background: transparent;
  border-left: 3px solid #6d28d9;
}

.section-card-header.section-color-1 {
  background: transparent;
  border-left: 3px solid #7c3aed;
}

.section-card-header.section-color-2 {
  background: transparent;
  border-left: 3px solid #a78bfa;
}

.section-card .section-select {
  margin-right: 10px;
  transform: scale(1.1);
  cursor: pointer;
  accent-color: #6d28d9;
}

.section-card .section-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card .section-name:hover {
  color: #6d28d9;
}

.section-card .section-info {
  font-size: 12px;
  font-weight: 600;
  color: #86868b;
  background: transparent;
  padding: 0;
  border-radius: 0;
  margin-right: 10px;
  border: none;
  white-space: nowrap;
}

.section-card .section-color-0 .section-info,
.section-card .section-color-1 .section-info,
.section-card .section-color-2 .section-info {
  color: #86868b;
  background: transparent;
}

.section-card .remove-btn {
  background: transparent;
  color: #ccc;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-card .remove-btn:hover {
  background: #ff4444;
  color: white;
  transform: none;
  box-shadow: none;
}

/* Add spacing between section cards and following pose cards */
.section-card + .asana-card {
  margin-top: 4px;
}

/* Individual card */
.flow-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid #ececee;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  padding: 14px 12px 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.flow-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 4px 12px rgba(109,40,217,0.08);
  background: #faf8ff;
}

.flow-card.selected {
  border: 1.5px solid #6d28d9;
  background: #f5f0ff;
  box-shadow: 0 0 0 3px rgba(109,40,217,0.1);
}

.flow-card.selected::before { display: none; }

.flow-card-number {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  top: 6px;
  left: 6px;
  z-index: 2;
  box-sizing: border-box;
}

.flow-card-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
  width: 20px;
  height: 20px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1.5px solid #d2d2d7;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.flow-card-checkbox:checked {
  background: #6d28d9;
  border-color: #6d28d9;
}
.flow-card-checkbox:checked::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 1px auto 0;
}

.flow-card-image {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: contain;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  padding: 8px;
  border: none;
  transition: transform 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
}

.flow-card:hover .flow-card-image {
  transform: scale(1.08);
}

.flow-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
  gap: 2px;
}

.flow-card-name {
  font-weight: 600;
  font-size: 12.5px;
  color: #1d1d1f;
  margin: 0;
  width: 100%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.flow-card:hover .flow-card-name {
  color: #6d28d9;
}

.flow-card-side {
  display: none;
}

.flow-card-side select {
  width: 100px;
  padding: 5px 8px;
  border-radius: 5px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 30px;
  text-align: center;
}

.flow-card-side select:focus {
  outline: none;
  border-color: #6d28d9;
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.1);
}

.flow-card-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: #86868b;
}

.duration-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.flow-card-duration input {
  width: 52px;
  padding: 4px 6px;
  border: 1px solid #e5e5ea;
  border-radius: 6px;
  background: #fafafa;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: #1d1d1f;
  outline: none;
  transition: border-color 0.2s;
}

.flow-card-duration input:focus {
  border-color: #6d28d9;
}

/* Side badge (F/B/L/R) - iPad style */
.flow-card-side-badge {
  position: absolute;
  top: 28px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  color: white;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.flow-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
}

.flow-card .remove-btn {
  width: 20px;
  height: 20px;
  background: rgba(255,59,48,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  font-size: 13px;
  font-weight: bold;
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  padding: 0;
  line-height: 1;
  opacity: 0;
}

.flow-card:hover .remove-btn {
  opacity: 1;
}

.flow-card .remove-btn:hover {
  background: #ff3b30;
  transform: scale(1.15);
}

/* Hide one view depending on active toggle */
.flow-sequence.card-view-active .flow-table-container {
  display: none;
}

.flow-sequence.table-view-active .flow-cards {
  display: none;
}

/* Drag and drop styles for cards */
.flow-card.dragging {
  opacity: 0.85;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
  transform: scale(1.05) rotate(1deg);
  z-index: 100;
  cursor: grabbing;
  position: relative;
  animation: card-float 0.3s ease-out forwards;
  will-change: transform;
}

@keyframes card-float {
  0% { transform: scale(1) rotate(0deg); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); }
  100% { transform: scale(1.05) rotate(1deg); box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2); }
}

/* Drop indicator removed - drag and drop disabled */

/* Card transitions */
.flow-card {
  user-select: none;
}

/* Move-up animation for cards when one is removed */
@keyframes card-move-up {
  0% { transform: translateY(0); opacity: 1; }
  10% { transform: translateY(5px); opacity: 0.9; }
  30% { transform: translateY(-5px); opacity: 1; }
  50% { transform: translateY(0); opacity: 1; }
}

/* Move-down animation for cards when one is inserted */
@keyframes card-move-down {
  0% { transform: translateY(0); opacity: 1; }
  10% { transform: translateY(-5px); opacity: 0.9; }
  30% { transform: translateY(5px); opacity: 1; }
  50% { transform: translateY(0); opacity: 1; }
}

/* Smooth fade-in for newly added cards */
@keyframes card-fade-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#asanaList {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: #86868b #f5f5f7;
  -webkit-overflow-scrolling: touch;
  min-height: 100px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 260px);
}

/* Styling the scrollbar for webkit browsers */
#asanaList::-webkit-scrollbar {
  height: 8px;
}

#asanaList::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

#asanaList::-webkit-scrollbar-thumb {
  background-color: #86868b;
  border-radius: 4px;
}

/* Add padding to last item to ensure scrolling works properly */
#asanaList .asana-container:last-child {
  padding-right: 20px;
}

/* ═══════════════════════════════════════════
   FLOW TABLE — LIST VIEW
   ═══════════════════════════════════════════ */
.flow-table-container {
  overflow-x: hidden;
  width: 100%;
  contain: layout style;
}

#flowTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: transparent;
}

/* Hide header row — info is self-evident */
#flowTable thead { display: none; }

/* ── Cells ── */
#flowTable td {
  padding: 7px 4px;
  vertical-align: middle;
  background: #fff;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

#flowTable tr:last-child td { border-bottom: none; }

/* Subtle hover */
#flowTable tr:not(.section-header):hover td { background: #faf8ff; }

/* ── Column 1: # ── */
#flowTable td:nth-child(1) {
  width: 1%;
  white-space: nowrap;
  padding: 7px 2px 7px 10px;
  color: #b0b0b5;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: grab;
}
#flowTable td:nth-child(1):hover { color: #6d28d9; }

/* ── Column 2: Checkbox ── */
#flowTable td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
  padding: 7px 6px 7px 0;
}
#flowTable td:nth-child(2) input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  accent-color: #6d28d9;
  cursor: pointer;
}

/* ── Column 3: Pose (image + name) ── */
#flowTable td:nth-child(3) { padding: 5px 8px; }

/* ── Column 4: Duration ── */
#flowTable td:nth-child(4) {
  width: 1%;
  white-space: nowrap;
  text-align: left;
  padding: 7px 4px;
}

/* ── Column 5: Side ── */
#flowTable td:nth-child(5) {
  width: auto;
  min-width: 70px;
  white-space: nowrap;
  text-align: center;
  padding: 7px 4px;
}

/* ── Column 6: Breath ── */
#flowTable td:nth-child(6) {
  width: auto;
  min-width: 80px;
  white-space: nowrap;
  text-align: center;
  padding: 7px 8px 7px 4px;
}

/* Mobile tappable cycle elements */
.mobile-side-cycle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f0f0f0;
  color: #1d1d1f;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s;
}
.mobile-side-cycle:active { transform: scale(0.9); background: #e0e0e0; }
.mobile-breath-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f0f0f0;
  color: #999;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s;
}
.mobile-breath-emoji:active { transform: scale(0.9); background: #e0e0e0; }
.mobile-breath-emoji[data-breath="Inhale"],
.mobile-breath-emoji[data-breath="Exhale"],
.mobile-breath-emoji[data-breath="Breathe Here"] { color: #1d1d1f; background: #e8e8e8; }

/* ── Shared select style (side + breath) ── */
#flowTable select.side-select,
#flowTable select.breath-select {
  display: inline-block;
  padding: 4px 18px 4px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff url("data:image/svg+xml;utf8,<svg fill='%23999' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 4px center / 10px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  text-align: center;
  min-width: 60px;
  box-sizing: border-box;
}
#flowTable select.side-select:hover,
#flowTable select.breath-select:hover { color: #6d28d9; }
#flowTable select.side-select:focus,
#flowTable select.breath-select:focus {
  outline: none;
  border-bottom-color: #6d28d9;
  color: #6d28d9;
}

/* Side option tints */
#flowTable select.side-select option[value="Left"]   { background: #e8f4ff; }
#flowTable select.side-select option[value="Right"]  { background: #ede9fe; }
#flowTable select.side-select option[value="Center"] { background: #f0f0f0; }

/* ── Duration input ── */
#flowTable input[type="number"] {
  width: 36px;
  padding: 3px 0;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #333;
  background: transparent;
  -moz-appearance: textfield;
  box-sizing: border-box;
}
#flowTable input[type="number"]::-webkit-inner-spin-button,
#flowTable input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#flowTable input[type="number"]:hover { color: #6d28d9; }
#flowTable input[type="number"]:focus {
  outline: none;
  border-bottom-color: #6d28d9;
  color: #6d28d9;
}

.duration-wrapper {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.duration-wrapper input[type="number"] {
  width: 58px;
  padding: 3px 4px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
  background: #fff;
  outline: none;
  -moz-appearance: textfield;
}
.duration-wrapper input[type="number"]::-webkit-inner-spin-button,
.duration-wrapper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.duration-wrapper input[type="number"]:focus {
  border-color: #6d28d9;
}
.duration-unit {
  font-size: 11px;
  font-weight: 500;
  color: #b0b0b5;
  pointer-events: none;
}

/* ── Pose image + name ── */
.table-asana {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.table-asana span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  text-align: left;
}
.table-asana-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 50%;
  background: #f5f5f7;
  padding: 1px;
  border: none;
}
.table-asana .pose-fallback-icon {
  width: 32px !important;
  height: 32px !important;
}
.table-asana .pose-fallback-icon svg {
  width: 60%;
  height: 60%;
}

/* ── Drag & Drop ── */
#flowTable tr[draggable] { position: relative; }
#flowTable tr[draggable] td:first-child { cursor: grab; }
#flowTable tr.dragging {
  opacity: 0.6;
  z-index: 10;
}
#flowTable tr.dragging td {
  background: #f5f3ff;
}
#flowTable tr.drop-target td {
  box-shadow: inset 0 -2px 0 #6d28d9;
}
#flowTable tr.drop-target-section td {
  box-shadow: inset 0 -3px 0 #6d28d9;
  background: rgba(109, 40, 217, 0.06);
}

#flowTable tr.drop-target-section.section-header {
  background-color: rgba(109, 40, 217, 0.2);
}

/* Pose number drag indicator */
.pose-drag-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background-color: #6d28d9;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  pointer-events: none;
  transition: transform 0.1s ease;
  animation: pulse-indicator 1s infinite alternate;
}

@keyframes pulse-indicator {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.5);
  }
  100% {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(109, 40, 217, 0.8);
  }
}

/* Mobile touch drag indicator */
.touch-drag-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #6d28d9;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 10000;
  font-size: 16px;
  transition: all 0.2s ease;
  animation: mobile-drag-float 0.3s ease-out forwards;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes mobile-drag-float {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  }
  100% {
    transform: scale(1.1);
    opacity: 0.9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  }
}

/* Mobile drag enhancements */
@media (max-width: 768px) {
  /* Enhanced touch targets for mobile drag handles */
  #flowTable tr[draggable] td:first-child {
    min-width: 50px;
    position: relative;
    touch-action: none;
  }
  
  #flowTable tr[draggable] td:first-child::before {
    display: none;
  }
  
  /* Enhanced touch targets for group headers */
  #flowTable tr.section-header .section-header-content {
    touch-action: none;
    position: relative;
  }
  
  #flowTable tr.section-header .section-name {
    padding: 12px 8px;
    border-radius: 8px;
    position: relative;
    transition: background-color 0.2s ease;
  }
  
  #flowTable tr.section-header .section-name::before {
    display: none;
  }
  
  #flowTable tr.section-header .section-name:active {
    background-color: rgba(109, 40, 217, 0.1);
  }
  
  #flowTable tr.section-header .section-name:active::before {
    display: none;
  }
  
  /* Enhanced visual feedback for mobile dragging */
  #flowTable tr.dragging {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #6d28d9;
    background-color: rgba(255, 248, 240, 0.95);
  }
  
  /* Special mobile dragging styles for group headers */
  #flowTable tr.section-header.dragging {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(109, 40, 217, 0.25);
    border: 3px solid #6d28d9;
    border-radius: 8px;
    background-color: rgba(255, 248, 240, 0.98);
    position: relative;
    z-index: 100;
  }
  
  #flowTable tr.section-header.dragging .section-name {
    background-color: rgba(109, 40, 217, 0.15);
    border-radius: 6px;
  }
  
  #flowTable tr.section-header.dragging .section-name::before {
    display: none;
  }
  
  @keyframes mobile-group-drag-indicator {
    0% {
      transform: translateY(-50%) rotate(90deg) scale(1);
      opacity: 0.8;
    }
    100% {
      transform: translateY(-50%) rotate(90deg) scale(1.2);
      opacity: 1;
    }
  }
  
  /* Mobile drop target styling */
  #flowTable tr.drop-target {
    border-top: 4px solid #6d28d9;
    border-bottom: 4px solid #6d28d9;
    background-color: rgba(109, 40, 217, 0.15);
    transform: scale(1.02);
    animation: mobile-drop-target-pulse 1s infinite alternate;
  }
  
  #flowTable tr.drop-target-section {
    border-top: 5px solid #6d28d9;
    border-bottom: 5px solid #6d28d9;
    background-color: rgba(109, 40, 217, 0.2);
    transform: scale(1.03);
    animation: mobile-section-drop-pulse 1s infinite alternate;
  }
  
  @keyframes mobile-drop-target-pulse {
    0% {
      background-color: rgba(109, 40, 217, 0.15);
      box-shadow: 0 0 10px rgba(109, 40, 217, 0.3);
    }
    100% {
      background-color: rgba(109, 40, 217, 0.25);
      box-shadow: 0 0 15px rgba(109, 40, 217, 0.5);
    }
  }
  
  @keyframes mobile-section-drop-pulse {
    0% {
      background-color: rgba(109, 40, 217, 0.2);
      box-shadow: 0 0 15px rgba(109, 40, 217, 0.4);
    }
    100% {
      background-color: rgba(109, 40, 217, 0.3);
      box-shadow: 0 0 20px rgba(109, 40, 217, 0.6);
    }
  }
  
  /* Touch drag indicator specific styles for mobile */
  .touch-drag-indicator {
    font-size: 18px;
    min-width: 45px;
    min-height: 45px;
    border-radius: 50%;
    animation: mobile-touch-indicator-pulse 0.8s infinite alternate;
  }
  
  /* Enhanced group header touch drag indicator */
  .touch-drag-indicator:has(div) {
    border-radius: 20px;
    min-width: 140px;
    min-height: 60px;
    padding: 16px 20px;
    animation: mobile-group-touch-indicator-pulse 0.8s infinite alternate;
  }
  
  @keyframes mobile-touch-indicator-pulse {
    0% {
      transform: scale(1.1);
      box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
    }
    100% {
      transform: scale(1.2);
      box-shadow: 0 6px 30px rgba(109, 40, 217, 0.6);
    }
  }
  
  @keyframes mobile-group-touch-indicator-pulse {
    0% {
      transform: scale(1.05);
      box-shadow: 0 6px 25px rgba(109, 40, 217, 0.4);
    }
    100% {
      transform: scale(1.1);
      box-shadow: 0 8px 35px rgba(109, 40, 217, 0.6);
    }
  }
}

#flowTable tr.drag-highlight, #flowTable tr.highlight-added {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Last moved pose indicator */
#flowTable tr.last-moved-pose {
  background-color: rgba(109, 40, 217, 0.15);
  border-left: 4px solid #6d28d9;
  position: relative;
  animation: highlight-last-moved 2s ease-in-out;
}

#flowTable tr.last-moved-pose td:first-child {
  color: #6d28d9;
  font-weight: bold;
}


@keyframes highlight-last-moved {
  0%, 100% { background-color: rgba(109, 40, 217, 0.15); }
  50% { background-color: rgba(109, 40, 217, 0.3); }
}

@keyframes pulse {
  0% { background-color: rgba(109, 40, 217, 0); }
  50% { background-color: rgba(109, 40, 217, 0.2); }
  100% { background-color: rgba(109, 40, 217, 0); }
}

#flowTable tr.highlight-added {
  animation: highlight-row 1.5s ease-in-out;
}

@keyframes highlight-row {
  0% { background-color: rgba(109, 40, 217, 0); }
  40% { background-color: rgba(109, 40, 217, 0.3); }
  60% { background-color: rgba(109, 40, 217, 0.3); }
  100% { background-color: rgba(109, 40, 217, 0); }
}

.build-actions {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  justify-content: center;
  width: 100%;
  align-items: center;
  position: sticky;
  bottom: 15px;
  z-index: 100;
  padding: 8px;
}

/* Auto-save message */
.auto-save-message {
  color: #666;
  font-size: 14px;
  font-style: italic;
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-radius: 20px;
  border: 1px dashed #ccc;
}

.save-flow-btn {
  background-color: #6d28d9;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.save-flow-btn:hover {
  background-color: #5b21b6;
  opacity: 0.85;
}

#buildScreen .home-btn {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#buildScreen .home-btn:hover {
  background-color: #555;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.asana-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
  max-width: 80px;
  width: 70px;
  cursor: pointer;
  border-radius: 10px;
  padding: 6px;
  transition: background 0.15s;
  background-color: transparent;
  border: none;
  position: relative;
  flex-shrink: 0;
  white-space: normal;
  overflow: visible;
}

.asana-item-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 10px;
  flex: 1;
  min-width: 0; /* Allow content to shrink if needed */
}

.asana-item:hover {
  background: #f3f0ff;
}

.asana-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  background: #f5f5f7;
  padding: 0;
  border: none;
  box-shadow: none;
}

.asana-item p {
  font-size: 10px;
  font-weight: 500;
  color: #555;
  text-align: center;
  margin: 0;
  line-height: 1.2;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.difficulty-badge {
  display: none;
}

.difficulty-badge.beginner {
  background-color: #8bc34a;
  color: white;
}

.difficulty-badge.intermediate {
  background-color: #ffc107;
  color: #333;
}

.difficulty-badge.advanced {
  background-color: #f44336;
  color: white;
}

.difficulty-badge.custom {
  background-color: #9c27b0;
  color: white;
}

.custom-pose-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ff6b6b;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
  opacity: 0;
  visibility: hidden;
}

.asana-item:hover .custom-pose-delete-btn {
  opacity: 1;
  visibility: visible;
}

.custom-pose-delete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-pose-delete-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Sequence badge styling */
.difficulty-badge.sequence {
  color: white;
}

.no-matches, .empty-message {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  margin: 10px auto;
  width: 100%;
}

.no-matches-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  grid-column: 1 / -1;
}
.no-matches-empty p {
  margin: 0;
  font-size: 14px;
  color: #999;
  font-weight: 500;
}

.empty-message {
  padding: 30px;
  text-align: center;
  color: #666;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  margin: 20px auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  font-style: normal;
}

.empty-message p {
  font-size: 16px;
  margin-bottom: 10px;
}

.empty-message .primary-btn {
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(109, 40, 217, 0.3);
  transition: all 0.3s ease;
}

.empty-message .primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(109, 40, 217, 0.4);
}

.empty-message .primary-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(109, 40, 217, 0.3);
}

.asana-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5px;
  min-width: 120px;
  flex-shrink: 0; /* Prevent containers from shrinking */
}

.asana-preview {
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.asana-container:hover .asana-preview {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-color: #6d28d9;
}

.asana-btn {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 13px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
  width: 100%;
  text-align: center;
}

.asana-btn:hover {
  background-color: #6d28d9;
}

#flowScreen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eaec 100%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.flow-controls-global {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  z-index: 200;
  opacity: 0;
  animation: fadeSlideIn 0.4s ease 0.3s forwards;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.flow-controls-global.hidden {
  opacity: 0 !important;
  transform: translateX(-12px);
  pointer-events: none;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.language-toggle-global {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.language-toggle-global:hover { transform: scale(1.03); }

.flow-controls-global input:checked + .slider {
  background-color: #6d28d9;
}
.flow-controls-global input:focus + .slider {
  box-shadow: 0 0 1px #6d28d9;
}

#end-flow-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 201;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  opacity: 0;
  animation: fadeSlideInRight 0.4s ease 0.3s forwards;
}
@keyframes fadeSlideInRight {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

#end-flow-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: scale(1.03);
}

#end-flow-btn:active {
  transform: scale(0.97);
}

#flowScreen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background-color: #6d28d9;
  z-index: 5;
  display: none;
}

.flow-header {
  background-color: rgba(255, 255, 255, 0);
  color: #333;
  padding: 16px 20px 12px;
  text-align: center;
  z-index: 100;
  box-shadow: none;
  border-bottom: none;
  position: relative;
  margin-top: 0;
}

.flow-header h1 {
  margin: 0;
  font-size: 3.5rem;
  letter-spacing: 0.1em;
  font-weight: 200;
  color: #333;
  text-transform: capitalize;
}

.flow-header p {
  margin: 12px 0 5px;
  font-size: 20px;
  z-index: 3;
  font-weight: 500;
  color: #6d28d9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.flow-header .asana-group {
  margin: 8px 0;
  font-size: 14px;
  font-weight: 400;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#asanaImage {
  position: relative;
  padding: 0;
  width: auto;
  max-width: 45vw;
  max-height: 40vh;
  object-fit: contain;
  z-index: 200;
  user-select: none;
  pointer-events: none;
  filter: none;
  transition: transform 0.5s ease-in-out;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.countdown-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.1));
}

#countdown-circle {
  transition: stroke-dashoffset 1s linear;
}

#flow-progress-circle {
  transition: stroke-dashoffset 1s linear;
}

#countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: bold;
  color: #333;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  transition: font-size 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.countdown-big #countdown {
  font-size: 40px;
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 10px;
  width: 30px;
  height: 30px;
  background-color: white;
  border: 2px solid #888;
  border-radius: 50%;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.close-btn:hover {
  background-color: #f0f0f0;
  transform: scale(1.1);
}

.close-btn:focus {
  outline: none;
}

.flow-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  min-height: 0;
}

/* Sanskrit Toggle Switch Styles */
.language-toggle-container {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.language-toggle-container .toggle-label {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

/* The toggle switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #34c759;
}

input:focus + .slider {
  box-shadow: 0 0 1px #6d28d9;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.language-toggle-container .save-flow-btn,
.language-toggle-container .home-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #6d28d9;
  /* background: rgba(255, 255, 255, 0.9); */
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-toggle-container .save-flow-btn:hover,
.language-toggle-container .home-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.language-toggle-container .save-flow-btn:active,
.language-toggle-container .home-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.asana-image-container {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-top: 0;
  min-height: 0;
}
.asana-image-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* Flow navigation controls (prev / pause / next) */
.flow-nav-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
  margin: 0 auto;
  flex-shrink: 0;
  z-index: 100;
  transition: opacity 0.4s ease;
}
.flow-nav-controls.hidden {
  opacity: 0;
  pointer-events: none;
}
.flow-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.flow-nav-btn:hover {
  background: rgba(109, 40, 217, 0.1);
  color: #6d28d9;
}
.flow-nav-btn:active {
  transform: scale(0.9);
}
.flow-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.flow-nav-controls .pause-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(109, 40, 217, 0.1);
  color: #6d28d9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.flow-nav-controls .pause-btn:hover {
  background: rgba(109, 40, 217, 0.2);
}
.flow-nav-controls .pause-btn:active {
  transform: scale(0.9);
}

.flow-controls {
  display: none;
}

.left-controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1000;
}

.countdown-container {
  position: relative;
  margin: 20px auto 16px;
  width: 140px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  padding: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), margin 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.countdown-container.countdown-big {
  width: 200px;
  height: 200px;
  margin: auto;
}
.countdown-container.shifted-down {
  transform: translateY(60px);
  margin-bottom: 0;
}

.countdown-container.flow-complete {
  width: auto;
  height: auto;
  background: transparent;
  animation: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

.timer-home-btn {
  border: none;
  background: #6d28d9;
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 40px;
  border-radius: 30px;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
  transition: all 0.2s ease;
}
.timer-home-btn:hover {
  background: #5b21b6;
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.4);
  transform: translateY(-2px);
}
.timer-home-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.3);
}
.timer-home-btn span {
  display: inline;
}

/* Style for flow completion message */
.flow-complete-message {
  animation: celebrationPulse 2s infinite;
  color: #6d28d9;
  font-size: 2.5rem !important;
  font-weight: bold !important;
  letter-spacing: 0.05em !important;
}

@keyframes celebrationPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.coming-up {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 150px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  transform-origin: center;
  will-change: height, transform;
  height: auto;
  animation: resize-container 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes resize-container {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.coming-up > * {
  animation: fade-in 0.6s ease-out;
}

@keyframes fade-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.coming-up p:first-child {
  margin: 0 0 5px 0;
  text-align: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

#nextAsanaName {
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  font-size: 16px;
  transition: all 0.4s ease;
  will-change: transform, opacity;
}

#nextAsanaImage {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 35px;
  align-self: center;
  margin-top: 5px;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  background-color: white;
  padding: 5px;
  will-change: transform, opacity;
  animation: float-next 5s ease-in-out infinite;
}

@keyframes float-next {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

#nextAsanaImage:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  animation: none;
}

/* Styles for recommended poses */
.asana-item.recommended {
  border: 3px solid #6d28d9;
  background-color: #f5f3ff;
  position: relative;
  transform: scale(1.05);
  z-index: 5;
  transition: all 0.3s ease;
  animation: recommend-fade-in 0.3s ease-out;
}

@keyframes recommend-fade-in {
  from {
    opacity: 0;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

.asana-item.recommended::after {
  content: "RECOMMENDED";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #6d28d9;
  color: white;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  z-index: 6;
  animation: recommend-label-fade-in 0.3s ease-out;
}

@keyframes recommend-label-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.asana-item.recommended.highlight {
  animation: recommend-highlight 1.5s ease-in-out;
}

@keyframes recommend-highlight {
  0% { transform: scale(1.05); }
  25% { transform: scale(1.12); }
  50% { transform: scale(1.12); }
  75% { transform: scale(1.12); }
  100% { transform: scale(1.05); }
}

.asana-item.recommended:hover {
  transform: scale(1.08);
}

/* Highlight effect for sorting */
#flowTable th:nth-child(1).highlight-sort {
  animation: highlight-sort 1s ease;
}

@keyframes highlight-sort {
  0% { background: linear-gradient(to bottom, #444 0%, #333 100%); }
  25% { background: linear-gradient(to bottom, #6d28d9 0%, #5b21b6 100%); }
  75% { background: linear-gradient(to bottom, #6d28d9 0%, #5b21b6 100%); }
  100% { background: linear-gradient(to bottom, #444 0%, #333 100%); }
}

/* Toast notification styles */
.toast-notification {
  position: fixed;
  bottom: 32px;
  top: auto;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  white-space: nowrap;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-notification span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-notification span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #a78bfa;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Mobile: toast comes from top */
@media screen and (max-width: 768px) {
  .toast-notification {
    top: 16px;
    bottom: auto;
    transform: translateX(-50%) translateY(-60px);
  }
  .toast-notification.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media screen and (max-width: 768px) {
  header {
    padding: 12px 16px;
  }

  header .settings-gear-btn {
    left: 16px;
  }

  header .header-buttons {
    right: 16px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 0;
  }

  .home-action-bar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 4px 16px 10px;
  }

  .flow-list {
    padding: 0 12px;
    margin-left: 0;
    margin-right: 0;
  }

  .flow-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d2d2d7;
  }

  .flow-item {
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    animation: none;
    gap: 12px;
  }

  .flow-item:last-child {
    border-bottom: none;
  }

  .flow-item:hover {
    transform: none;
    box-shadow: none;
    background: #faf5ff;
  }

  .flow-item.recent {
    border-left: none;
    border-radius: 0;
    background: rgba(109, 40, 217, 0.03);
    box-shadow: inset 3px 0 0 #6d28d9;
  }

  .flow-info {
    flex: 1;
    min-width: 0;
  }

  .flow-info h4 {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
  }

  .flow-description {
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .flow-timestamps {
    gap: 10px;
    margin-bottom: 0;
  }

  .timestamp {
    font-size: 12px;
  }

  .flow-actions .edit-btn,
  .flow-actions .delete-btn,
  .flow-actions .share-btn,
  .flow-actions .analyse-btn {
    display: none;
  }

  .flow-actions {
    margin-top: 0;
    padding-top: 0;
    flex-shrink: 0;
    width: auto;
  }

  .flow-more-btn {
    display: none;
  }

  .flow-item::after {
    display: none;
  }

  /* Build Screen Mobile Styles */
  .build-content {
    padding: 15px;
  }

  .build-title {
    display: none;
  }

  .build-form {
    display: none;
  }

  .asana-category-buttons {
    padding: 5px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .category-btn {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .asana-scroll-container {
    margin: 0;
    display: block;
    width: 100%;
  }

  #asanaList {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding: 8px 12px;
    max-height: none;
  }

  #asanaList::-webkit-scrollbar {
    display: none;
  }

  .asana-item {
    min-width: 70px;
    max-width: 80px;
    width: 70px;
    padding: 6px;
    flex-shrink: 0;
  }

  .asana-item img {
    width: 50px;
    height: 50px;
  }

  .asana-item p {
    font-size: 10px;
  }

  /* Flow Table Mobile Styles */
  .flow-table-container {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    width: 100%;
    margin: 0;
  }

  #flowTable {
    font-size: 12px;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    table-layout: auto !important;
  }

  #flowTable td {
    padding: 6px 3px;
    min-width: 0 !important;
  }

  /* # column — compact */
  #flowTable td:nth-child(1) {
    width: 1%;
    white-space: nowrap;
    padding-left: 6px;
    font-size: 11px;
  }

  /* Checkbox — tappable on mobile */
  #flowTable td:nth-child(2) {
    width: 1%;
    white-space: nowrap;
    padding: 6px 6px 6px 2px;
  }
  #flowTable td:nth-child(2) input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
  }

  /* Pose name wraps on mobile — constrain so other columns aren't pushed off */
  #flowTable td:nth-child(3) {
    white-space: normal;
    line-height: 1.3;
    max-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Duration — compact */
  #flowTable td:nth-child(4) {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    min-width: 0;
  }

  /* Side — compact */
  #flowTable td:nth-child(5) {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
  }

  /* Breath — icon instead of dropdown on mobile */
  #flowTable td:nth-child(6) {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    padding-right: 6px;
    min-width: 0;
  }

  #flowTable td:nth-child(6) .breath-select {
    display: inline-block;
  }


  .table-asana-img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }

  .table-asana {
    gap: 6px;
  }

  .table-asana span {
    font-size: 12px;
  }

  #flowTable select.side-select,
  #flowTable select.breath-select {
    font-size: 12px;
    padding: 6px 16px 6px 6px;
    min-width: 36px !important;
    min-height: 32px;
    text-align: center;
    border-radius: 6px;
  }

  #flowTable input[type="number"] {
    width: 30px;
    font-size: 12px;
  }

  /* Section headers */
  tr.section-header td:first-child {
    min-width: 0 !important;
    white-space: normal !important;
  }
  .section-header .section-name {
    min-width: 0 !important;
    white-space: nowrap;
    font-size: 0.85em;
    padding-left: 2px;
    padding-right: 2px;
    gap: 4px;
    max-width: none !important;
  }
  .section-header .section-name span,
  .section-header .section-name .section-name-text {
    font-size: 11px !important;
    padding: 2px 3px;
  }
  .section-header .section-name .section-count-duration {
    font-size: 10px !important;
    padding: 2px 2px;
  }
  .section-header td {
    padding: 6px 2px;
    min-width: 0 !important;
  }
  .section-header-content {
    min-width: 0 !important;
  }
  .section-header-flex {
    padding: 0 2px !important;
    gap: 2px;
  }
  .section-checkbox {
    flex: 0 0 28px;
    margin-left: 2px;
  }
  .section-toggle {
    flex: 0 0 16px;
    margin-right: 2px;
  }
  .section-toggle-icon {
    font-size: 12px;
    width: 16px;
    height: 16px;
  }
  .section-side-control {
    margin-right: 2px;
  }
  .section-side-select {
    min-width: 36px;
    font-size: 11px;
    padding: 4px 16px 4px 4px;
    background-size: 12px;
  }
  .section-remove {
    flex: 0 0 28px;
    margin-right: 2px;
  }



  .selected-actions {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }

  .action-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 100px;
  }

  /* Flow Screen Mobile Styles */
  .flow-header {
    padding: 10px 15px 6px;
    z-index: 100;
    position: relative;
    background-color: rgba(255, 255, 255, 0);
  }

  .flow-header h1 {
    font-size: 24px;
  }

  .flow-header p {
    font-size: 14px;
    margin: 6px 0 2px;
  }

  .flow-header .asana-group {
    font-size: 11px;
    margin: 4px 0;
  }

  #asanaImage {
    max-width: 75vw;
    max-height: 38vh;
  }
  .countdown-container.countdown-big {
    width: 200px;
    height: 200px;
  }

  #countdown {
    font-size: 22px;
  }

  .coming-up {
    max-width: 120px;
    padding: 10px;
  }

  #nextAsanaName {
    font-size: 14px;
  }

  #nextAsanaImage {
    width: 50px;
    height: 50px;
  }

  .flow-controls-global {
    gap: 4px;
    top: 16px;
    left: 12px;
  }

  .language-toggle-global {
    padding: 4px 8px;
    gap: 4px;
  }

  #end-flow-btn {
    padding: 6px 10px;
    font-size: 12px;
    top: 16px;
    right: 12px;
  }

  .asana-image-container {
    margin-top: 12px;
  }

  .flow-nav-controls {
    padding: 8px 12px max(24px, env(safe-area-inset-bottom));
  }

  .difficulty-badge {
    transform: translateY(-50%);
    font-size: 10px;
    padding: 2px 6px;
  }
}

@media screen and (max-width: 480px) {
  h1 {
    font-size: 32px;
  }

  .build-title {
    display: none;
  }

  .asana-item {
    min-width: 70px;
    max-width: 80px;
    width: 70px;
  }

  .asana-item img {
    width: 50px;
    height: 50px;
  }

  /* Force horizontal scrolling for selected-actions */
  .selected-actions {
    flex-direction: row !important;
    align-items: center;
    justify-content: center !important;
    overflow-x: auto;
    padding: 6px 5px;
    flex-wrap: nowrap !important;
    display: flex !important;
  }

  .action-btn {
    width: auto !important;
    min-width: max-content;
    flex-shrink: 0;
    padding: 5px 8px;
    font-size: 11px;
    display: inline-flex !important;
  }
  
  .table-asana span {
    font-size: 11px;
  }

  .table-asana-img {
    width: 24px;
    height: 24px;
  }
}

@media screen and (max-width: 480px) {
  #flowTable {
    font-size: 12px;
  }

  #flowTable th,
  #flowTable td {
    padding: 2px 3px !important;
  }
  .table-asana-img {
    width: 22px;
    height: 22px;
  }

  .flow-header h1 {
    font-size: 22px;
  }

  .flow-header p {
    font-size: 13px;
    margin: 4px 0 2px;
  }

  .flow-header .asana-group {
    font-size: 10px;
    margin: 2px 0;
  }

  #asanaImage {
    max-width: 70vw;
    max-height: 32vh;
  }

  .countdown-container {
    width: 120px;
    height: 120px;
  }
  .countdown-container.countdown-big {
    width: 170px;
    height: 170px;
  }

  #countdown {
    font-size: 20px;
  }

  .coming-up {
    max-width: 100px;
    padding: 8px;
  }

  #nextAsanaName {
    font-size: 12px;
  }

  #nextAsanaImage {
    width: 40px;
    height: 40px;
  }

  .flow-header {
    z-index: 100;
    position: relative;
    background-color: transparent;
    box-shadow: none;
    border-bottom: none;
  }
}

.sanskrit-toggle-global {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#flowScreen > div.flow-actions > button.home-btn {
  display: none;
}
/* timer-home-btn styles are defined in the .timer-home-btn block above */

#buildScreen > div.build-content > div.build-actions > button.save-flow-btn,
#buildScreen > div.build-content > div.build-actions > button.home-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#buildScreen > div.build-content > div.build-actions > button.save-flow-btn:hover,
#buildScreen > div.build-content > div.build-actions > button.home-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

#buildScreen > div.build-content > div.build-actions > button.save-flow-btn:active,
#buildScreen > div.build-content > div.build-actions > button.home-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Checkbox styling */
#flowTable input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  border: 2px solid #ccc;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: all 0.2s ease;
  background-color: #fff;
  margin: 0;
}

#flowTable input[type="checkbox"]:checked {
  background-color: #6d28d9;
  border-color: #6d28d9;
}

#flowTable input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#flowTable input[type="checkbox"]:hover {
  border-color: #6d28d9;
  box-shadow: 0 0 5px rgba(109, 40, 217, 0.3);
}

#flowTable input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.2);
}

.view-toggle-global {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    width: fit-content;
}

.view-toggle-global .toggle-label {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.toggle-hint {
    font-size: 12px;
    color: #666;
    margin-left: 5px;
    display: none;
}

/* Styles for the view toggle switch */
#view-toggle-build:checked + .slider {
    background-color: #6d28d9;
}

#view-toggle-build:focus + .slider {
    box-shadow: 0 0 1px #6d28d9;
}

#view-toggle-build:checked + .slider:before {
    transform: translateX(20px);
}

.selected-actions {
    display: flex;
    gap: 6px;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    padding: 8px 14px;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
    flex-wrap: nowrap;
    overflow-y: hidden;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    max-width: calc(100% - 32px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.selected-actions.bar-hidden {
    transform: translateX(-50%) translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
}

.selected-actions::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-width: max-content;
    flex-shrink: 0;
    white-space: nowrap;
}

.action-btn span {
    display: inline-block;
    white-space: nowrap;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
}

.action-btn:not(:disabled):hover {
    background: #6d28d9;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: none;
}

.saved-sequences {
    width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sequences-section-title {
    font-size: 1rem;
    color: #333;
    margin: 0;
    text-align: center;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.sequences-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.sequences-list::-webkit-scrollbar {
    width: 6px;
}

.sequences-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.sequences-list::-webkit-scrollbar-thumb {
    background: #86868b;
    border-radius: 3px;
}

.sequence-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sequence-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sequence-info h4 {
    font-size: 13px;
    color: #333;
    margin: 0 0 2px 0;
}

.sequence-description {
    font-size: 11px;
    color: #666;
    margin: 0 0 2px 0;
}

.sequence-timestamps {
    display: flex;
    gap: 5px;
}

.sequence-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.sequence-actions .flow-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: #6d28d9;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sequence-actions .delete-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b6b;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sequences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    user-select: none;
}

.sequences-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sequences-content.collapsed {
    max-height: 0;
}

.sequences-content.expanded {
    max-height: 200px;
}

.sequences-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.sequences-header.expanded .toggle-icon {
    transform: rotate(0deg);
}

.delete-x {
    font-size: 24px;
    color: #ff6b6b;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    user-select: none;
}

.delete-x:hover {
    background-color: #ff6b6b;
    color: white;
    transform: scale(1.1);
}

.delete-x:active {
    transform: scale(0.95);
}

.flow-sequence {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-right: 8px;
  box-sizing: border-box;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #86868b #f5f5f7;
  -webkit-overflow-scrolling: touch;
  container-type: inline-size;
  container-name: flow-list;
}

.flow-sequence::-webkit-scrollbar {
  height: 8px;
}

.flow-sequence::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.flow-sequence::-webkit-scrollbar-thumb {
  background-color: #86868b;
  border-radius: 4px;
}


/* Progressive column collapse as flow-list container shrinks */
/* Below 300px: collapse breath column */
@container flow-list (max-width: 300px) {
  #flowTable td:nth-child(6) {
    width: 0 !important;
    max-width: 0;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
  }
}

/* Below 260px: also collapse side column */
@container flow-list (max-width: 260px) {
  #flowTable td:nth-child(5) {
    width: 0 !important;
    max-width: 0;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
  }
}

/* Below 250px: also collapse checkbox, compact layout */
@container flow-list (max-width: 250px) {
  #flowTable td:nth-child(2) {
    width: 0 !important;
    max-width: 0;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
  }
  #flowTable td:nth-child(1) {
    padding-left: 6px !important;
    font-size: 11px;
  }
  #flowTable td { padding: 6px 3px !important; }
  .table-asana-img { width: 28px; height: 28px; }
  .table-asana .pose-fallback-icon { width: 28px !important; height: 28px !important; }
  .table-asana { gap: 6px; }
}

/* Below 200px: also collapse duration, show only # and name */
@container flow-list (max-width: 200px) {
  #flowTable td:nth-child(4) {
    width: 0 !important;
    max-width: 0;
    padding: 0 !important;
    opacity: 0;
    overflow: hidden;
  }
}

#buildScreen > div.build-content > div.asana-selection > div.asana-scroll-container > #asanaList > .asana-item {
  opacity: 0;
  transform: translateY(20px);
  animation: slideIn 0.2s ease forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Add a new class for sequence items with faster animation */
#buildScreen > div.build-content > div.asana-selection > div.asana-scroll-container > #asanaList > .asana-item[data-sequence-id] {
  animation: slideIn 0.15s ease forwards;
  animation-delay: 0s !important; /* Override any inline animation-delay */
}

#asanaList > div:nth-child(67) > div.sequence-preview-container > img:nth-child(1) {
  margin: 0;
}

.sequence-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.sequence-preview-container img {
  margin: 0;
  object-fit: contain;
}

.no-matches {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  margin: 10px auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.no-matches p {
  margin: 0;
}

.add-custom-pose-btn {
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(109, 40, 217, 0.3);
  transition: all 0.3s ease;
}

.add-custom-pose-btn span {
  font-size: 18px;
  font-weight: bold;
}

.add-custom-pose-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(109, 40, 217, 0.4);
  background: linear-gradient(135deg, #7c3aed, #7c3aed);
}

/* Fallback icon for poses without images */
.pose-fallback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  border-radius: 10px;
  flex-shrink: 0;
}
.pose-fallback-icon svg {
  width: 60%;
  height: 60%;
}

/* Chakra circles container - top right of pose images, stacked horizontally overlapping */
.chakra-circles {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  flex-direction: row-reverse;
  z-index: 10;
}

.chakra-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  margin-left: -4px;
}
.chakra-dot:last-child {
  margin-left: 0;
}

.chakra-dot:hover {
  transform: scale(1.4);
  z-index: 2;
}

/* Table view chakra circles */
.table-asana .chakra-circles {
  top: 1px;
  right: -2px;
}
.table-asana .chakra-dot {
  width: 8px;
  height: 8px;
  margin-left: -3px;
}

/* Hide chakra indicator in table view on small screens */
@media screen and (max-width: 500px) {
  .table-asana .chakra-indicator {
    display: none !important;
  }
}

/* Section headers in flow table */
.section-header {
  background-color: #f8f4f0;
  font-weight: bold;
  margin: 0;
  border-top: none;
  padding: 0;
}

.section-header .section-name {
  color: #6d28d9;
  font-size: 1.05em;
  text-align: left;
  padding-left: 15px;
  padding-right: 15px;
  display: flex;
  align-items: center;
  background-color: transparent;
  box-shadow: none;
  transition: all 0.2s ease;
  height: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  width: 100%;
  position: relative; /* For absolute positioning of children */
}

.section-header .section-name span {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid transparent;
  color: #333;
  position: relative;
  display: inline-block;
  transition: all 0.2s ease;
  background-color: transparent;
  box-shadow: none;
  vertical-align: middle;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  min-width: auto;
}

.section-header .section-name .section-count {
  font-size: 13px;
  font-weight: 600;
  color: #6d28d9;
  padding: 4px 8px;
  border-radius: 0;
  white-space: nowrap;
  margin-left: auto;
  background-color: transparent;
  box-shadow: none;
}

.section-header .section-name .section-duration {
  font-size: 13px;
  font-weight: 600;
  color: #6d28d9;
  padding: 4px 8px;
  border-radius: 0;
  white-space: nowrap;
  margin-left: 4px;
  background-color: transparent;
  box-shadow: none;
}

.section-header:hover .section-name span {
  background-color: rgba(109, 40, 217, 0.05);
  color: #6d28d9;
}

.section-header .section-name span:hover {
  background-color: rgba(109, 40, 217, 0.05);
  color: #6d28d9;
}

.section-header:active .section-name span {
  background-color: rgba(255, 255, 255, 0.5);
  letter-spacing: normal;
}

.section-header td {
  padding: 12px 10px;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  white-space: nowrap;
  min-width: 200px; /* Ensure wider cells for section headers */
}

/* Style for rows in the same section */
tr[data-section-id] {
  border-left: 3px solid #6d28d9;
  background-color: rgba(109, 40, 217, 0.05);
  margin-top: 0;
  border-top: none;
}

/* Add visual grouping for sections */
tr[data-section-id] td:first-child {
  padding-left: 8px;
}

/* Section color classes for consistent coloring */
.section-color-0,
tr.section-color-0[data-section-id] {
  border-left-color: #6d28d9; /* Purple */
}

.section-color-1,
tr.section-color-1[data-section-id] {
  border-left-color: #7c3aed; /* Medium purple */
}

.section-color-2,
tr.section-color-2[data-section-id] {
  border-left-color: #a78bfa; /* Light purple */
}

/* Add highlight background to section headers */
tr.section-header.section-color-0 {
  background-color: rgba(109, 40, 217, 0.1);
  border-left: 3px solid #6d28d9;
}

tr.section-header.section-color-1 {
  background-color: rgba(124, 58, 237, 0.1);
  border-left: 3px solid #7c3aed;
}

tr.section-header.section-color-2 {
  background-color: rgba(167, 139, 250, 0.1);
  border-left: 3px solid #a78bfa;
}

/* Section name span styles based on color */
tr.section-header.section-color-0 .section-name span {
  color: #6d28d9;
}

tr.section-header.section-color-1 .section-name span {
  color: #7c3aed;
}

tr.section-header.section-color-2 .section-name span {
  color: #a78bfa;
}

/* Add left border and subtle background to rows in the same section */
tr.section-color-0[data-section-id]:not(.section-header) {
  background-color: rgba(109, 40, 217, 0.04);
  border-left: 3px solid rgba(109, 40, 217, 0.4);
}

tr.section-color-1[data-section-id]:not(.section-header) {
  background-color: rgba(124, 58, 237, 0.04);
  border-left: 3px solid rgba(124, 58, 237, 0.4);
}

tr.section-color-2[data-section-id]:not(.section-header) {
  background-color: rgba(167, 139, 250, 0.04);
  border-left: 3px solid rgba(167, 139, 250, 0.4);
}

/* Section header styling */
tr.section-header {
  height: 46px; /* Set a fixed height for the section header */
  border-top: 12px solid transparent; /* Visual spacing before section */
}

/* Section header row cell styling */
tr.section-header td {
  height: 46px; /* Set a fixed height for consistency */
  box-sizing: border-box;
  padding: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin: 0;
}

/* Add shadow to section header */
tr.section-header {
  position: relative;
  display: table-row; /* Ensure proper table row display */
  width: 100%;
  table-layout: fixed;
  margin: 0;
  padding: 0;
}

/* Make section header span full width */
tr.section-header td:first-child {
  width: 100%;
  min-width: 500px;
  padding-right: 30px; /* Extra padding on the right side */
  white-space: nowrap;
  overflow: visible; /* Allow content to extend beyond cell if needed */
}

/* Style for section grouping to make it more obvious */
tr.section-header + tr[data-section-id] {
  box-shadow: inset 0 4px 6px -6px rgba(0,0,0,0.1);
}

/* Fix for section header to ensure single row */
tr.section-header td[colspan] {
  height: 46px;
  vertical-align: middle;
  padding: 0;
}

/* Section header layout structure */
.section-header-content {
  padding: 0 !important;
  margin-right: 0;
}

.section-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 8px;
  margin: 0;
  border: none;
  gap: 4px;
}

.section-checkbox {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

.section-toggle {
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  cursor: pointer;
}

.section-toggle-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  font-size: 16px;
  color: #666;
}

.section-header.collapsed .section-toggle-icon {
  transform: rotate(-90deg);
}

/* Hide section rows when collapsed */
tr.section-header.collapsed ~ tr[data-section-id][data-hidden="true"] {
  display: none;
}

.section-side-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}

.section-side-select {
  padding: 6px 10px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid transparent;
  background-color: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23333' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 14px;
  padding-right: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.section-side-select:hover {
  background-color: rgba(109, 40, 217, 0.05);
  color: #6d28d9;
}

.section-side-select:focus {
  outline: none;
  border-bottom: 1px solid #6d28d9;
  background-color: rgba(109, 40, 217, 0.05);
  color: #6d28d9;
  box-shadow: none;
}

.section-remove {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}

/* Reset section name positioning */
.section-header .section-name {
  position: static;
  flex: 1;
  max-width: 70%;
  gap: 12px;
}

.section-header .section-name .section-name-text {
  color: #6d28d9;
  font-weight: 600;
  font-size: 13px;
}

.section-count-duration {
  color: #6d28d9;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.6;
}

/* Add more visible border to last row in a section */
tr[data-section-id]:last-of-type {
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.section-header .section-select {
  margin-left: 5px;
  transform: scale(1.2);
  cursor: pointer;
}

/* Style section checkboxes */
.section-select {
  accent-color: #6d28d9;
}

/* Add hover effect to section header */
.section-header:hover {
  background-color: #f2e9e0;
}

/* Section buttons */
.add-section-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

.add-section-btn:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

.edit-section-name-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  padding: 3px;
  opacity: 0.6;
}

.edit-section-name-btn:hover {
  color: #333;
  opacity: 1;
}

.delete-section-btn {
  background: none;
  border: none;
  color: #ff5252;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  padding: 3px;
  opacity: 0.6;
}

.delete-section-btn:hover {
  color: #ff0000;
  opacity: 1;
}

/* Section modal */
.section-modal .modal-content {
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  border: none;
  padding: 25px;
  animation: modalFadeIn 0.3s ease-out;
}

/* Breath option modal styling */
.breath-options {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.breath-option-btn {
  padding: 10px 20px;
  border: 2px solid #ddd;
  background-color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 80px;
}

.breath-option-btn:hover {
  border-color: #6d28d9;
  background-color: #faf5ff;
}

.breath-option-btn.selected {
  border-color: #6d28d9;
  background-color: #6d28d9;
  color: white;
}

.breath-option-btn.selected:hover {
  background-color: #5b21b6;
  border-color: #5b21b6;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-modal h2 {
  color: #6d28d9;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: 600;
}

.section-modal .modal-description {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.section-modal .close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
}

.section-modal .close-modal:hover {
  color: #333;
}

.section-name-input-container {
  display: flex;
  gap: 15px;
  margin-top: 25px;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  padding: 5px;
}

.section-name-input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid transparent;
  background-color: transparent;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: none;
  max-width: 250px ;
}

.section-name-input:focus {
  border-bottom: 1px solid #6d28d9;
  background-color: rgba(109, 40, 217, 0.05);
  box-shadow: none;
  color: #6d28d9;
}

.section-name-input::placeholder {
  color: #aaa;
  font-weight: 400;
  opacity: 0.7;
  font-style: italic;
}

.create-section-btn, .save-section-btn {
  background-color: #6d28d9;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  outline: none;
  box-shadow: 0 2px 4px rgba(109, 40, 217, 0.3);
  min-width: 100px;
  text-transform: uppercase;
}

.create-section-btn:hover, .save-section-btn:hover {
  background-color: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(109, 40, 217, 0.4);
}

.create-section-btn:active, .save-section-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(109, 40, 217, 0.4);
}

.section-select-container {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.section-select-dropdown {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.add-to-section-btn {
  background-color: #6d28d9;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 15px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.add-to-section-btn:hover {
  background-color: #5b21b6;
}

.create-new-section-link {
  margin-top: 15px;
  text-align: center;
}

.create-new-section-link a {
  color: #6d28d9;
  text-decoration: none;
  font-size: 14px;
}

.create-new-section-link a:hover {
  text-decoration: underline;
}

/* Delete confirmation modal styles */
.delete-confirmation .modal-warning {
  font-size: 14px;
  color: #666;
  margin-bottom: 25px;
  text-align: center;
  font-style: italic;
}

.delete-confirmation .modal-description strong {
  color: #6d28d9;
  font-weight: bold;
}

.confirmation-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.cancel-btn,
.delete-group-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cancel-btn {
  background-color: #e0e0e0;
  color: #666;
  border: 2px solid #e0e0e0;
}

.cancel-btn:hover {
  background-color: #d0d0d0;
  border-color: #d0d0d0;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.delete-group-btn {
  background-color: #ff4444;
  color: white;
  border: 2px solid #ff4444;
}

.delete-group-btn:hover {
  background-color: #ff3333;
  border-color: #ff3333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 68, 68, 0.3);
}

.cancel-btn:active,
.delete-group-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* New section row */
.new-section-row {
  background-color: #f8f8f8;
}

.add-section-container {
  padding: 15px;
  text-align: center;
}

.add-section-btn-large {
  background-color: #f0f0f0;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-section-btn-large:hover {
  background-color: #e8e8e8;
  border-color: #999;
  color: #333;
}

.add-section-btn-large span {
  font-weight: bold;
}

/* Asana action buttons */
.asana-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.remove-from-section-btn, .add-to-section-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 3px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.remove-from-section-btn:hover, .add-to-section-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Asana list & recommended chakra circles */
.asana-item .chakra-circles,
.recommended-inline-item .chakra-circles {
  top: 2px;
  right: 2px;
}
.asana-item .chakra-dot,
.recommended-inline-item .chakra-dot {
  width: 8px;
  height: 8px;
  margin-left: -3px;
}

/* Drop target highlight for drag-and-drop pose replacement */
.flow-card.drop-target-highlight,
.asana-card.drop-target-highlight {
  outline: 2px dashed #6d28d9;
  outline-offset: -2px;
  background: rgba(109, 40, 217, 0.06);
  transition: outline 0.15s ease, background 0.15s ease;
}
tr.drop-target-highlight {
  outline: 2px dashed #6d28d9;
  outline-offset: -2px;
  background: rgba(109, 40, 217, 0.06) !important;
}

/* Insertion mode highlights */
.insertion-target {
  position: relative;
  z-index: 2;
}
tr.insertion-target td,
.asana-card.insertion-target {
  background: rgba(109, 40, 217, 0.06) !important;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.asana-card.insertion-target {
  box-shadow: 0 0 0 2px #6d28d9;
  border-radius: 12px;
}

/* Add above: top border indicator */
tr.insertion-above td {
  box-shadow: inset 0 3px 0 0 #6d28d9;
}
.asana-card.insertion-above {
  box-shadow: 0 -3px 0 0 #6d28d9, 0 0 0 2px rgba(109, 40, 217, 0.3);
}

/* Add below: bottom border indicator */
tr.insertion-below td {
  box-shadow: inset 0 -3px 0 0 #6d28d9;
}
.asana-card.insertion-below {
  box-shadow: 0 3px 0 0 #6d28d9, 0 0 0 2px rgba(109, 40, 217, 0.3);
}

/* Swap: pulsing outline */
tr.insertion-swap td {
  animation: insertionPulse 1.5s ease-in-out infinite;
}
.asana-card.insertion-swap {
  animation: insertionPulseCard 1.5s ease-in-out infinite;
}
@keyframes insertionPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(109, 40, 217, 0.3); }
  50% { box-shadow: inset 0 0 0 2px rgba(109, 40, 217, 0.7); }
}
@keyframes insertionPulseCard {
  0%, 100% { box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.3); }
  50% { box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.7); }
}

/* Card view chakra circles */
.card-image {
  position: relative;
}
.card-image .chakra-circles {
  top: 2px;
  right: 2px;
}

.add-custom-pose-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(109, 40, 217, 0.3);
}

/* Swap button styles */
.swap-btn {
  background-color: #6d28d9;
  color: white;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.swap-btn:hover {
  background-color: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(109, 40, 217, 0.3);
}

.swap-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(109, 40, 217, 0.4);
}

/* Card view swap button positioning */
.flow-card .swap-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
  padding: 0;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}
.flow-card:hover .swap-btn {
  opacity: 0.7;
}

/* Add pose buttons container */
.add-pose-buttons {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  justify-content: center;
}

/* Add pose buttons styling */
.add-above-btn, .add-below-btn {
  background-color: #4CAF50;
  color: white;
  width: 24px;
  height: 20px;
  border-radius: 4px;
  font-size: 12px;
}

/* More options dropdown container */
.more-options-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* More options button */
.more-options-btn {
  background-color: #6c757d;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
  cursor: pointer;
  transition: all 0.2s ease;
}

.more-options-btn:hover {
  background-color: #5a6268;
}

.more-options-btn:active {
  background-color: #495057;
  transform: scale(0.95);
}

/* Mobile-specific improvements for more options button */
@media (max-width: 768px) {
  .more-options-btn {
    width: 30px;
    height: 30px;
    font-size: 18px;
    min-height: 30px;
    min-width: 30px;
    background-color: transparent !important;
    color: #000 !important;
    border-radius: 0 !important;
    border: none !important;
  }
  
  .more-options-btn:hover,
  .more-options-btn:active {
    background-color: transparent !important;
    color: #000 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .more-options-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
  }
}

/* Dropdown menu */
.pose-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  min-width: 140px;
  display: none;
  margin-top: 2px;
  max-height: 250px;
  overflow-y: scroll;
  overflow-x: hidden;
}

.pose-dropdown.show {
  display: block;
}

/* Custom scrollbar styling for dropdown */
.pose-dropdown::-webkit-scrollbar {
  width: 8px;
}

.pose-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.pose-dropdown::-webkit-scrollbar-thumb {
  background: #86868b;
  border-radius: 4px;
}

.pose-dropdown::-webkit-scrollbar-thumb:hover {
  background: #5b21b6;
}

/* Mobile-specific dropdown improvements */
@media (max-width: 768px) {
  .pose-dropdown {
    position: fixed;
    top: auto;
    right: 10px;
    left: auto;
    min-width: 200px;
    z-index: 15000;
    margin-top: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid #ddd;
    max-width: calc(100vw - 20px);
    max-height: 300px;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .pose-dropdown.show {
    display: block;
    animation: slideDownMobile 0.2s ease-out;
  }
  
  .dropdown-item {
    padding: 15px 20px;
    font-size: 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
  }
}

@keyframes slideDownMobile {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown items */
.dropdown-item {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.dropdown-item:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Delete item specific styling */
.dropdown-item.delete-item {
  color: #dc3545;
}

.dropdown-item.delete-item:hover {
  background-color: #f8d7da;
  color: #721c24;
}

.add-above-btn:hover, .add-below-btn:hover {
  background-color: #45a049;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.add-above-btn:active, .add-below-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(76, 175, 80, 0.4);
}

/* Swap pose modal styles */
.swap-pose-search-container {
  margin-bottom: 15px;
  width: 100%;
}

.swap-pose-search-container #swapPoseSearch,
.swap-pose-search-container .section-name-input {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  margin: 0;
  flex: 1;
}

.swap-pose-list-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 20px;
}

.swap-pose-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.swap-pose-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border: 2px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  position: relative;
}

.swap-pose-item:hover {
  border-color: #6d28d9;
  transform: translateY(-2px);
}

.swap-pose-item.recommended {
  border-color: #4CAF50;
  background: #f8fff8;
}

.swap-pose-item.recommended:hover {
  border-color: #45a049;
}

.swap-pose-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: 4px;
}

.swap-pose-name {
  font-size: 12px;
  text-align: center;
  color: #333;
  font-weight: 500;
  line-height: 1.2;
}

.recommended-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #4CAF50;
  color: white;
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Center the cancel button in swap modal */
#swapPoseModal .section-name-input-container {
  justify-content: center;
}

/* Mobile Group Header Fixes */
@media (max-width: 768px) {
  /* Tighter row spacing on mobile */
  #flowTable td {
    padding: 2px 3px !important;
  }
  #flowTable td:nth-child(3) {
    padding: 1px 5px !important;
  }
  .table-asana {
    gap: 4px;
  }
  .table-asana-img {
    width: 24px;
    height: 24px;
  }
  #flowTable td:nth-child(2) input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
  }
  .section-header td {
    padding: 4px 3px !important;
  }
  .mobile-side-cycle,
  .mobile-breath-emoji {
    width: 24px;
    height: 24px;
    font-size: 11px;
    border-radius: 6px;
  }
  #flowTable td:nth-child(5) {
    min-width: 30px !important;
  }
  #flowTable td:nth-child(6) {
    min-width: 30px !important;
  }

  /* Fix group header display on mobile */
  .section-header .section-name {
    white-space: normal;
    flex-wrap: wrap;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 0.95em;
    gap: 8px;
    min-height: 40px;
  }
  
  .section-header .section-name span {
    font-size: 13px;
    padding: 4px 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100vw - 150px);
  }

  .section-header .section-name .section-count {
    font-size: 13px;
    padding: 3px 8px;
    margin-left: 0;
    flex-shrink: 0;
    background-color: transparent;
    border-radius: 0;
  }

  .section-header .section-name .section-duration {
    font-size: 13px;
    padding: 3px 6px;
    margin-left: 4px;
    flex-shrink: 0;
    background-color: transparent;
    border-radius: 0;
  }
  
  /* Better mobile layout for group headers */
  .section-header {
    min-height: 36px;
  }

  .section-header td {
    padding: 5px 4px !important;
    vertical-align: middle;
  }
  
  /* Ensure proper spacing between elements */
  .section-header .section-name .section-count,
  .section-header .section-name .section-duration {
    white-space: nowrap;
    font-weight: 600;
  }

  /* Fix for very small screens */
  @media (max-width: 480px) {
    .section-header .section-name span {
      font-size: 12px;
      min-width: 0;
      max-width: calc(100vw - 120px);
    }

    .section-header .section-name .section-count {
      font-size: 12px;
      padding: 2px 6px;
    }

    .section-header .section-name .section-duration {
      font-size: 12px;
      padding: 2px 5px;
    }
  }
}

/* More Options Dropdown Styles */
.more-options-container {
  position: relative;
  display: inline-block;
}

.more-options-btn {
  background-color: #6c757d;
  color: white;
  transition: all 0.2s ease;
}

.more-options-btn:hover {
  background-color: #5a6268;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 140px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item.danger {
  color: #dc3545;
}

.dropdown-item.danger:hover {
  background-color: #f5c6cb;
  color: #721c24;
}

/* Card actions dropdown specific positioning */
.card-actions .more-options-container {
  position: relative;
}

.card-actions .dropdown-menu {
  right: 0;
  top: calc(100% + 2px);
}

/* ==========================================
   Settings Gear Button
   ========================================== */

.settings-gear-btn {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-gear-btn:hover {
  background: #f5f5f5;
  color: #333;
  border-color: #ccc;
}

/* ==========================================
   Settings Modal
   ========================================== */

.settings-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.settings-modal-overlay.active {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.settings-panel {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.settings-header .close-modal {
  font-size: 1.8rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  position: static;
}

.settings-body {
  padding: 8px 24px 24px;
}

.settings-section {
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #999;
  margin: 0 0 12px;
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: #333;
}

.settings-toggle-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 24px;
  background: #e0e0e0;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}
.settings-toggle-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.settings-toggle-row input[type="checkbox"]:checked {
  background: #6d28d9;
}
.settings-toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.settings-buttons-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.settings-action-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #6d28d9;
  color: white;
}

.settings-action-btn:hover {
  background: #5b21b6;
  transform: translateY(-1px);
}

.settings-action-btn.secondary {
  background: #f0f0f0;
  color: #333;
  border-radius: 20px;
}

.settings-action-btn.secondary:hover {
  background: #e5e5e5;
}

.settings-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 0 8px;
  margin-top: 16px;
  border-top: 1px solid #e5e5e5;
}
.settings-app-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #1d1d1f;
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}
.settings-app-link:hover {
  opacity: 0.85;
}
.settings-website-link {
  font-size: 13px;
  color: #6d28d9;
  text-decoration: none;
  font-weight: 500;
}
.settings-website-link:hover {
  text-decoration: underline;
}
.settings-version {
  font-size: 11px;
  color: #999;
}

/* ==========================================
   Stats Dashboard
   ========================================== */

#statsScreen {
  display: none;
}

#statsScreen.active {
  display: block;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  gap: 12px;
}

.stats-header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
}

.stats-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6366f1;
  padding: 6px 0;
  white-space: nowrap;
}

.stats-export-btn {
  flex: 0 !important;
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
  white-space: nowrap;
}

.stats-main {
  padding: 16px 20px 40px;
  max-width: 600px;
  margin: 0 auto;
  overflow-y: auto;
  max-height: calc(100vh - 70px);
}

.stats-period-tabs {
  display: flex;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.stats-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: #666;
  transition: all 0.2s ease;
}

.stats-tab.active {
  background: #fff;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-summary-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.stats-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid #d2d2d7;
}

.stats-card .stats-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.stats-card .stats-label {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-section-block {
  margin-bottom: 24px;
}

.stats-section-block h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #999;
  margin: 0 0 12px;
}

/* Trend Chart */
.stats-trend-chart {
  margin-bottom: 24px;
}

.stats-trend-chart h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #999;
  margin: 0 0 12px;
}

.stats-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 0 4px;
}

.stats-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.stats-bar {
  width: 100%;
  background: #6366f1;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
  opacity: 0.8;
}

.stats-bar-label {
  font-size: 0.7rem;
  color: #999;
  margin-top: 6px;
  text-align: center;
}

.stats-bar-value {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 4px;
  font-weight: 500;
}

/* Pose List */
.stats-pose-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.stats-pose-item:last-child {
  border-bottom: none;
}

.stats-pose-rank {
  width: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #999;
}

.stats-pose-name {
  flex: 1;
  font-size: 0.9rem;
  color: #333;
}

.stats-pose-sanskrit {
  font-size: 0.75rem;
  color: #999;
  font-style: italic;
}

.stats-pose-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6366f1;
  background: #f0f0ff;
  padding: 3px 10px;
  border-radius: 12px;
}

/* Category/Difficulty bars */
.stats-breakdown-item {
  margin-bottom: 10px;
}

.stats-breakdown-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.stats-breakdown-name {
  color: #333;
}

.stats-breakdown-pct {
  color: #999;
  font-weight: 500;
}

.stats-breakdown-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.stats-breakdown-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Session History */
.stats-session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}

.stats-session-item:last-child {
  border-bottom: none;
}

.stats-session-info {
  flex: 1;
}

.stats-session-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.stats-session-date {
  font-size: 0.75rem;
  color: #999;
  margin-top: 2px;
}

.stats-session-meta {
  text-align: right;
}

.stats-session-duration {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

.stats-session-status {
  font-size: 0.7rem;
  margin-top: 2px;
}

.stats-session-status.completed {
  color: #22c55e;
}

.stats-session-status.incomplete {
  color: #f59e0b;
}

/* Clear Stats */
.stats-clear-container {
  text-align: center;
  padding: 20px 0;
  margin-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.stats-clear-btn {
  background: none;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-clear-btn:hover {
  background: #ef4444;
  color: white;
}

/* Empty state */
.stats-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.stats-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.stats-empty h3 {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 8px;
  text-transform: none;
  letter-spacing: normal;
}

.stats-empty p {
  font-size: 0.9rem;
}

/* ─── FLOW ANALYSIS MODAL ───────────────────────────────────────────────────── */

.flow-analysis-content {
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px 28px 32px;
  margin: 4vh auto;
  border-radius: 20px;
  scrollbar-width: thin;
}

#analysisFlowTitle {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 18px 0;
  padding-right: 32px;
}

/* Summary row */
.analysis-summary {
  display: flex;
  justify-content: space-around;
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 8px;
  margin-bottom: 16px;
  border: 1px solid #e9e5f5;
}
.analysis-stat-cell { text-align: center; flex: 1; }
.analysis-stat-val  { font-size: 1.5rem; font-weight: 700; color: #111; }
.analysis-stat-lbl  { font-size: 0.72rem; color: #888; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Section blocks */
.analysis-block {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  border: 1px solid #e9e5f5;
}
.analysis-block-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.analysis-block-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
  color: #6d28d9;
}
.analysis-block-header h3 { font-size: 0.95rem; margin: 0 0 2px; font-weight: 700; }
.analysis-block-header p  { font-size: 0.73rem; color: #888; margin: 0; }

/* Peak Pose */
.analysis-peak-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.analysis-peak-crown {
  font-size: 1.3rem;
  background: rgba(214,158,46,0.15);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.analysis-peak-header h3 { margin: 0 0 2px; font-size: 0.95rem; }
.analysis-peak-header p  { margin: 0; font-size: 0.73rem; color: #888; }
.analysis-position-badge {
  margin-left: auto;
  font-size: 0.73rem;
  font-weight: 600;
  color: #666;
  background: rgba(0,0,0,0.07);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.analysis-peak-card    { display: flex; gap: 12px; }
.analysis-peak-bar     { width: 4px; border-radius: 4px; flex-shrink: 0; min-height: 60px; }
.analysis-peak-name    { font-size: 1.05rem; font-weight: 700; margin-bottom: 2px; }
.analysis-peak-sanskrit { font-size: 0.82rem; color: #888; font-style: italic; margin-bottom: 6px; }
.analysis-peak-meta    { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.analysis-diff-chip    { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.analysis-meta-item    { font-size: 0.73rem; color: #888; }
.analysis-tags         { display: flex; flex-wrap: wrap; gap: 5px; }
.analysis-tag {
  font-size: 0.68rem; color: #888;
  background: rgba(0,0,0,0.07);
  padding: 2px 7px; border-radius: 10px;
}

/* Sequence strip — horizontally scrollable */
.analysis-sequence-strip {
  display: flex;
  gap: 2px;
  height: 28px;
  border-radius: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 10px;
  /* hide scrollbar cross-browser */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.analysis-sequence-strip::-webkit-scrollbar { display: none; }
.analysis-strip-seg { width: 5px; flex-shrink: 0; border-radius: 2px; }

/* Legend inline row */
.analysis-legend-row-wrap { margin-bottom: 10px; }
.analysis-legend-dot  {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.analysis-legend-text { font-size: 0.73rem; color: #888; margin-right: 12px; }

/* Bar chart */
.analysis-chart-bars { margin-top: 4px; }
.analysis-bar-row    { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.analysis-bar-label  { font-size: 0.78rem; font-weight: 500; width: 110px; flex-shrink: 0; }
.analysis-bar-track  { flex: 1; background: rgba(0,0,0,0.08); border-radius: 4px; height: 10px; overflow: hidden; }
.analysis-bar-fill   { height: 100%; border-radius: 4px; }
.analysis-bar-value  { font-size: 0.7rem; color: #888; width: 90px; text-align: right; flex-shrink: 0; }

/* Side balance */
.analysis-side-label-row { font-size: 0.73rem; font-weight: 600; color: #888; margin-bottom: 6px; }
.analysis-side-bar-track {
  height: 24px; border-radius: 6px; overflow: hidden;
  background: rgba(0,0,0,0.06); margin-bottom: 6px;
  display: flex; align-items: stretch;
}
.analysis-side-labels {
  display: flex; justify-content: space-between;
  font-size: 0.73rem; color: #888; margin-bottom: 12px;
}

/* Body heat map — graphic-first layout */
.analysis-body-center    { display: flex; justify-content: center; margin-bottom: 14px; }
.analysis-body-canvas    {
  display: block; border-radius: 6px; background: transparent;
  animation: heatmapPulse 4s ease-in-out infinite;
}
@keyframes heatmapPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
.analysis-body-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.analysis-legend-entry   { display: flex; align-items: center; gap: 6px; min-width: 0; }
.analysis-legend-dot-sm  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.analysis-legend-name    { font-size: 0.73rem; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-legend-pct     { font-size: 0.68rem; color: #888; flex-shrink: 0; }
.analysis-heat-scale     { margin-top: 4px; }
.analysis-heat-scale-label { font-size: 0.68rem; color: #888; margin-bottom: 4px; }
.analysis-heat-scale-bar {
  height: 8px; border-radius: 4px; margin-bottom: 3px;
  background: linear-gradient(to right,
    hsl(59,85%,65%), hsl(30,95%,55%), hsl(0,100%,50%));
}
.analysis-heat-scale-ends { display: flex; justify-content: space-between; font-size: 0.68rem; color: #888; }

/* Chakra toggle buttons */
.analysis-chakra-toggle { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }
.analysis-toggle-btn {
  background: rgba(0,0,0,0.07);
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  color: #555;
}
.analysis-toggle-btn.active { background: #6d28d9; color: #fff; }
.analysis-toggle-btn.active svg { stroke: #fff; }

#analysisChakraCanvas { display: block; margin: 0 auto; max-width: 100%; }
.analysis-empty-note  { font-size: 0.78rem; color: #999; margin: 4px 0; }

/* Analyse button in flow list */
.analyse-btn {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  color: #333;
}
.analyse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  border-color: #6d28d9;
  color: #6d28d9;
}
.analyse-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 600px) {
  .flow-analysis-content {
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 20px 16px 28px;
  }
  .analysis-body-legend-grid { grid-template-columns: 1fr; }
  .analysis-bar-label { width: 80px; }
  .analysis-bar-value { width: 70px; }
}

/* ==========================================
   Enhanced Settings
   ========================================== */
.settings-slider-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.settings-slider-row span:first-child { font-size: 14px; color: #333; flex-shrink: 0; }
.settings-slider-control { display: flex; align-items: center; gap: 8px; }
.settings-slider-control input[type="range"] { width: 100px; accent-color: #6d28d9; }
.settings-slider-val { font-size: 13px; color: #6d28d9; font-weight: 600; min-width: 32px; text-align: right; }
.settings-slider-val-input {
  width: 40px; font-size: 13px; color: #6d28d9; font-weight: 600; text-align: center;
  border: none; border-bottom: 1px solid transparent; background: transparent;
  padding: 2px 0; -moz-appearance: textfield;
}
.settings-slider-val-input::-webkit-outer-spin-button,
.settings-slider-val-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.settings-slider-val-input:focus { outline: none; border-bottom-color: #6d28d9; }
.settings-slider-unit { font-size: 13px; color: #6d28d9; font-weight: 600; }
.settings-select-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f0f0f0;
}
.settings-select-row span { font-size: 14px; color: #333; }
.settings-select-row select, .settings-select-row input[type="time"] {
  border: 1px solid #d2d2d7; border-radius: 8px; padding: 6px 10px;
  font-size: 13px; background: #fff; color: #333; accent-color: #6d28d9;
}
.settings-day-buttons { display: flex; gap: 6px; padding: 10px 0; flex-wrap: wrap; }
.day-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid #d2d2d7;
  background: #fff; color: #666; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.day-btn.active { background: #6d28d9; color: #fff; border-color: #6d28d9; }
.settings-note { font-size: 11px; color: #999; margin-top: 4px; font-style: italic; }

/* ==========================================
   Feature Screens (shared)
   ========================================== */
.feature-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: #fff; border-bottom: 1px solid #d2d2d7;
  position: sticky; top: 0; z-index: 100;
}
.feature-header h1 { font-size: 20px; font-weight: 600; letter-spacing: 0; }
.feature-back-btn {
  background: none; border: none; cursor: pointer; color: #6d28d9;
  font-size: 15px; display: flex; align-items: center; gap: 4px; padding: 4px;
}
.feature-main { padding: 20px; max-width: 600px; margin: 0 auto; }
.feature-main.breathwork-main { max-width: 960px; }
.feature-begin-btn {
  width: 100%; padding: 16px; background: #6d28d9; color: #fff;
  border: none; border-radius: 14px; font-size: 17px; font-weight: 600;
  cursor: pointer; transition: background 0.2s; margin-top: 20px;
}
.feature-begin-btn:hover { background: #5b21b6; }

/* ==========================================
   FAB Menu
   ========================================== */
.fab-backdrop {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); z-index: 899; backdrop-filter: blur(4px);
}
.fab-backdrop.active { display: block; }
.fab-menu {
  display: none; position: fixed; bottom: 100px; right: 32px;
  z-index: 901; flex-direction: column-reverse; gap: 10px; align-items: flex-end;
}
.fab-menu.active { display: flex; }
.fab-menu-item {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: none; border-radius: 28px; padding: 10px 18px 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15); cursor: pointer;
  font-size: 14px; font-weight: 500; color: #333; white-space: nowrap;
  opacity: 0; transform: translateY(20px) scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s;
}
.fab-menu.active .fab-menu-item { opacity: 1; transform: translateY(0) scale(1); }
.fab-menu.active .fab-menu-item:nth-child(1) { transition-delay: 0s; }
.fab-menu.active .fab-menu-item:nth-child(2) { transition-delay: 0.03s; }
.fab-menu.active .fab-menu-item:nth-child(3) { transition-delay: 0.06s; }
.fab-menu.active .fab-menu-item:nth-child(4) { transition-delay: 0.09s; }
.fab-menu.active .fab-menu-item:nth-child(5) { transition-delay: 0.12s; }
.fab-menu.active .fab-menu-item:nth-child(6) { transition-delay: 0.15s; }
.fab-menu-item:hover { background: #f3f0ff; }
.fab-menu-item.fab-hero {
  background: #6d28d9; color: #fff; font-weight: 700; font-size: 15px;
  padding: 12px 22px 12px 16px;
}
.fab-menu-item.fab-hero:hover { background: #5b21b6; }
.fab-menu-item.fab-hero .fab-item-icon svg { stroke: #fff; }
.fab-item-icon { display: flex; align-items: center; justify-content: center; }
.fab-item-label { font-size: inherit; }
.fab-btn.open { transform: rotate(45deg); }

/* ==========================================
   Breathwork
   ========================================== */
.breath-split-layout { display: flex; gap: 16px; align-items: flex-start; }
.breath-split-left { flex: 1; min-width: 0; }
.breath-split-right { width: 300px; flex-shrink: 0; position: sticky; top: 16px; }
.breath-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
@media (max-width: 768px) {
  .breath-split-layout { flex-direction: column; gap: 12px; }
  .breath-split-right { width: 100%; position: static; }
  .breath-patterns {
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 8px; padding: 8px 2px 8px 2px; margin: 4px 0; scrollbar-width: none;
  }
  .breath-patterns::-webkit-scrollbar { display: none; }
  .breath-pattern-card { min-width: 130px; flex-shrink: 0; padding: 12px 10px; }
  .breath-bottom-section { margin-top: 12px; }
  .breath-custom-card { padding: 14px; }
}
.breath-pattern-card {
  background: #fff; border-radius: 16px; padding: 16px 14px;
  border: 2px solid transparent; cursor: pointer; transition: all 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: relative; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.breath-pattern-card.selected { border-color: #6d28d9; background: #f9f5ff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(109,40,217,0.15); }
.breath-pattern-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.breath-pattern-card:active { transform: scale(0.97); }
.breath-card-icon { margin-bottom: 2px; }
.breath-pattern-card h4 { margin: 0; font-size: 14px; color: #1d1d1f; }
.breath-pattern-card .breath-timing { font-size: 11px; color: #6d28d9; font-weight: 600; }
.breath-info-btn {
  position: absolute; top: 8px; right: 8px; background: none; border: none; cursor: pointer;
  color: #aaa; padding: 2px; border-radius: 50%; transition: color 0.2s, background 0.2s;
  line-height: 0;
}
.breath-info-btn:hover { color: #6d28d9; background: rgba(109,40,217,0.08); }
.breath-bottom-section { margin-top: 16px; }
.breath-custom-card {
  background: #fff; border-radius: 16px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.breath-custom-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.breath-custom-card h3 { font-size: 15px; margin: 0; }
.breath-save-preset-circle {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #6d28d9;
  background: transparent; color: #6d28d9; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; padding: 0; flex-shrink: 0;
}
.breath-save-preset-circle:hover { background: rgba(109,40,217,0.1); }
.breath-custom-sliders label {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; font-size: 14px; color: #333;
}
.breath-phase-info {
  min-width: 100px; white-space: nowrap;
}
.breath-custom-sliders input[type="range"] {
  flex: 1; max-width: 220px;
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #e0d4f5, #6d28d9); outline: none;
  transition: background 0.3s;
}
.breath-custom-sliders input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: #6d28d9; cursor: pointer;
  box-shadow: 0 2px 8px rgba(109,40,217,0.4); border: 3px solid #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}
.breath-custom-sliders input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2); box-shadow: 0 3px 12px rgba(109,40,217,0.5);
}
.breath-custom-sliders input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.1);
}
.breath-custom-sliders input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #6d28d9;
  cursor: pointer; box-shadow: 0 2px 8px rgba(109,40,217,0.4); border: 3px solid #fff;
}
.breath-voice-toggle {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  font-size: 14px; color: #555; cursor: pointer; user-select: none;
}
.breath-voice-toggle input[type="checkbox"] { accent-color: #6d28d9; width: 18px; height: 18px; cursor: pointer; }
.breath-save-preset-btn {
  margin-top: 12px; padding: 6px 14px; border: 1.5px dashed #6d28d9; border-radius: 12px;
  background: transparent; color: #6d28d9; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; width: 100%;
}
.breath-save-preset-btn:hover { background: rgba(109,40,217,0.06); }
.breath-saved-presets { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.breath-preset-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #f9f7ff; border-radius: 10px; font-size: 13px;
  cursor: pointer; transition: background 0.15s;
}
.breath-preset-row:hover { background: #f0ebff; }
.breath-preset-row.active { border: 1.5px solid #6d28d9; background: #ede9fe; }
.breath-preset-name { font-weight: 600; color: #333; }
.breath-preset-timing { color: #888; font-size: 12px; }
.breath-preset-delete {
  background: none; border: none; color: #ccc; cursor: pointer; font-size: 16px; padding: 0 4px;
  transition: color 0.15s;
}
.breath-preset-delete:hover { color: #dc2626; }
.breath-duration-selector { margin-top: 16px; }
.breath-duration-selector h3 { font-size: 15px; margin-bottom: 10px; }
.duration-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.duration-pill {
  padding: 8px 16px; border-radius: 20px; border: 1.5px solid #d2d2d7;
  background: #fff; font-size: 13px; font-weight: 600; color: #666;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.25,0.46,0.45,0.94);
}
.duration-pill.active { background: #6d28d9; color: #fff; border-color: #6d28d9; transform: scale(1.05); }
.duration-pill:hover:not(.active) { border-color: #6d28d9; color: #6d28d9; transform: translateY(-1px); }
.duration-pill:active { transform: scale(0.95); }
/* Meditation duration: horizontal scroll, no wrap */
.meditation-durations .duration-pills { flex-wrap: wrap; }
.meditation-durations .duration-pill { white-space: nowrap; flex-shrink: 0; }

/* Breath Player */
.breath-player-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; background: #000; padding: 20px; transition: background 1s ease;
}
.breath-session-timer { font-size: 18px; color: rgba(255,255,255,0.5); margin-bottom: 20px; font-weight: 600; }
.breath-circle-wrap {
  position: relative; width: 240px; height: 240px;
  display: flex; align-items: center; justify-content: center;
}
.breath-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,212,191,0.7) 0%, rgba(45,212,191,0.2) 100%);
  transition: transform 0.3s ease, background 1.5s ease;
  box-shadow: 0 0 60px rgba(45,212,191,0.3);
}
.breath-phase-label {
  position: absolute; font-size: 22px; font-weight: 700; color: #2dd4bf;
  text-align: center; pointer-events: none; transition: color 1s ease;
}
.breath-phase-timer { font-size: 48px; font-weight: 200; color: rgba(255,255,255,0.85); margin-top: 20px; letter-spacing: 2px; }
.breath-player-controls { display: flex; gap: 20px; margin-top: 40px; }
.breath-control-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.1); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); transition: all 0.25s;
}
.breath-control-btn svg { stroke: #fff; }
.breath-control-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
.breath-stop-btn { background: rgba(220,38,38,0.2); }
.breath-stop-btn:hover { background: rgba(220,38,38,0.35); }
.breath-stop-btn svg { stroke: #f87171; }

/* ==========================================
   Meditation
   ========================================== */
.meditation-durations { margin-bottom: 10px; }
.meditation-durations h3 { font-size: 15px; margin-bottom: 10px; }
.meditation-player-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; background: #000; padding: 20px;
}

/* Meditation Timer */
.meditation-time {
  font-size: 72px;
  font-weight: 200;
  color: rgba(255,255,255,0.9);
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

/* Progress bar under clock */
.meditation-progress-bar {
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 1px;
  margin-top: 32px;
  overflow: hidden;
}
.meditation-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6d28d9, #a78bfa);
  border-radius: 2px;
  transition: width 1s linear;
}

.meditation-player-controls { display: flex; gap: 20px; margin-top: 40px; }

/* ==========================================
   Flow Generator
   ========================================== */
.gen-section { margin-bottom: 20px; }
.gen-section h3 { font-size: 15px; margin-bottom: 10px; color: #333; }
.gen-segmented { display: flex; gap: 0; border: 1.5px solid #d2d2d7; border-radius: 10px; overflow: hidden; }
.gen-seg-btn {
  flex: 1; padding: 10px 12px; border: none; background: #fff;
  font-size: 13px; font-weight: 600; color: #666; cursor: pointer; transition: all 0.2s;
}
.gen-seg-btn:not(:last-child) { border-right: 1.5px solid #d2d2d7; }
.gen-seg-btn.active { background: #6d28d9; color: #fff; }
.gen-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.gen-tag {
  padding: 8px 14px; border-radius: 20px; border: 1.5px solid #d2d2d7;
  background: #fff; font-size: 13px; font-weight: 500; color: #666;
  cursor: pointer; transition: all 0.2s;
}
.gen-tag.active { background: #6d28d9; color: #fff; border-color: #6d28d9; }

/* ==========================================
   Text to Flow
   ========================================== */
.text-to-flow-content { max-width: 560px; }
.ttf-textarea {
  width: 100%; border: 1.5px solid #d2d2d7; border-radius: 12px;
  padding: 14px; font-size: 14px; font-family: inherit; resize: vertical;
  min-height: 120px; line-height: 1.5;
}
.ttf-textarea:focus { outline: none; border-color: #6d28d9; }
.ttf-results { margin-top: 16px; }
.ttf-results h3 { font-size: 15px; margin-bottom: 10px; }
.ttf-match-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.ttf-match-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #f9f9f9; border-radius: 10px; font-size: 14px;
}
.ttf-match-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.ttf-match-indicator.high { background: #22c55e; }
.ttf-match-indicator.medium { background: #eab308; }
.ttf-match-indicator.low { background: #ef4444; }
.ttf-match-name { font-weight: 600; }
.ttf-match-extras { font-weight: 400; font-size: 11px; color: #6d28d9; margin-left: 6px; }
.ttf-match-raw { color: #999; font-size: 12px; margin-left: auto; }

/* ==========================================
   Pose Detail
   ========================================== */
.pose-detail-content { max-width: 480px; }
.pose-detail-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.pose-detail-img { width: 100px; height: 100px; object-fit: contain; border-radius: 12px; background: #f5f5f7; }
.pose-detail-info { flex: 1; }
.pose-detail-info h2 { font-size: 20px; margin-bottom: 4px; }
.pose-detail-sanskrit { font-size: 14px; color: #888; font-style: italic; margin-bottom: 6px; }
.pose-detail-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.pose-detail-badge.Beginner { background: #dcfce7; color: #166534; }
.pose-detail-badge.Intermediate { background: #fef3c7; color: #92400e; }
.pose-detail-badge.Advanced { background: #fee2e2; color: #991b1b; }
.pose-detail-row { font-size: 14px; color: #555; margin-bottom: 8px; }
.pose-detail-row strong { color: #333; }
.pose-detail-desc { font-size: 14px; color: #555; line-height: 1.6; margin: 12px 0; }
.pose-detail-transitions { margin-top: 12px; }
.pose-detail-transitions h4 { font-size: 14px; margin-bottom: 6px; }
.pose-detail-transitions .transition-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pose-detail-transitions .transition-tag {
  padding: 4px 10px; background: #f3f0ff; color: #6d28d9; border-radius: 12px;
  font-size: 12px; font-weight: 500;
}
.pose-detail-history { margin-top: 12px; font-size: 13px; color: #888; }

/* ==========================================
   Guide Cue Overlay
   ========================================== */
.guide-cue-overlay {
  position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%);
  background: rgba(109,40,217,0.9); color: #fff; padding: 12px 24px;
  border-radius: 14px; font-size: 14px; max-width: 80%; text-align: center;
  z-index: 500; backdrop-filter: blur(8px);
  animation: guideCueFade 0.3s ease;
}
@keyframes guideCueFade { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.next-pose-timing { font-size: 12px; color: #888; font-weight: 600; }

/* ==========================================
   Onboarding
   ========================================== */
.onboarding-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
.onboarding-carousel {
  background: #fff; border-radius: 24px; padding: 40px 32px 28px;
  width: 90%; max-width: 400px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.onboarding-slide { display: none; }
.onboarding-slide.active { display: block; animation: modalAppear 0.3s ease; }
.onboarding-icon { font-size: 56px; margin-bottom: 16px; }
.onboarding-icon-svg { margin-bottom: 20px; display: inline-block; }
.onboarding-slide h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: #1d1d1f; }
.onboarding-slide p { font-size: 15px; color: #666; line-height: 1.5; }

/* Onboarding slide animations */
.onboarding-float {
  animation: onboardFloat 3s ease-in-out infinite;
}
.onboarding-bounce {
  animation: onboardBounce 2s ease-in-out infinite;
}
.onboarding-pulse {
  animation: onboardPulse 2s ease-in-out infinite;
}
.onboarding-grow {
  animation: onboardGrow 2.5s ease-in-out infinite;
}
.onboarding-breathe {
  animation: onboardFloat 4s ease-in-out infinite;
}
.onboarding-breathe .onboarding-breath-circle {
  animation: onboardBreathCircle 4s ease-in-out infinite;
}
.onboarding-sparkle {
  animation: onboardSparkle 2s ease-in-out infinite;
}

@keyframes onboardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes onboardBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@keyframes onboardPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.9; }
}
@keyframes onboardGrow {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.05) rotate(2deg); }
}
@keyframes onboardBreathCircle {
  0%, 100% { r: 20; opacity: 0.2; }
  50% { r: 28; opacity: 0.35; }
}
@keyframes onboardSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(3deg); }
  75% { transform: scale(1.05) rotate(-3deg); }
}
.onboarding-dots { display: flex; justify-content: center; gap: 8px; margin: 28px 0 20px; }
.onboarding-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #d2d2d7; transition: all 0.3s;
}
.onboarding-dot.active { background: #6d28d9; width: 24px; border-radius: 4px; }
.onboarding-actions { display: flex; justify-content: space-between; align-items: center; }
.onboarding-skip {
  background: none; border: none; color: #999; font-size: 14px; cursor: pointer; padding: 8px;
}
.onboarding-next {
  background: #6d28d9; color: #fff; border: none; border-radius: 12px;
  padding: 12px 32px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.onboarding-next:hover { background: #5b21b6; }

.onboarding-app-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 20px;
  background: #6d28d9;
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.onboarding-app-link:hover { background: #5b21b6; }

/* ==========================================
   Stats Type Filter
   ========================================== */
.stats-type-tabs {
  display: flex; gap: 0; border: 1.5px solid #d2d2d7; border-radius: 10px;
  overflow: hidden; margin-bottom: 12px;
}
.stats-type-tab {
  flex: 1; padding: 8px 12px; border: none; background: #fff;
  font-size: 13px; font-weight: 600; color: #666; cursor: pointer; transition: all 0.2s;
}
.stats-type-tab:not(:last-child) { border-right: 1.5px solid #d2d2d7; }
.stats-type-tab.active { background: #6d28d9; color: #fff; }

.sync-now-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6d28d9;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: background 0.2s;
}
.sync-now-btn:hover {
  background: rgba(109, 40, 217, 0.1);
}
.sync-now-btn.syncing svg {
  animation: syncSpin 1s linear infinite;
}
@keyframes syncSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.generated-icon {
  vertical-align: middle;
  margin-right: 2px;
  flex-shrink: 0;
}

/* ==========================================
   Cloud Sync
   ========================================== */
.cloud-sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f5f5f7;
  border-radius: 10px;
}
.sync-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d2d2d7;
  flex-shrink: 0;
  transition: background 0.3s;
}
.sync-status-text {
  font-size: 13px;
  font-weight: 500;
  color: #666;
}
.sync-provider-info {
  font-size: 14px;
  color: #1d1d1f;
  margin: 0 0 4px;
}
.sync-last-sync {
  font-size: 12px;
  color: #86868b;
  margin: 0 0 12px;
}
.sync-toggles {
  margin-top: 8px;
  border-top: 1px solid #e5e5ea;
  padding-top: 8px;
}
.sync-sub-toggle {
  padding-left: 16px;
}
