/* ===== GYM TRACKER - INDUSTRIAL DARK THEME ===== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #1a1a1a;
  --bg4: #222222;
  --surface: #161616;
  --border: #2a2a2a;
  --border2: #333;
  --text: #e8e8e8;
  --text2: #999;
  --text3: #666;
  --accent: #c8ff00;
  --accent2: #a8d900;
  --danger: #ff4444;
  --danger2: #cc3333;
  --success: #00e676;
  --warn: #ffab00;
  --partial: #ff9800;
  --info: #40c4ff;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,.5);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

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

/* --- AUTH SCREEN --- */
.auth-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 20px;
  background: linear-gradient(145deg, var(--bg) 0%, #0d0d0d 50%, #0a0f00 100%);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow);
  animation: fadeScaleIn .4s var(--transition);
}
.auth-card .logo {
  font-family: var(--font-display);
  font-size: 3rem; letter-spacing: 2px;
  color: var(--accent);
  text-align: center;
  margin-bottom: 6px;
  line-height: 1;
}
.auth-card .logo-sub {
  text-align: center; color: var(--text3);
  font-size: .85rem; margin-bottom: 32px;
}
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  border-bottom: 2px solid var(--border);
}
.auth-tabs button {
  flex: 1; padding: 10px; background: none; border: none;
  color: var(--text3); font-family: var(--font-body);
  font-size: .95rem; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.auth-tabs button.active {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* --- FORMS --- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: .8rem; color: var(--text2);
  margin-bottom: 6px; text-transform: uppercase;
  letter-spacing: .5px; font-weight: 500;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

input, select, textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font-body); font-size: .92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,255,0,.1);
}
select { cursor: pointer; }
input[type="date"] { text-align: left; -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; min-height: 60px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border: none; border-radius: var(--radius);
  font-family: var(--font-body); font-size: .92rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); text-decoration: none;
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--accent); color: #000;
}
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 20px rgba(200,255,0,.2); }
.btn-secondary {
  background: var(--bg3); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text3); background: var(--bg4); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger2); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-icon {
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center;
}

/* --- HEADER --- */
.main-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.main-header .brand {
  font-family: var(--font-display);
  font-size: 1.8rem; color: var(--accent);
  letter-spacing: 1px; line-height: 1;
}
.header-right {
  display: flex; align-items: center; gap: 12px;
}
.user-badge {
  font-size: .85rem; color: var(--text2);
}

/* --- NAVIGATION --- */
.nav-bar {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px; overflow-x: auto;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }
.nav-bar button {
  padding: 12px 18px; background: none; border: none;
  color: var(--text3); font-family: var(--font-body);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.nav-bar button.active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.nav-bar button:hover { color: var(--text); }
.nav-icon { font-size: 1.1rem; line-height: 1; }
.nav-label { font-size: .85rem; }

/* --- MAIN CONTENT --- */
.main-content {
  flex: 1; padding: 24px;
  max-width: 1100px; margin: 0 auto; width: 100%;
  animation: fadeIn .3s ease;
}

/* --- PAGE HEADER --- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2.2rem; letter-spacing: 1px;
  color: var(--text);
}

/* --- CARDS --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 16px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: fadeSlideUp .4s var(--transition) both;
}
.card:hover { border-color: var(--border2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.4rem; letter-spacing: .5px;
}
.card-actions { display: flex; align-items: center; gap: 8px; }

/* Card stagger animation */
.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }
.card:nth-child(5) { animation-delay: .2s; }

/* --- BADGES --- */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.badge-active { background: rgba(200,255,0,.15); color: var(--accent); }
.badge-complete { background: rgba(0,230,118,.15); color: var(--success); }
.badge-partial { background: rgba(255,152,0,.15); color: var(--partial); }
.badge-none { background: rgba(255,68,68,.15); color: var(--danger); }
.badge-fast { background: rgba(64,196,255,.15); color: var(--info); }

/* --- EXERCISE LIST --- */
.exercise-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: fadeSlideUp .3s var(--transition) both;
}
.exercise-item:last-child { border-bottom: none; }
.exercise-num {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); border-radius: 50%;
  font-size: .8rem; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.exercise-info { flex: 1; min-width: 0; }
