/* ═══════════════════════════════════════════════
   Workout Manager — Global Styles
   Mobile-first, dark theme only
   ═══════════════════════════════════════════════ */

:root {
  --bg: #0d0d1a;
  --bg-card: #161628;
  --bg-surface: #1e1e36;
  --bg-hover: #2a2a4a;
  --accent: #00d2ff;
  --accent-secondary: #e94560;
  --accent-tertiary: #b14aed;
  --text: #f0f0f0;
  --text-muted: #8888aa;
  --text-dim: #555570;
  --border: #2a2a4a;
  --success: #00c853;
  --warning: #ffd600;
  --danger: #e94560;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --header-height: 56px;
  --font-title: 'Bebas Neue', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ── App Shell ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--accent);
  letter-spacing: 1px;
}

#view-container {
  flex: 1;
  padding: 16px;
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Bottom Nav ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  min-height: 48px;
  padding: 4px 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
  transform: scale(0.95);
}

.nav-item.active {
  color: var(--accent);
}

.nav-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* ── View Headers ── */
.view-title {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.view-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #00bae6;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ── Placeholder View ── */
.view-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
}

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

.view-placeholder .placeholder-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Toggle Switch ── */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--bg);
}

/* ── Forms ── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Prevent iOS zoom on focus — font-size must be >= 16px */
@supports (-webkit-touch-callout: none) {
  .form-input, .form-textarea, .form-select {
    font-size: max(1rem, 16px);
  }
}

/* Hide number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888aa'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ── List Items ── */
.list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, opacity 0.2s;
}

.list-item.inactive {
  opacity: 0.5;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.list-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.icon-btn.danger:hover {
  color: var(--danger);
}

/* ── Drag & Drop ── */
.drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 1.2rem;
  padding: 4px;
  user-select: none;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.list-item.dragging {
  opacity: 0.4;
  border-color: var(--accent);
}

.list-item.drag-over {
  border-color: var(--accent);
  border-style: dashed;
}

/* ── Priority Number ── */
.priority-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Inline Form ── */
.inline-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.inline-form-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: rgba(0, 200, 83, 0.15);
  color: var(--success);
}

.badge-inactive {
  background: rgba(136, 136, 170, 0.15);
  color: var(--text-muted);
}

.badge-category {
  background: rgba(177, 74, 237, 0.15);
  color: var(--accent-tertiary);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* ── Menu Links (Plus/Settings hub) ── */
.menu-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.15s;
  min-height: 48px;
}

.menu-link:active {
  background: var(--bg-hover);
}

.menu-link-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.menu-link-content {
  flex: 1;
  min-width: 0;
}

.menu-link-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.menu-link-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.menu-link-arrow {
  font-size: 1.4rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Wizard: Duration & Mode grids ── */
.duration-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.duration-btn {
  flex: 1;
  min-width: 60px;
  min-height: 48px;
  padding: 10px 8px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.duration-btn.active {
  border-color: var(--accent);
  background: rgba(0, 210, 255, 0.1);
  color: var(--accent);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-grid.trio {
  grid-template-columns: 1fr 1fr 1fr;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 12px 8px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.mode-btn.small {
  min-height: 48px;
  font-size: 0.85rem;
}

.mode-btn.active {
  border-color: var(--accent);
  background: rgba(0, 210, 255, 0.1);
  color: var(--accent);
}

.mode-icon {
  font-size: 1.5rem;
}

/* ── Loading ── */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Session Preview ── */
.session-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.session-rationale {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.5;
}

.session-section {
  margin-bottom: 20px;
}

.session-section-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--accent-tertiary);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.exercise-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.exercise-card.warmup-cooldown {
  background: var(--bg-surface);
  border-color: transparent;
}

.exercise-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-secondary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.exercise-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.exercise-details {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 2px;
}

.exercise-cues {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Error Box ── */
.error-box {
  background: rgba(233, 69, 96, 0.1);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  padding: 12px;
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ── Active Session ── */
.active-session {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
}

.active-global-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
}

.global-timer {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: 2px;
}

.phase-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.active-exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.active-exercise-name {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.set-indicator {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-tertiary);
  margin-bottom: 8px;
}

.active-cues {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.active-prescriptions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.prescription-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.prescription-value {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--accent);
  letter-spacing: 1px;
}

.prescription-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exercise-timer {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--accent-secondary);
  letter-spacing: 3px;
}

.active-input-row {
  display: flex;
  gap: 12px;
}

.active-input-group {
  flex: 1;
}

.active-input {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
}

.btn-big {
  min-height: 60px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Rest Screen ── */
.rest-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.rest-timer {
  font-family: var(--font-title);
  font-size: 6rem;
  color: var(--accent);
  letter-spacing: 4px;
  line-height: 1;
  margin-bottom: 8px;
}

/* ── Summary ── */
.summary-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.summary-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.summary-stat-value {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: 1px;
}

.summary-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-exercises {
  margin-bottom: 16px;
}

.summary-exercise-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.summary-exercise-row:last-child {
  border-bottom: none;
}

.summary-time {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--accent-secondary);
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* ── Chips ── */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 40px;
}

.chip.active {
  border-color: var(--accent);
  background: rgba(0, 210, 255, 0.1);
  color: var(--accent);
}

.chip:active {
  transform: scale(0.95);
}

/* ── Disabled state ── */
.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Journal ── */
.journal-month {
  margin-bottom: 24px;
}

.journal-month-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.journal-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 48px;
}

.journal-card:active {
  border-color: var(--accent);
}

.journal-date-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
  flex-shrink: 0;
}

.journal-day-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.journal-day-num {
  font-family: var(--font-title);
  font-size: 1.6rem;
  color: var(--text);
  line-height: 1;
}

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

.journal-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.journal-duration {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.journal-score {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.journal-sensations {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.journal-arrow {
  font-size: 1.4rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.journal-notes {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.chip.small {
  padding: 3px 8px;
  font-size: 0.7rem;
  min-height: auto;
}

/* ── Dashboard ── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.dash-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-stat-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.dash-stat-value {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: 1px;
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-section {
  margin-bottom: 20px;
}

.dash-section-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dash-last-session {
  cursor: pointer;
  transition: border-color 0.2s;
}

.dash-last-session:active {
  border-color: var(--accent);
}

.dash-last-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Volume Bar ── */
.volume-ratio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.volume-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--bg-surface);
  margin-bottom: 8px;
}

.volume-bar-fill.tirage {
  background: var(--accent);
  transition: width 0.5s ease;
}

.volume-bar-fill.poussee {
  background: var(--accent-secondary);
  transition: width 0.5s ease;
}

.volume-legend {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.volume-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.volume-dot.tirage {
  background: var(--accent);
}

.volume-dot.poussee {
  background: var(--accent-secondary);
}

/* ── PWA standalone adjustments ── */
@media (display-mode: standalone) {
  #app-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

/* ── Utilities ── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ── Touch & Mobile ── */
* {
  -webkit-tap-highlight-color: transparent;
}

button, a, [role="button"] {
  touch-action: manipulation;
}

/* Prevent text selection on interactive elements */
.btn, .chip, .nav-item, .duration-btn, .mode-btn, .journal-card, .toggle, .drag-handle {
  user-select: none;
  -webkit-user-select: none;
}
