:root {
  --bg: #09090b;
  --bg-subtle: #0f0f13;
  --card: #121216;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.04);
  --accent: #10b981;
  --accent-rgb: 16, 185, 129;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-secondary: #06b6d4;
  --accent-secondary-rgb: 6, 182, 212;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --pill-bg: #1c1c22;
  --pill-border: rgba(255, 255, 255, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  padding-bottom: 96px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Header */
header {
  position: sticky;
  top: 0;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  z-index: 100;
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #131318;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
  overflow: hidden;
}

.app-titles h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-titles p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.safety-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.safety-guide-btn:active {
  background: rgba(16, 185, 129, 0.25);
  transform: scale(0.97);
}

/* Week Tracker & Equipment Card */
.week-tracker-banner {
  max-width: 640px;
  margin: 12px auto 6px;
  padding: 0 16px;
}

.tracker-card {
  background: linear-gradient(145deg, #131318 0%, #0d0d12 100%);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tracker-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.equipment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid;
}

.chip-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.3);
}

.chip-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.chip-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.reset-week-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reset-week-btn:hover {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* Weekly Progress Section */
.tracker-progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tracker-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tracker-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tracker-remaining-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
  border: 1px solid rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

.tracker-pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tracker-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.tracker-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* 3 Days Status Row */
.tracker-days-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.day-status-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: inherit;
}

.day-status-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
}

.day-status-card.active-day {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.05);
}

.day-status-card.day-done {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(16, 185, 129, 0.1);
}

.day-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.day-status-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}

.day-status-tag {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
}

.day-status-card.day-done .day-status-tag {
  color: var(--accent);
  font-weight: 700;
}

.day-status-desc {
  font-size: 0.64rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-mini-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.day-mini-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Metrics 4-Box Grid */
.tracker-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.tracker-metric-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f4f4f5;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.metric-total {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
}

.metric-sub {
  font-size: 0.63rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .tracker-card {
    padding: 12px 11px;
    gap: 10px;
  }
  .tracker-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
  }
  .tracker-title {
    font-size: 0.68rem;
  }
  .metric-val {
    font-size: 0.92rem;
  }
}

/* Day Selector Tabs */
.tabs-wrapper {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 14px 4px;
}

.tabs-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: rgba(18, 18, 22, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 4px;
  width: 100%;
}

.tab-btn {
  width: 100%;
  min-width: 0;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tab-btn .tab-day {
  font-size: clamp(0.78rem, 3.2vw, 0.88rem);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.tab-btn .tab-sub {
  font-size: clamp(0.6rem, 2.4vw, 0.68rem);
  font-weight: 500;
  opacity: 0.8;
  margin-top: 2px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tab-btn.active {
  background: var(--text);
  color: #000;
  border-color: var(--text);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.12);
}

.tab-btn.active .tab-sub {
  opacity: 0.85;
}

/* Main Container */
.container {
  padding: 12px 16px;
  max-width: 640px;
  margin: 0 auto;
}

.day-header {
  margin: 10px 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}

.day-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.day-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.day-progress-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  white-space: nowrap;
}

.day-progress-badge.all-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.4);
}