.exercise-name { font-weight: 600; margin-bottom: 2px; }
.exercise-detail { font-size: .82rem; color: var(--text2); }
.exercise-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* --- WARMUP --- */
.exercise-item.warmup {
  background: rgba(255,171,0,.05);
  border-radius: var(--radius);
  padding-left: 14px; padding-right: 14px;
  margin: 2px -14px;
  border-bottom-color: rgba(255,171,0,.12);
}
.exercise-num.warmup {
  background: rgba(255,171,0,.15);
  font-size: 1rem;
}
.badge-warmup {
  display: inline-block; padding: 2px 8px;
  border-radius: 20px; font-size: .6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  background: rgba(255,171,0,.15); color: var(--warn);
  vertical-align: middle; margin-left: 4px;
}
.warmup-toggle {
  display: flex !important; align-items: center; gap: 10px;
  cursor: pointer; text-transform: none !important;
  letter-spacing: 0 !important; font-size: .9rem !important;
  color: var(--text) !important; font-weight: 500 !important;
}
.warmup-toggle input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--warn);
  cursor: pointer;
}
.warmup-toggle-label { color: var(--text2); }

/* --- LOG TABLE --- */
.log-table {
  width: 100%; border-collapse: collapse; font-size: .88rem;
}
.log-table th {
  text-align: left; padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text2); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .5px;
}
.log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.log-table tr:hover td { background: var(--bg3); }

/* --- CALENDAR --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-header {
  text-align: center; padding: 8px;
  font-size: .78rem; color: var(--text3);
  text-transform: uppercase; font-weight: 600;
}
.cal-day {
  aspect-ratio: 1; padding: 6px;
  background: var(--bg3); border-radius: var(--radius);
  font-size: .82rem; cursor: pointer;
  display: flex; flex-direction: column;
  border: 1px solid transparent;
  transition: all var(--transition);
  overflow: hidden;
}
.cal-day:hover { border-color: var(--border2); transform: scale(1.04); }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 8px rgba(200,255,0,.15); }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.empty:hover { transform: none; }
.cal-day .day-num { font-weight: 600; margin-bottom: 2px; }
.cal-day .day-tag {
  font-size: .65rem; padding: 1px 4px;
  border-radius: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cal-day .day-tag.workout { background: rgba(200,255,0,.2); color: var(--accent); }
.cal-day .day-tag.nutri-complete { background: rgba(0,230,118,.2); color: var(--success); }
.cal-day .day-tag.nutri-partial { background: rgba(255,152,0,.2); color: var(--partial); }
.cal-day .day-tag.nutri-none { background: rgba(255,68,68,.2); color: var(--danger); }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-month {
  font-family: var(--font-display);
  font-size: 1.6rem; letter-spacing: 1px;
}

/* --- PROGRESS CARD --- */
.progress-card {
  background: linear-gradient(135deg, var(--bg3) 0%, var(--surface) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 16px;
}
.progress-suggestion {
  font-size: 1.2rem; font-weight: 700;
  color: var(--accent); margin-bottom: 6px;
}
.progress-reason {
  font-size: .88rem; color: var(--text2);
}
.week-bars {
  display: flex; align-items: flex-end; gap: 8px;
  height: 100px; margin-top: 14px;
}
.week-bar {
  flex: 1; background: var(--accent);
  border-radius: 4px 4px 0 0;
  position: relative; min-height: 8px;
  opacity: .7; transition: opacity var(--transition), height .5s var(--transition);
}
.week-bar:last-child { opacity: 1; }
.week-bar-label {
  position: absolute; bottom: -20px;
  font-size: .7rem; color: var(--text3);
  width: 100%; text-align: center;
}

/* --- NUTRITION GRID --- */
.nutri-options {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 12px;
}
.nutri-option {
  padding: 14px; border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg3); cursor: pointer;
  text-align: center; transition: all var(--transition);
  font-weight: 500; font-size: .88rem;
}
.nutri-option:hover { border-color: var(--text3); transform: translateY(-2px); }
.nutri-option:active { transform: scale(.97); }
.nutri-option.selected { border-color: var(--accent); background: rgba(200,255,0,.08); box-shadow: 0 0 12px rgba(200,255,0,.1); }
.nutri-option .nutri-icon { font-size: 1.5rem; margin-bottom: 4px; display: block; }

/* --- BIA LIST --- */
.bia-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; background: var(--bg3);
  border-radius: var(--radius); margin-bottom: 8px;
  transition: transform var(--transition);
}
.bia-item:hover { transform: translateY(-1px); }
.bia-info { display: flex; flex-direction: column; gap: 2px; }
.bia-date { font-weight: 600; }
.bia-filename { font-size: .82rem; color: var(--text2); }
.bia-stats {
  display: flex; gap: 16px; font-size: .82rem; color: var(--text2);
}
.bia-stat-val { font-weight: 700; color: var(--text); }

