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

:root {
  --bg: #1a1a2e;
  --surface: #22223a;
  --surface2: #2a2a46;
  --surface3: #333352;
  --border: #3d3d5c;
  --border-light: #4e4e6e;
  --text: #eeeef5;
  --text-dim: #7b7b95;
  --accent: #f07030;
  --accent-light: #ff9a5c;
  --accent-glow: rgba(240, 112, 48, 0.15);
  --accent-glow-strong: rgba(240, 112, 48, 0.3);
  --green: #2dd4a8;
  --green-glow: rgba(45, 212, 168, 0.15);
  --red: #f06860;
  --gold: #ffd166;
  --gold-glow: rgba(255, 209, 102, 0.2);
  --input-bg: #f5f5fa;
  --input-text: #1a1a2e;
  --gradient-1: linear-gradient(135deg, #f07030 0%, #e04a10 100%);
  --gradient-2: linear-gradient(135deg, #2dd4a8 0%, #1db896 100%);
  --gradient-gold: linear-gradient(135deg, #ffd166 0%, #f0b830 100%);
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 800px 500px at 10% 0%, rgba(240, 112, 48, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 600px 600px at 90% 90%, rgba(45, 212, 168, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(255, 209, 102, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #1a1a2e 0%, #16162a 50%, #121228 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.6' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 100px;
}

/* ===== Auth Screen ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 500px 300px at 50% 0%, rgba(240, 112, 48, 0.14) 0%, transparent 70%),
    radial-gradient(ellipse 300px 300px at 20% 80%, rgba(45, 212, 168, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
}

.auth-box {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.auth-box h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-input {
  display: block;
  width: 100%;
  background: var(--input-bg);
  color: var(--input-text);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-input::placeholder {
  color: #999;
}

.auth-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.auth-btn:first-of-type {
  background: var(--gradient-1);
  color: white;
  box-shadow: 0 4px 16px rgba(240, 112, 48, 0.35);
}

.auth-btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border) !important;
  box-shadow: none;
}

.auth-error {
  background: linear-gradient(135deg, #f06860, #d84040);
  color: white;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}

/* ===== Header ===== */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info span {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

.btn-logout {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  transition: color 0.2s;
}

.btn-logout:active {
  color: var(--red);
}

header {
  margin-bottom: 16px;
}

header h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.date-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.date-picker input[type="date"] {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  color-scheme: dark;
  transition: border-color 0.2s;
}

.date-picker input[type="date"]:focus {
  border-color: var(--accent);
  outline: none;
}

.btn-icon {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-icon:active {
  background: var(--surface2);
  border-color: var(--accent);
}

.btn-small {
  background: var(--gradient-1);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

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

/* ===== Controls ===== */
.controls {
  margin-bottom: 14px;
}

.control-group {
  margin-bottom: 10px;
}

.control-group label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.btn-group {
  display: flex;
  gap: 6px;
}

.btn-toggle {
  flex: 1;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-toggle.active {
  background: var(--gradient-1);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(240, 112, 48, 0.3);
}

/* ===== Day Tabs ===== */
.day-tabs {
  display: flex;
  gap: 5px;
}

.day-tab {
  flex: 1;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.day-tab.active {
  background: var(--gradient-1);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(240, 112, 48, 0.3);
}

.day-tab.rest {
  color: var(--text-dim);
}

.day-tab.rest.active {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--text-dim);
  box-shadow: none;
}

/* ===== Stats Bar ===== */
.stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.stat {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-1);
  opacity: 0.6;
}

.stat:nth-child(2)::before {
  background: var(--gradient-2);
}

.stat:nth-child(3)::before {
  background: var(--gradient-gold);
}

.stat-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-light);
}

.stat:nth-child(2) .stat-value {
  color: var(--green);
}

.stat:nth-child(3) .stat-value {
  color: var(--gold);
}

.stat-label {
  display: block;
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  font-weight: 600;
}

/* ===== Session Toggle ===== */
.session-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.session-btn {
  flex: 1;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.session-btn.active {
  background: var(--gradient-1);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(240, 112, 48, 0.3);
}

/* ===== Exercise Cards ===== */
.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  transition: border-color 0.2s;
}

.exercise-card:hover {
  border-color: var(--border-light);
}

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

.exercise-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  letter-spacing: 0.2px;
}

.pb-badge {
  background: var(--gradient-gold);
  color: #1a1a2e;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  margin-left: 8px;
  white-space: nowrap;
  animation: pbPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 10px var(--gold-glow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes pbPop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.exercise-history {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}

.exercise-history .hist-label {
  color: var(--accent-light);
  font-weight: 700;
}

/* ===== Sets ===== */
.sets-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-number {
  font-size: 12px;
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  text-align: center;
  line-height: 28px;
  flex-shrink: 0;
  background: var(--surface2);
  border-radius: 8px;
  font-weight: 700;
}

/* PB row highlight */
.set-row-pb {
  background: var(--gold-glow);
  border-radius: 12px;
  padding: 4px 6px;
  margin: -4px -6px;
  border: 1px solid rgba(255, 209, 102, 0.3);
}

.set-row-pb .set-number {
  background: var(--gold);
  color: #1a1a2e;
}

/* Drop set row */
.set-row-drop {
  background: rgba(92, 170, 255, 0.08);
  border-radius: 12px;
  padding: 4px 6px;
  margin: -4px -6px;
  margin-top: -2px;
  border: 1px solid rgba(92, 170, 255, 0.2);
  border-left: 3px solid #5cabff;
}

.set-row-drop .set-number {
  background: #5cabff;
  color: #1a1a2e;
  font-size: 10px;
  font-weight: 800;
}

.drop-badge {
  background: #5cabff;
  color: #1a1a2e;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.btn-drop-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.set-row-drop .btn-drop-toggle {
  background: #5cabff;
  color: #1a1a2e;
  border-color: #5cabff;
}

.btn-drop-toggle:active {
  transform: scale(0.9);
}

/* Drop set in history */
.hist-drop {
  color: #5cabff;
  font-weight: 700;
  margin-right: 2px;
}

.set-input {
  background: var(--input-bg);
  color: var(--input-text);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 18px;
  font-weight: 700;
  width: 100%;
  font-family: inherit;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 50px;
}

.set-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.set-input::placeholder {
  color: #bbb;
  font-weight: 400;
}

.input-label {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-remove-set {
  background: none;
  border: none;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  opacity: 0.4;
  border-radius: 6px;
  transition: opacity 0.15s, background 0.15s;
}

.btn-remove-set:active {
  opacity: 1;
  background: rgba(240, 104, 96, 0.1);
}

.btn-add-set {
  background: var(--surface2);
  color: var(--accent-light);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}

.btn-add-set:active {
  background: var(--surface3);
  border-color: var(--accent);
}

/* ===== Rest Day ===== */
.rest-day {
  text-align: center;
  padding: 60px 20px;
}

.rest-icon {
  font-size: 72px;
  margin-bottom: 16px;
  filter: grayscale(0.2);
}

.rest-day h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.rest-day p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
}

/* ===== Saved Indicator ===== */
.save-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--gradient-2);
  color: white;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(45, 212, 168, 0.25);
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ===== FAB Edit Button ===== */
.fab-edit {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--gradient-1);
  color: white;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(240, 112, 48, 0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab-edit:active {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(240, 112, 48, 0.3);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-content {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

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

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
}

.modal-info {
  font-size: 12px;
  color: var(--accent-light);
  margin-bottom: 14px;
  font-weight: 600;
}

.editor-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-height: 0;
}

.editor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.editor-row:hover {
  border-color: var(--border);
}

.editor-row .drag-handle {
  color: var(--text-dim);
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
  opacity: 0.5;
}

.editor-row .drag-handle:active {
  cursor: grabbing;
  opacity: 1;
}

.editor-row .exercise-name-input {
  flex: 1;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}

.editor-row .exercise-name-input:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--bg);
}

.editor-row .btn-delete-exercise {
  background: none;
  border: none;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px 6px;
  opacity: 0.4;
  border-radius: 6px;
  transition: opacity 0.15s;
}

.editor-row .btn-delete-exercise:active {
  opacity: 1;
}

.editor-row.dragging {
  opacity: 0.4;
  background: var(--accent-glow-strong);
}

.editor-row.drag-over {
  border-top: 2px solid var(--accent-light);
}

.editor-add {
  display: flex;
  gap: 8px;
}

.editor-input {
  flex: 1;
  background: var(--input-bg);
  color: var(--input-text);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  transition: border-color 0.2s;
}

.editor-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.editor-input::placeholder {
  color: #999;
}

/* ===== Number Input ===== */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  height: 30px;
}

/* ===== Rest Timer Button (per card) ===== */
.btn-rest-timer {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.15s, color 0.15s;
}

.btn-rest-timer:active {
  background: var(--accent);
  color: white;
}

/* ===== Rest Timer Overlay ===== */
.rest-timer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  padding: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
  border-radius: 20px 20px 0 0;
}

.timer-display {
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: color 0.3s;
}

.timer-display.timer-done {
  color: var(--green);
  animation: timerPulse 0.5s ease infinite alternate;
}

@keyframes timerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.timer-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.timer-buttons {
  display: flex;
  gap: 10px;
}

.timer-btn {
  background: var(--gradient-1);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-width: 70px;
  transition: transform 0.1s;
}

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

.timer-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ===== Weekly Volume Chart ===== */
.chart-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-bottom: 24px;
  position: relative;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar {
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  flex: 1;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.chart-segment {
  width: 100%;
  min-height: 2px;
  transition: height 0.3s ease;
}

.chart-bar-label {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

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

/* ===== Swipe hint ===== */
.session-toggle::after {
  content: 'swipe to switch';
  display: block;
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 9px;
  color: var(--text-dim);
  opacity: 0.5;
  letter-spacing: 0.5px;
}

.session-toggle {
  position: relative;
}

/* ===== Settings Button ===== */
.btn-settings {
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* ===== Settings Modal ===== */
.settings-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--accent-glow);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

.rest-day-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.rest-day-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 10px;
  border-radius: 16px;
  border: 3px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 90px;
}

.rest-day-toggle .rdt-day {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.rest-day-toggle .rdt-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Training day (active/not rest) */
.rest-day-toggle.training {
  border-color: var(--green);
  background: rgba(45, 212, 168, 0.12);
  box-shadow: 0 2px 12px rgba(45, 212, 168, 0.15);
}

.rest-day-toggle.training .rdt-day {
  color: var(--green);
}

/* Rest day */
.rest-day-toggle.resting {
  border-color: var(--border);
  background: var(--surface);
  opacity: 0.5;
}

.rest-day-toggle.resting .rdt-status {
  color: var(--red);
}

.rest-day-toggle.resting .rdt-day {
  color: var(--text-dim);
}

.rest-day-toggle:active {
  transform: scale(0.95);
}

.settings-summary {
  font-size: 14px;
  color: var(--text);
  text-align: center;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.settings-summary strong {
  color: var(--accent-light);
  font-weight: 800;
}

/* ===== Day tab rest indicator ===== */
.day-tab.user-rest {
  opacity: 0.45;
  position: relative;
}

.day-tab.user-rest::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ===== Streak stat ===== */
.stat-streak .stat-value {
  color: var(--accent-light);
}

/* ===== Daily Bar (bodyweight + notes) ===== */
.daily-bar {
  margin-bottom: 14px;
}

.daily-bar-row {
  display: flex;
  gap: 10px;
}

.daily-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.daily-input-group label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.daily-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.daily-input {
  background: var(--input-bg);
  color: var(--input-text);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  width: 90px;
  -webkit-appearance: none;
}

.daily-input:focus {
  outline: none;
  border-color: var(--accent);
}

.daily-unit {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.daily-notes-group {
  flex: 1;
}

.daily-notes-input {
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}

.daily-notes-input:focus {
  outline: none;
  border-color: var(--accent);
}

.daily-notes-input::placeholder {
  color: var(--text-dim);
}

/* ===== Cardio Section ===== */
.cardio-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cardio-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.cardio-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.cardio-type {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-light);
  min-width: 70px;
}

.cardio-duration {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.cardio-note {
  font-size: 11px;
  color: var(--text-dim);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cardio-delete {
  background: none;
  border: none;
  color: var(--red);
  opacity: 0.4;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
}

.cardio-add {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cardio-select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  min-width: 90px;
}

.cardio-dur-input {
  background: var(--input-bg);
  color: var(--input-text);
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  width: 60px;
  font-family: inherit;
  -webkit-appearance: none;
}

.cardio-dur-input:focus {
  outline: 2px solid var(--accent);
}

.cardio-notes-input {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  flex: 1;
  min-width: 0;
}

.cardio-notes-input:focus {
  outline: none;
  border-color: var(--accent);
}

.cardio-notes-input::placeholder {
  color: var(--text-dim);
}

/* ===== Light Theme ===== */
body.light {
  --bg: #f0f0f5;
  --surface: #ffffff;
  --surface2: #f5f5fa;
  --surface3: #eaeaf0;
  --border: #d8d8e4;
  --border-light: #c8c8d8;
  --text: #1a1a2e;
  --text-dim: #6b6b85;
  --input-bg: #ffffff;
  --input-text: #1a1a2e;
  --accent-glow: rgba(240, 112, 48, 0.1);
  --accent-glow-strong: rgba(240, 112, 48, 0.2);
}

body.light::before {
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.6' fill='rgba(0,0,0,0.03)'/%3E%3C/svg%3E");
}

body.light {
  background-image:
    radial-gradient(ellipse 800px 500px at 10% 0%, rgba(240, 112, 48, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 600px 600px at 90% 90%, rgba(45, 212, 168, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #f0f0f5 0%, #e8e8f0 100%);
}

body.light .cardio-select {
  color-scheme: light;
}

body.light .date-picker input[type="date"] {
  color-scheme: light;
  background: var(--surface);
  color: var(--text);
}

body.light .auth-screen {
  background:
    radial-gradient(ellipse 500px 300px at 50% 0%, rgba(240, 112, 48, 0.08) 0%, transparent 70%),
    linear-gradient(180deg, #f0f0f5 0%, #e8e8f0 100%);
}

body.light .save-indicator {
  box-shadow: 0 4px 16px rgba(45, 212, 168, 0.2);
}

/* ===== Selection ===== */
::selection {
  background: var(--accent-glow-strong);
  color: var(--text);
}
