/* ==========================================================
   Hyphan Breath — iPad 10 Optimized Wim Hof Breathing PWA
   ========================================================== */

:root {
  --bg-deep: #050b14;
  --bg-mid: #0a1628;
  --surface: rgba(14, 27, 46, 0.64);
  --surface-strong: rgba(18, 35, 60, 0.88);
  --border: rgba(148, 210, 255, 0.13);
  --border-bright: rgba(148, 210, 255, 0.3);

  --text-primary: #eef6ff;
  --text-secondary: #9ab5d6;
  --text-muted: #6884a6;

  --accent-cyan: #38d9f5;
  --accent-teal: #2dd4bf;
  --accent-blue: #3b82f6;
  --accent-amber: #fbbf24;
  --accent-rose: #fb7185;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Ultra-Dim Night Mode for Dark Rooms / Eyes-Closed Practice */
body.night-mode {
  --bg-deep: #000000;
  --surface: rgba(10, 14, 22, 0.82);
  --surface-strong: rgba(14, 18, 28, 0.96);
  --border: rgba(148, 210, 255, 0.09);
  --text-primary: #c9d8ea;
  --text-secondary: #758ca8;
  --text-muted: #4b5e76;
}

body.night-mode .aurora-bg {
  background: #000000;
}

body.night-mode .aurora-blob {
  opacity: 0.08;
}

body.night-mode .orb-inner {
  filter: brightness(0.68) saturate(0.85);
}

body.night-mode .retention-tap-area {
  filter: brightness(0.82);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ---------- Ambient Aurora Background ---------- */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, #0d223e 0%, #050b14 68%);
  transition: background 0.35s ease;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.26;
  will-change: transform;
  animation: drift 24s ease-in-out infinite alternate;
  transition: opacity 0.35s ease;
}

.blob-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #38d9f5, transparent 70%);
  top: -140px;
  left: -100px;
}

.blob-2 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, #2dd4bf, transparent 70%);
  bottom: -180px;
  right: -120px;
  animation-delay: -7s;
}

.blob-3 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 38%;
  left: 52%;
  opacity: 0.16;
  animation-delay: -13s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(45px, 35px) scale(1.12); }
}