/* Mandatory Cervical Warmup Banner from v1 */
.warmup-banner {
  background: rgba(18, 18, 22, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 14px 0 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.warmup-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-top: 2px;
}

.warmup-banner-content {
  flex: 1;
}

.warmup-banner-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.warmup-item {
  font-size: 0.76rem;
  color: #d4d4d8;
  line-height: 1.45;
}

.warmup-item strong {
  color: #34d399;
}

.warmup-video-link {
  background: transparent;
  border: none;
  color: var(--accent-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 4px;
  text-decoration: underline;
  transition: opacity 0.15s;
}

.warmup-video-link:active {
  opacity: 0.7;
}

/* Section Subheadings */
.section-header {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.warmup-badge-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

/* Exercise Card */
.exercise-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.exercise-card.card-completed {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(18, 22, 20, 0.7);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.exercise-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.equipment-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

.target-badge {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.exercise-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.exercise-prescription {
  font-size: 0.8rem;
  color: #e4e4e7;
  font-weight: 600;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rest-tag {
  color: var(--accent-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Neck Safety Alert Box on Cards */
.neck-alert-box {
  background: rgba(16, 185, 129, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 8px 12px;
  margin: 10px 0 12px;
  font-size: 0.78rem;
  color: #d4d4d8;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.neck-alert-box svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.neck-alert-box strong {
  color: #34d399;
  font-weight: 700;
}

/* Video & Form Guide Trigger Button */
.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.video-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: #f4f4f5;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.video-trigger-btn:active {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(0.97);
}

.video-trigger-btn svg {
  color: var(--accent-secondary);
}

.step-count-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Interactive Set Pills */
.sets-row {
  display: flex;
  gap: 8px;
}

.set-pill {
  flex: 1;
  padding: 12px 6px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 52px;
}

.set-pill:active {
  transform: scale(0.95);
}

.set-pill span.subtext {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.7;
}

.set-pill.done {
  background: var(--accent);
  color: #052e16;
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.set-pill.done span.subtext {
  opacity: 0.95;
  font-weight: 800;
}

/* Video & Form Guide Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.modal-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  background: rgba(18, 18, 22, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close-btn:active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  border-bottom: 1px solid var(--card-border);
}

.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.modal-badge-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 6px;
}

.modal-badge-card span.label {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: block;
  text-transform: uppercase;
}

.modal-badge-card span.val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
  display: block;
}

.modal-blueprint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .modal-blueprint-grid {
    grid-template-columns: 1fr;
  }
}

.blueprint-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 12px;
}

.blueprint-phase {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.blueprint-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.blueprint-cue {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.blueprint-highlight {
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
}

.steps-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.steps-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.steps-list {
  list-style: decimal inside;
  font-size: 0.78rem;
  color: #d4d4d8;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
}

.external-yt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  transition: all 0.15s;
}

.external-yt-link:active {
  background: rgba(6, 182, 212, 0.2);
}

/* Neck Safety Guide Dedicated Modal */
.guide-rule-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.guide-rule-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.guide-rule-desc {
  font-size: 0.76rem;
  color: #d4d4d8;
  line-height: 1.45;
}

.guide-dismiss-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--accent);
  color: #052e16;
  font-size: 0.85rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
}

.guide-dismiss-btn:active {
  transform: scale(0.98);
}

/* Full-Screen Rest Timer Overlay */
.timer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 32px);
  text-align: center;
}

.timer-overlay.open {
  display: flex;
}

.timer-top-label {
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.timer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.timer-display {
  font-size: clamp(6.5rem, 24vw, 13rem);
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: #fff;
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.15);
  margin-bottom: 14px;
  transition: color 0.2s ease;
}

.timer-display.pulse-warning {
  color: #ef4444;
  text-shadow: 0 0 45px rgba(239, 68, 68, 0.45);
  animation: timer-pulse 0.6s infinite alternate;
}

@keyframes timer-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

.timer-exercise-name {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  max-width: 85%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-controls {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.timer-btn {
  flex: 1;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: #18181b;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.timer-btn.accent {
  background: var(--text);
  color: #000;
  border: none;
}

.timer-btn:active {
  transform: scale(0.96);
}

/* Bottom Quick Action Bar */
.quick-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12, 12, 15, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--card-border);
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 8px);
  z-index: 50;
}

.quick-bar-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.quick-bar-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1.2;
}

.quick-bar-text strong {
  color: var(--accent);
  font-size: 0.94rem;
  font-weight: 800;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.quick-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-toggle-btn, .reset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sound-toggle-btn:active, .reset-btn:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 68px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(16, 185, 129, 0.95);
  backdrop-filter: blur(8px);
  color: #052e16;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

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

/* Bottom Sheet Confirmation Dialog */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 550;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  background: linear-gradient(180deg, #18181f 0%, #0d0d11 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px 24px 0 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.75);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.bottom-sheet-backdrop.open .bottom-sheet {
  transform: translateY(0);
}

.bottom-sheet-handle-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0 14px;
  cursor: grab;
  touch-action: none;
}

.bottom-sheet-handle {
  width: 42px;
  height: 4.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.bottom-sheet-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.bottom-sheet-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  margin-bottom: 2px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.bottom-sheet-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f4f4f5;
  margin: 0;
  letter-spacing: -0.01em;
}

.bottom-sheet-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  max-width: 380px;
}

.bottom-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.sheet-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  font-family: inherit;
}

.sheet-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.sheet-btn-danger:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.sheet-btn-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
}

.sheet-btn-cancel:active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: scale(0.98);
}