/* --- MODAL --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(8px);
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: 100%; max-width: 560px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,.5);
  animation: modalIn .3s var(--transition);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem; margin-bottom: 20px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px;
}

/* --- TIMER --- */
.timer-display {
  font-family: var(--font-display);
  font-size: 4rem; text-align: center;
  color: var(--accent); letter-spacing: 3px;
  padding: 20px; margin: 12px 0;
  transition: color .3s;
}
.timer-controls {
  display: flex; gap: 10px; justify-content: center;
}

/* --- TOAST --- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text);
  padding: 14px 24px; border-radius: 50px;
  border: 1px solid var(--border);
  font-size: .88rem; z-index: 2000;
  animation: toastIn .35s var(--transition);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  white-space: nowrap; max-width: 90vw;
  text-align: center;
}
.toast.error { border-color: var(--danger); }
.toast-exit { animation: toastOut .3s var(--transition) forwards; }

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text3);
  animation: fadeIn .5s ease;
}
.empty-state .empty-icon {
  font-size: 3rem; margin-bottom: 12px; opacity: .5;
}
.empty-state p { margin-bottom: 16px; }

/* --- LOADING --- */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}

/* --- EXERCISE DB AUTOCOMPLETE --- */
.ex-suggestions {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 240px; overflow-y: auto; z-index: 50;
  box-shadow: var(--shadow);
}
.ex-suggestion-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.ex-suggestion-item:last-child { border-bottom: none; }
.ex-suggestion-item:hover, .ex-suggestion-item:active { background: var(--bg3); }
.ex-sug-name { font-weight: 500; font-size: .9rem; }
.ex-sug-muscle { font-size: .75rem; color: var(--accent); opacity: .8; }

/* --- EXERCISE INFO CARD (in modal) --- */
.ex-info-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  margin-bottom: 16px;
  animation: fadeSlideUp .3s ease;
}
.ex-info-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.ex-info-title { font-weight: 700; font-size: .95rem; }
.ex-info-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-tag {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .72rem; font-weight: 600;
  background: rgba(200,255,0,.12); color: var(--accent);
}
.ex-tag.secondary { background: rgba(64,196,255,.12); color: var(--info); }
.ex-tag.equip { background: rgba(255,171,0,.12); color: var(--warn); }

/* --- EXERCISE DETAIL MODAL --- */
.ex-detail-images {
  display: flex; gap: 12px; margin-bottom: 20px;
  overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.ex-detail-img {
  width: 180px; height: 180px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg3); flex-shrink: 0;
}
.ex-detail-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}
.ex-detail-meta-item {
  padding: 10px; background: var(--bg3);
  border-radius: var(--radius);
}
.ex-detail-label {
  display: block; font-size: .72rem; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  font-weight: 600; margin-bottom: 2px;
}
.ex-detail-value { font-weight: 600; font-size: .9rem; }
.ex-detail-instructions { margin-bottom: 16px; }
.ex-instructions-list {
  padding-left: 20px; font-size: .88rem;
  color: var(--text2); line-height: 1.6;
}
.ex-instructions-list li { margin-bottom: 8px; }
.ex-description-text {
  font-size: .88rem; color: var(--text2); line-height: 1.6;
}
.ex-description-text p { margin-bottom: 8px; }
.ex-description-text ul, .ex-description-text ol {
  padding-left: 20px; margin-bottom: 8px;
}
.ex-description-text li { margin-bottom: 4px; }

/* --- HEALTH TIP --- */
.health-tip-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(200,255,0,.06) 0%, rgba(200,255,0,.02) 100%);
  border: 1px solid rgba(200,255,0,.2);
  border-radius: var(--radius-lg);
  padding: 18px 22px; margin-bottom: 20px;
  animation: fadeSlideUp .4s var(--transition);
}
.health-tip-icon {
  font-size: 2rem; flex-shrink: 0;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(200,255,0,.1); border-radius: 50%;
}
.health-tip-body { flex: 1; min-width: 0; }
.health-tip-cat {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--accent); margin-bottom: 4px;
}
.health-tip-text {
  font-size: .88rem; color: var(--text2);
  line-height: 1.45;
}
.health-tip-refresh {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--text3);
  transition: color var(--transition), transform .4s var(--transition);
}
.health-tip-refresh:hover {
  color: var(--accent);
  transform: rotate(180deg);
}