/* ---------- App Shell ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(16px + var(--safe-top)) calc(24px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(24px + var(--safe-left));
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Top Bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  transition: opacity 0.3s ease;
}

/* Distraction-free chrome during active sessions */
body.in-session .nav-pills {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

body.in-session .brand {
  opacity: 0.65;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.3s ease;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  box-shadow: 0 0 14px rgba(56, 217, 245, 0.7);
}

.brand-name {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.nav-pills {
  display: flex;
  background: rgba(15, 29, 50, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.94rem;
  font-weight: 550;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-pill.active {
  background: rgba(56, 217, 245, 0.18);
  color: var(--text-primary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.15s, border-color 0.2s, background 0.2s, color 0.2s;
}

.icon-btn.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 217, 245, 0.16);
  color: var(--accent-cyan);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

/* ---------- Views ---------- */
.view {
  display: none;
  flex: 1;
  animation: fadeIn 0.28s ease-out;
}

.view.active {
  display: flex;
  flex-direction: column;
}

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

.hidden {
  display: none !important;
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- Home Layout (iPad Portrait & Landscape) ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  gap: 24px;
  flex: 1;
  align-items: stretch;
}

.hero-card {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.hero-orb-preview {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.preview-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(56, 217, 245, 0.28);
}

.ring-outer {
  width: 170px;
  height: 170px;
  animation: gentlePulse 5.2s ease-in-out infinite;
}

.ring-mid {
  width: 126px;
  height: 126px;
  border-color: rgba(45, 212, 191, 0.35);
  animation: gentlePulse 5.2s ease-in-out infinite 0.6s;
}

.preview-core {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7be8ff, #26a9e0 55%, #164e63 100%);
  box-shadow: 0 0 42px rgba(56, 217, 245, 0.45);
  animation: gentlePulse 5.2s ease-in-out infinite 0.3s;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(0.94); opacity: 0.78; }
  50% { transform: scale(1.06); opacity: 1; }
}

.hero-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.hero-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 410px;
}

.recipe-pill {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: rgba(56, 217, 245, 0.1);
  border: 1px solid rgba(56, 217, 245, 0.22);
  color: var(--accent-cyan);
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.stat-pill {
  background: rgba(8, 17, 32, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #041320;
  font-size: 1.05rem;
  font-weight: 750;
  padding: 16px 34px;
  cursor: pointer;
  box-shadow:
    0 12px 32px rgba(56, 217, 245, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

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

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-large {
  width: 100%;
  max-width: 320px;
  padding: 18px 36px;
  font-size: 1.15rem;
}

.btn-secondary {
  border: 1px solid var(--border-bright);
  background: rgba(15, 29, 50, 0.75);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

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

.btn-danger-ghost {
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.08);
  color: var(--accent-rose);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

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

.btn-danger-solid {
  border: none;
  background: linear-gradient(135deg, #fb7185, #e11d48);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.15s;
}

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

.btn-micro {
  border: 1px solid rgba(56, 217, 245, 0.32);
  background: rgba(56, 217, 245, 0.12);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 650;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 0.14s, background 0.2s;
}

.btn-micro:active {
  transform: scale(0.94);
  background: rgba(56, 217, 245, 0.24);
}

/* ---------- Settings Card ---------- */
.settings-card {
  padding: 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-section-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.settings-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-title.large {
  font-size: 1.5rem;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.setting-badge {
  color: var(--accent-cyan);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.stepper-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stepper-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(8, 17, 32, 0.65);
  color: var(--text-primary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:active {
  transform: scale(0.92);
  background: rgba(56, 217, 245, 0.18);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: rgba(148, 210, 255, 0.18);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 217, 245, 0.55);
  cursor: pointer;
}

.preset-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(8, 17, 32, 0.5);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s;
}

.chip.active {
  background: rgba(56, 217, 245, 0.2);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

/* Toggle Switch */
.toggles-group {
  gap: 13px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.toggle-title {
  display: block;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toggle-row input {
  display: none;
}

.switch {
  width: 48px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(148, 210, 255, 0.18);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s;
}

.toggle-row input:checked + .switch {
  background: var(--accent-teal);
}

.toggle-row input:checked + .switch::after {
  transform: translateX(20px);
}

/* ---------- Active Session View ---------- */
.session-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 12px;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.phase-pill {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: rgba(56, 217, 245, 0.15);
  border: 1px solid rgba(56, 217, 245, 0.28);
  color: var(--accent-cyan);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.phase-pill.subtle {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}

.round-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 210, 255, 0.2);
  transition: all 0.25s;
}

.round-dot.done {
  background: var(--accent-teal);
}

.round-dot.current {
  width: 28px;
  border-radius: var(--radius-pill);
  background: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 217, 245, 0.65);
}

/* Central Breathing Stage */
.session-stage {
  position: relative;
  width: min(74vw, 440px);
  height: min(74vw, 440px);
  max-height: 49vh;
  max-width: 49vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.ring-track {
  fill: none;
  stroke: rgba(148, 210, 255, 0.11);
  stroke-width: 5;
}

.ring-progress {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1005.31;
  stroke-dashoffset: 1005.31;
  transition: stroke-dashoffset 0.14s linear, stroke 0.35s;
}

.breathing-orb {
  position: absolute;
  width: 64%;
  height: 64%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.62);
  will-change: transform;
}

.orb-ripple {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  border: 1.5px solid rgba(56, 217, 245, 0.26);
  pointer-events: none;
}

.orb-halo {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 217, 245, 0.28), transparent 68%);
  filter: blur(14px);
}

.orb-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(125, 232, 255, 0.92), rgba(38, 169, 224, 0.65) 55%, rgba(14, 52, 82, 0.85) 100%);
  box-shadow: 0 0 60px rgba(56, 217, 245, 0.38), inset 0 0 30px rgba(255, 255, 255, 0.22);
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

/* Final 3 breaths subtle shift */
.session-stage.phase-final-three .ring-progress {
  stroke: var(--accent-teal);
}

.session-stage.phase-final-three .orb-ripple {
  border-color: rgba(45, 212, 191, 0.48);
}

/* Phase color variations */
.session-stage.phase-retention .orb-inner {
  background: radial-gradient(circle at 35% 28%, rgba(45, 212, 191, 0.55), rgba(15, 76, 92, 0.65) 60%, rgba(7, 24, 42, 0.92) 100%);
  box-shadow: 0 0 48px rgba(45, 212, 191, 0.24);
}

.session-stage.phase-retention .ring-progress {
  stroke: var(--accent-teal);
}

.session-stage.phase-recovery .orb-inner {
  background: radial-gradient(circle at 35% 28%, rgba(251, 191, 36, 0.85), rgba(56, 217, 245, 0.55) 60%, rgba(14, 52, 82, 0.88) 100%);
  box-shadow: 0 0 64px rgba(251, 191, 36, 0.34);
}

.session-stage.phase-recovery .ring-progress {
  stroke: var(--accent-amber);
}

.stage-readout {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  pointer-events: none;
}

.stage-prompt {
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 246, 255, 0.92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.stage-primary {
  font-size: clamp(3.2rem, 7vw, 4.6rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}

.stage-secondary {
  font-size: 0.96rem;
  color: rgba(226, 240, 255, 0.84);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Prominent Action Button for Retention & Recovery Inhale */
.retention-tap-area {
  width: 100%;
  max-width: 420px;
  padding: 22px 36px;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #041320;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow:
    0 14px 40px rgba(56, 217, 245, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.retention-tap-area:active {
  transform: scale(0.97);
  filter: brightness(0.95);
  box-shadow: 0 8px 24px rgba(56, 217, 245, 0.3);
}

.retention-tap-area.is-hold {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  box-shadow:
    0 14px 40px rgba(251, 191, 36, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.retention-tap-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.pace-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.pace-end-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.session-pace-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.session-pace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.session-pace-label {
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.session-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Summary View ---------- */
.summary-card {
  max-width: 720px;
  width: 100%;
  margin: auto;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.summary-header {
  text-align: center;
}

.pr-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--accent-amber);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.summary-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 750;
}

.summary-subtitle {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.metric-box {
  background: rgba(8, 17, 32, 0.58);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 750;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.round-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.round-bar-row {
  display: grid;
  grid-template-columns: 82px 1fr 64px;
  align-items: center;
  gap: 14px;
}

.round-bar-label {
  font-size: 0.92rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.round-bar-track {
  height: 14px;
  border-radius: var(--radius-pill);
  background: rgba(148, 210, 255, 0.12);
  overflow: hidden;
}

.round-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
  min-width: 8px;
}

.round-bar-time {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

/* ---------- History View ---------- */
.history-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.history-overview {
  padding: 30px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.history-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.history-chart-wrap {
  background: rgba(8, 17, 32, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.chart-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.history-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 110px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 38px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent-cyan), rgba(45, 212, 191, 0.5));
  min-height: 8px;
}

.chart-val {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: rgba(8, 17, 32, 0.52);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.history-date {
  font-weight: 650;
  font-size: 1rem;
}

.history-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.history-holds {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hold-chip {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(56, 217, 245, 0.14);
  border: 1px solid rgba(56, 217, 245, 0.25);
  color: var(--accent-cyan);
  font-size: 0.86rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(3, 8, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  max-width: 580px;
  width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 28px;
  background: var(--surface-strong);
}

.modal-compact {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.32rem;
}

.modal-body {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.96rem;
}

.modal-body h3 {
  color: var(--text-primary);
  font-size: 1.05rem;
  margin: 20px 0 8px;
}

.safety-callout {
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #ffd5dc;
}

.guide-list {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-note {
  margin: 0;
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer-split {
  justify-content: flex-end;
}

/* ---------- Responsive (iPad Portrait & Smaller) ---------- */
@media (max-width: 880px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    padding: 28px 22px;
  }

  .settings-card {
    padding: 24px 20px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: calc(12px + var(--safe-top)) 14px calc(16px + var(--safe-bottom)) 14px;
  }

  .brand-name {
    display: none;
  }

  .summary-metrics {
    grid-template-columns: 1fr;
  }
}
