:root {
  --bg-primary: #0f1419;
  --bg-secondary: #1a222d;
  --bg-elevated: #232d3b;
  --bg-card: #1e2733;
  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-green: #4ade80;
  --accent-green-dim: #22c55e;
  --accent-blue: #60a5fa;
  --accent-amber: #fbbf24;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --safe-area-top: env(safe-area-inset-top, 0);
  --safe-area-bottom: env(safe-area-inset-bottom, 0);
  --header-height: 64px;
  --seq-1: #4ade80;
  --seq-1-bg: rgba(74, 222, 128, 0.12);
  --seq-2: #60a5fa;
  --seq-2-bg: rgba(96, 165, 250, 0.12);
  --seq-3: #fbbf24;
  --seq-3-bg: rgba(251, 191, 36, 0.12);
  --icon-color: #4ade80;
}

* {
  box-sizing: border-box;
}

html {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Figtree", "Nunito Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg-primary);
  overflow: hidden;
  position: relative;
}

#header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-area-top));
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.header-brand {
  flex: 1;
  min-width: 0;
}

#page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.page-title-short {
  display: none;
}

@media (max-width: 520px) {
  .page-title-full {
    display: none;
  }

  .page-title-short {
    display: inline;
  }
}

.header-subtitle {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.week-menu {
  position: relative;
}

.week-menu-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.week-menu-button:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.18);
}

.week-menu-chevron {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
}

.week-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 200;
}

.week-menu-panel.hidden {
  display: none;
}

.week-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.week-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.week-option.active {
  background: rgba(74, 222, 128, 0.1);
}

.week-option-title {
  font-size: 0.9375rem;
  font-weight: 600;
}

.week-option-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--accent-green);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.icon-button:hover {
  background: var(--bg-card);
  border-color: rgba(255, 255, 255, 0.18);
}

.music-icon {
  stroke: currentColor;
}

#main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(16px + var(--safe-area-bottom));
}

.week-guidance {
  padding: 12px 16px 0;
}

.week-guidance-text {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.meditation-promo {
  padding: 8px 16px 16px;
}

.meditation-promo-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.08) 0%, var(--bg-secondary) 100%);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  text-align: left;
}

.meditation-promo-card:hover {
  border-color: rgba(74, 222, 128, 0.35);
  transform: translateY(-1px);
}

.meditation-promo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(74, 222, 128, 0.15);
  border-radius: var(--radius-md);
  color: var(--accent-green);
  flex-shrink: 0;
}

.meditation-promo-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.meditation-promo-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
}

.meditation-promo-text span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.meditation-promo-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
}

@media (min-width: 769px) {
  body {
    background: #080b10;
  }

  #app-container {
    border-radius: var(--radius-xl);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    margin-top: 16px;
    margin-bottom: 16px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
  }
}