/* --- BIA OCR --- */
.bia-preview-img {
  width: 100%; max-height: 200px; object-fit: contain;
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 14px; background: var(--bg3);
}
.bia-ocr-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  background: rgba(64,196,255,.08); border: 1px solid rgba(64,196,255,.2);
  color: var(--info); font-size: .85rem; margin-bottom: 14px;
}
.bia-ocr-status.success {
  background: rgba(0,230,118,.08); border-color: rgba(0,230,118,.2);
  color: var(--success);
}
.bia-ocr-status.error {
  background: rgba(255,68,68,.08); border-color: rgba(255,68,68,.2);
  color: var(--danger);
}
.bia-ocr-bar {
  flex: 1; height: 6px; background: var(--bg3);
  border-radius: 3px; overflow: hidden;
}
.bia-ocr-fill {
  height: 100%; background: var(--info);
  border-radius: 3px; transition: width .3s;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  to { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.9); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 640px) {
  .main-content { padding: 14px 12px; }
  .page-title { font-size: 1.5rem; }
  .page-header { gap: 8px; }
  .form-row { flex-direction: column; gap: 0; }
  .auth-card { padding: 24px 16px; }

  /* Header compact */
  .main-header { padding: 10px 14px; }
  .main-header .brand { font-size: 1.4rem; }
  .user-badge { display: none; }

  /* Bottom nav bar with icons */
  .nav-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 100; border-bottom: none;
    border-top: 1px solid var(--border);
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0));
    justify-content: space-around;
    gap: 0; background: var(--surface);
  }
  .nav-bar button {
    padding: 4px 0; font-size: .7rem;
    flex: 1; text-align: center;
    border-bottom: none; border-top: none;
    display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    position: relative;
  }
  .nav-bar button.active { color: var(--accent); }
  .nav-bar button.active::before {
    content: ''; position: absolute; top: -4px;
    left: 25%; right: 25%; height: 2px;
    background: var(--accent); border-radius: 0 0 2px 2px;
  }
  .nav-icon { font-size: 1.25rem; }
  .nav-label { font-size: .62rem; letter-spacing: .3px; }
  #app { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }

  /* Cards */
  .card { padding: 16px; margin-bottom: 10px; border-radius: var(--radius); }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .card-title { font-size: 1.1rem; width: 100%; }
  .card-actions { width: 100%; flex-wrap: wrap; }

  /* Exercise list mobile */
  .exercise-item {
    flex-wrap: wrap; gap: 10px; padding: 12px 0;
  }
  .exercise-info { min-width: 0; flex: 1; }
  .exercise-name { font-size: .9rem; }
  .exercise-detail { font-size: .78rem; }
  .exercise-actions {
    width: 100%; justify-content: flex-start;
    flex-wrap: wrap; gap: 6px;
    padding-left: 46px;
  }
  .exercise-actions .btn-sm { padding: 8px 12px; }
  .exercise-item.warmup { margin: 2px -12px; padding-left: 12px; padding-right: 12px; }

  /* Modals slide-up from bottom */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 94vh; max-width: 100%;
    animation: modalSlideUp .35s var(--transition);
  }
  .modal::before {
    content: ''; display: block;
    width: 36px; height: 4px;
    background: var(--border2); border-radius: 2px;
    margin: 0 auto 16px;
  }
  .modal-title { font-size: 1.3rem; margin-bottom: 16px; }
  .modal-actions { flex-direction: column; gap: 8px; }
  .modal-actions .btn { width: 100%; }

  /* Calendar */
  .calendar-grid { gap: 2px; }
  .cal-day { padding: 4px; font-size: .72rem; }
  .cal-day .day-tag { font-size: .55rem; }
  .cal-month { font-size: 1.3rem; }

  /* Nutrition */
  .nutri-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  .nutri-option { padding: 12px 8px; }

  /* BIA */
  .bia-stats { flex-direction: column; gap: 4px; }
  .bia-item { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Timer */
  .timer-display { font-size: 3rem; padding: 12px; }

  /* Health tip */
  .health-tip-card { padding: 14px; gap: 12px; }
  .health-tip-icon { width: 40px; height: 40px; font-size: 1.4rem; }
  .health-tip-text { font-size: .82rem; }

  /* Exercise detail */
  .ex-detail-meta { grid-template-columns: 1fr; }
  .ex-detail-img { width: 140px; height: 140px; }
  .ex-info-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Touch-friendly targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: 8px 14px; }
  .btn-icon { width: 40px; height: 40px; }
  input, select, textarea { padding: 13px 14px; font-size: 1rem; }

  /* Log table scrollable */
  .log-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Toast above bottom nav */
  .toast { bottom: calc(70px + env(safe-area-inset-bottom, 0)); }

  /* Empty state compact */
  .empty-state { padding: 40px 16px; }
  .empty-state .empty-icon { font-size: 2.4rem; }

  /* Progress card */
  .progress-card { padding: 16px; }
}
