/* ==========================================================================
   STUDIO TABART - AI Fitness & Workout Logger Stylesheet (V2 Overhaul)
   Theme: High-Tech Cyberpunk Glassmorphism, Deep Dark & Neon Emerald
   ========================================================================== */

:root {
  --bg-primary: #060911;
  --bg-secondary: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(16, 185, 129, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-emerald: #10b981;
  --accent-cyan: #0ea5e9;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Pretendard", "Inter", -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 40%);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(6, 9, 17, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.accent-dot { color: var(--accent-emerald); }

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-emerald);
  letter-spacing: 0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.split-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* Quick Metrics Bar */
.quick-macro-bar {
  padding: 1.25rem 1.5rem 0.5rem 1.5rem;
}

.macro-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.macro-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.macro-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.icon-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.icon-cyan { background: rgba(14, 165, 233, 0.15); color: var(--accent-cyan); }

.macro-info { flex: 1; }
.macro-label { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.2rem; }
.macro-value { font-size: 1.25rem; font-weight: 800; color: var(--text-primary); }
.macro-value small { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.macro-sub { font-size: 0.74rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* Main Container & Tabs */
.main-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem 1.5rem;
  flex: 1;
}

.tab-navigation {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.35rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.nav-tab-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-tab-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.nav-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-emerald);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.25s ease; }

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

/* 4-Split Interactive Selector */
.split-selector-wrapper {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.split-history-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.split-history-hint i {
  color: var(--accent-emerald);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.split-history-hint strong {
  color: var(--text-primary);
}

.split-selector-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.35rem;
  border-radius: 12px;
}

.split-select-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.split-select-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.split-select-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

/* Galaxy Watch Daily Steps Widget */
.galaxy-watch-steps-widget {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  flex-wrap: wrap;
}

.watch-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

.watch-text-box { flex: 1; min-width: 200px; }
.watch-title { font-size: 0.95rem; font-weight: 800; color: var(--text-primary); }
.watch-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.2rem; }

.watch-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.watch-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid rgba(14, 165, 233, 0.4);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  min-width: 140px;
}
.watch-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: right;
  outline: none;
}
.watch-unit { font-size: 0.76rem; font-weight: 700; color: var(--accent-cyan); margin-left: 0.35rem; white-space: nowrap; }

.btn-watch-save {
  background: var(--accent-cyan);
  color: #fff;
  border: none;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-watch-save:hover { background: #0284c7; box-shadow: 0 0 12px rgba(14, 165, 233, 0.4); }

/* Section Head Banner */
.section-head-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.split-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.split-badge-large {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.split-emoji { font-size: 2rem; }
.split-title { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.split-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }

.date-selector-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
}

.date-selector input[type="date"] {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.date-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.date-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }

.btn-add-exercise-top {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-exercise-top:hover {
  background: var(--accent-emerald);
  color: #fff;
}

/* Exercise Cards Container */
.exercises-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.exercise-card:hover { border-color: var(--border-hover); }

.exercise-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.exercise-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 240px;
}

.ex-seq-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ex-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.ex-select-dropdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  max-width: 320px;
}
.ex-select-dropdown:focus {
  border-color: var(--accent-emerald);
}

.ex-target-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.ex-actions-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-sm-guide {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--accent-cyan);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sm-guide:hover { background: rgba(14, 165, 233, 0.15); border-color: var(--accent-cyan); }

.btn-del-ex {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-del-ex:hover { color: var(--accent-rose); border-color: var(--accent-rose); background: rgba(244, 63, 94, 0.1); }

/* Set Table */
.set-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.set-row-head, .set-row {
  display: grid;
  grid-template-columns: 46px 1.1fr 1.1fr 80px 32px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}

.set-row-head {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.set-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.set-row.completed {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
}

.set-idx { font-weight: 700; font-size: 0.8rem; color: var(--text-secondary); text-align: center; }

.set-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
  min-width: 0;
  transition: border-color 0.2s;
}
.set-input-wrap:focus-within {
  border-color: var(--accent-emerald);
}
.set-input-wrap input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}
.set-input-wrap input::-webkit-outer-spin-button,
.set-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.set-input-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.2rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-complete-set {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-complete-set:hover { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.btn-complete-set.done {
  background: var(--accent-emerald);
  color: #fff;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.btn-del-set-row {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-del-set-row:hover { color: var(--accent-rose); }

.set-table-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.btn-add-set-row {
  background: transparent;
  border: 1px dashed rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-set-row:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--accent-emerald);
}

/* Cardio Dedicated Container */
.cardio-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.cardio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
}

.cardio-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cardio-input-box label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.cardio-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.cardio-cal-preview {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.cardio-cal-preview strong { color: var(--accent-emerald); }

/* Bottom Save Action Banner */
.bottom-action-banner {
  margin-top: 2rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  flex-wrap: wrap;
}

.bottom-action-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.bottom-action-info i { color: var(--accent-emerald); }

.btn-save-all-main {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}
.btn-save-all-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
}

/* Charts Tab */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.chart-header h3 { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.badge-sub { font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 6px; background: rgba(255,255,255,0.06); color: var(--text-muted); }

.chart-canvas-wrap {
  width: 100%;
  height: 280px;
  position: relative;
}

/* Catalog Library Tab */
.catalog-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.catalog-header-card h3 { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 0.4rem; }
.catalog-header-card p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.2rem; }

.catalog-filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.filter-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip.active {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}
.catalog-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }

.catalog-card-img {
  width: 100%;
  height: 180px;
  position: relative;
  background: #000;
}
.catalog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-pill {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--accent-cyan);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.catalog-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.catalog-card-body h4 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.cat-sub { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.cat-tips { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; flex: 1; margin-bottom: 0.85rem; }
.cat-video-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s;
}
.cat-video-btn:hover { background: var(--bg-card-hover); color: var(--accent-emerald); border-color: var(--accent-emerald); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head-title { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.modal-head-desc { font-size: 0.8rem; color: var(--accent-cyan); margin-top: 0.15rem; }
.modal-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; }

.modal-body { padding: 1.5rem; }

.guide-image-box {
  width: 100%;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  background: #000;
}
.guide-image-box img { width: 100%; height: 100%; object-fit: contain; }

.guide-tip-box {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-emerald);
  border-radius: 0 10px 10px 0;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}
.guide-tip-box h4 { font-size: 0.85rem; font-weight: 700; color: var(--accent-emerald); display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.35rem; }
.guide-tip-box p { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.55; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }

.diet-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  outline: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-emerald);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .macro-container { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .header { padding: 0.65rem 0.85rem; }
  .quick-macro-bar { padding: 0.85rem 0.85rem 0.25rem 0.85rem; }
  .main-container { padding: 0.75rem 0.65rem 4rem 0.65rem; }
  .split-selector-bar { grid-template-columns: repeat(2, 1fr); }
  .cardio-grid { grid-template-columns: repeat(2, 1fr); }
  
  .set-row-head, .set-row {
    grid-template-columns: 38px 1fr 1fr 68px 26px;
    gap: 0.3rem;
    padding: 0.35rem 0.3rem;
  }
  .set-idx { font-size: 0.72rem; }
  .set-input-wrap { padding: 0.25rem 0.35rem; }
  .set-input-wrap input { font-size: 0.88rem; }
  .set-input-unit { font-size: 0.68rem; margin-left: 0.15rem; }
  .btn-complete-set { padding: 0.35rem 0.25rem; font-size: 0.7rem; border-radius: 6px; }
  
  .bottom-action-banner {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  .btn-save-all-main {
    width: 100%;
    justify-content: center;
  }
}
