/* -------------------------------------------------------------
 * FitTracker Pro - Sleek Modern Dark Theme CSS
 * Mobile WebView & Desktop Responsive Design System
 * ------------------------------------------------------------- */

:root {
  --bg-dark: #0b0f17;
  --bg-card: #141b27;
  --bg-card-hover: #1c2637;
  --bg-input: #1d2738;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.25);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00f2fe;
  --accent-cyan-glow: rgba(0, 242, 254, 0.3);
  --accent-emerald: #00e676;
  --accent-emerald-glow: rgba(0, 230, 118, 0.3);
  --accent-violet: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;

  --font-main: 'Outfit', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-icon {
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-brand h1 span {
  color: var(--accent-cyan);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-right-actions {
  display: flex;
  align-items: center;
  width: 100%;
}

.header-action-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.icon-btn.sound-on {
  color: var(--accent-emerald);
  border-color: rgba(0, 230, 118, 0.4);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.2);
}

.icon-btn.sound-off {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Buttons with Generous Padding & No-Wrap */
.btn {
  border: none;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

/* Distinct Button Styles for Output (Export / Copy) vs Input (Import / Save) */
.btn-primary, .btn-export {
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #041019;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.35);
  border: none;
}

.btn-export:hover, .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
  transform: translateY(-1px);
}

.btn-import {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #041019;
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.35);
  border: none;
}

.btn-import:hover {
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.5);
  transform: translateY(-1px);
}

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

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

.btn-accent {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn-md {
  padding: 14px 24px;
  font-size: 1rem;
  white-space: nowrap;
}

.btn-xs {
  padding: 8px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.full-width {
  width: 100%;
}

#importYesterdayBtn, #qrShareBtn, #textShareBtn {
  padding: 8px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-text-link:hover {
  text-decoration: underline;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.margin-left-auto {
  margin-left: auto;
}

.btn-chart-link {
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.btn-chart-link:hover {
  background: rgba(0, 242, 254, 0.2);
}

/* Fixed Bottom Bar Controls */
.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 680px;
  margin: 0 auto;
  background: rgba(14, 21, 33, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glow);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 900;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6);
}

.bottom-timer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer-countdown-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: -0.5px;
}

.timer-icon-mini {
  font-size: 1.1rem;
  color: var(--accent-cyan);
  animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.bottom-timer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bottom-timer-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-bottom-left {
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
}

.btn-bottom-left:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
}

.btn-bottom-right {
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  min-width: 90px;
}

/* Date Bar */
.date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.date-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.date-nav-btn:hover {
  color: var(--text-main);
}

.current-date-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-main);
  cursor: pointer;
}

.current-date-picker input[type="date"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.card-icon.cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
}

.card-icon.emerald {
  background: rgba(0, 230, 118, 0.12);
  color: var(--accent-emerald);
}

.card-icon.violet {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-violet);
}

.card-info {
  display: flex;
  flex-direction: column;
}

.card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-value {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

/* Section Cards */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

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

.section-header.flex-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header.flex-col .header-right-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.title-with-badge {
  width: 100%;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.title-with-badge h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  width: 100%;
}

.title-with-badge h2 i:first-child {
  color: var(--accent-cyan);
}

.toggle-chevron {
  margin-left: auto;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsible Content State */
.exercises-section.collapsed .toggle-chevron {
  transform: rotate(180deg);
}

.exercises-section.collapsed .collapsible-content {
  display: none;
}

.badge {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 242, 254, 0.2);
  white-space: nowrap;
}

/* Exercise Multi-Select Graph Controls */
.graph-selection-wrapper {
  width: 100%;
  margin-top: 4px;
}

.graph-select-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.exercise-multi-select-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.graph-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.graph-chip:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--text-main);
}

.graph-chip.selected {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.graph-chip.all-chip.selected {
  background: rgba(0, 230, 118, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

.chart-metric-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  max-width: 100%;
}

.tag-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  max-width: 100%;
}

.tag-pill.cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.tag-pill.emerald {
  background: rgba(0, 230, 118, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 230px;
}

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

.exercise-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: var(--transition-fast);
}

.exercise-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.exercise-card.collapsed .exercise-card-header {
  margin-bottom: 0;
}

.exercise-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-tag {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.exercise-title {
  font-size: 1.08rem;
  font-weight: 700;
}

.ex-toggle-chevron {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: 4px;
}

.exercise-card.collapsed .ex-toggle-chevron {
  transform: rotate(180deg);
}

.exercise-card-body {
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.exercise-card.collapsed .exercise-card-body {
  display: none;
}

.exercise-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-action-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}

.icon-action-btn:hover {
  color: #ef4444;
}

/* Exercise Target Sets Config Row */
.exercise-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.target-sets-label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.target-sets-input {
  width: 58px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.98rem;
}

.target-sets-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

.sub-achievement {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

.target-sets-counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.set-adjust-btn {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.set-adjust-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Sets Table */
.sets-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.sets-table th {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.sets-table td {
  padding: 8px 6px;
  text-align: center;
}

.set-num-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.sets-table input[type="number"] {
  width: 68px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.92rem;
}

.sets-table input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.complete-set-btn {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.complete-set-btn.completed {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #041019;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

/* Delete Specific Set Row Button */
.delete-set-row-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.delete-set-row-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* Set Action Buttons Group with Extra Padding */
.set-action-buttons {
  display: flex;
  gap: 10px;
}

.add-set-btn {
  flex: 1;
  background: rgba(0, 242, 254, 0.05);
  border: 1px dashed rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.add-set-btn:hover {
  background: rgba(0, 242, 254, 0.12);
}

.remove-set-btn {
  flex: 1;
  background: rgba(239, 68, 68, 0.05);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.remove-set-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.preset-chip:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Empty State & Empty Action Buttons with Extra Padding */
.empty-state {
  text-align: center;
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  width: 100%;
}

.empty-actions .btn {
  padding: 14px 24px !important;
  font-size: 0.96rem !important;
  font-weight: 700 !important;
  border-radius: var(--radius-md) !important;
  white-space: nowrap;
}

.empty-icon {
  font-size: 3.2rem;
  color: var(--text-dim);
}

.empty-state p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* Modals & Modal Footer Buttons */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

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

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.margin-top-12 {
  margin-top: 12px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.96rem;
}

.form-group textarea {
  resize: vertical;
}

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

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

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

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.modal-footer .btn {
  padding: 12px 24px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  border-radius: var(--radius-md) !important;
  min-width: 110px;
  white-space: nowrap;
}

/* Distinct Input / Output Box & Styling */
.io-box {
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.output-box {
  background: rgba(0, 242, 254, 0.03);
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.input-box {
  background: rgba(0, 230, 118, 0.03);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.io-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.io-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.output-tag {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.input-tag {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.output-textarea {
  background: rgba(0, 242, 254, 0.05) !important;
  border: 1px solid rgba(0, 242, 254, 0.3) !important;
  color: var(--accent-cyan) !important;
}

.input-textarea {
  background: rgba(0, 230, 118, 0.05) !important;
  border: 1px solid rgba(0, 230, 118, 0.3) !important;
  color: var(--text-main) !important;
}

.input-textarea:focus {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.3);
}

.qr-instruction {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: left;
  margin-bottom: 14px;
  line-height: 1.5;
}

.qr-canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
  width: fit-content;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
}

.qr-code-raw-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-code-raw-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.qr-code-text-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.qr-code-text-box textarea {
  flex: 1;
  font-size: 0.75rem;
  font-family: monospace;
  padding: 6px;
  border-radius: var(--radius-sm);
  resize: none;
}

.qr-reader-box {
  width: 100%;
  min-height: 180px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
}

.scanner-status {
  text-align: center;
  font-size: 0.78rem;
  color: var(--accent-emerald);
  margin-bottom: 12px;
}

/* Mobile Responsive Query */
@media (max-width: 480px) {
  body {
    padding-bottom: 80px;
  }

  .app-container {
    padding: 10px;
  }

  .app-header {
    gap: 8px;
    padding: 6px 0 10px;
  }

  .header-brand h1 {
    font-size: 1.2rem;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .date-bar {
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
  }

  .date-nav-btn {
    padding: 4px 10px;
    font-size: 1rem;
  }

  .current-date-picker {
    font-size: 0.88rem;
  }

  .dashboard-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
  }

  .metric-card {
    padding: 8px 4px;
    gap: 4px;
    align-items: center;
    text-align: center;
  }

  .card-icon {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .card-label {
    font-size: 0.65rem;
    white-space: nowrap;
    letter-spacing: -0.3px;
  }

  .card-value {
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 1px;
    white-space: nowrap;
  }

  .section-card {
    padding: 14px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
  }

  .section-header {
    margin-bottom: 10px;
  }

  .section-header.flex-col {
    gap: 8px;
    margin-bottom: 10px;
  }

  .title-with-badge h2 {
    font-size: 0.98rem;
  }

  .header-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .header-action-group .btn {
    flex: 1 1 auto;
    min-width: calc(33% - 6px);
    text-align: center;
    justify-content: center;
    padding: 7px 6px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  #importYesterdayBtn, #qrShareBtn, #textShareBtn {
    padding: 7px 6px;
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .chart-metric-tags {
    gap: 4px;
    margin-bottom: 10px;
  }

  .tag-pill {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .graph-chip {
    padding: 4px 9px;
    font-size: 0.75rem;
  }

  .exercise-list {
    gap: 10px;
  }

  .exercise-card {
    padding: 10px 10px;
    border-radius: var(--radius-sm);
  }

  .exercise-card-header {
    margin-bottom: 8px;
  }

  .exercise-title {
    font-size: 0.96rem;
  }

  .category-tag {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .btn-chart-link {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .exercise-target-row {
    padding: 6px 8px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    border-radius: 6px;
  }

  .target-sets-input {
    width: 44px;
    padding: 2px 4px;
    font-size: 0.88rem;
  }

  .set-adjust-btn {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }

  .sets-table {
    margin-bottom: 8px;
  }

  .sets-table th {
    font-size: 0.7rem;
    padding-bottom: 4px;
  }

  .sets-table td {
    padding: 3px 2px;
  }

  .set-num-badge {
    font-size: 0.78rem;
  }

  .sets-table input[type="number"] {
    width: 52px;
    padding: 4px 4px;
    font-size: 0.85rem;
    height: 32px;
  }

  .complete-set-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .delete-set-row-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .set-action-buttons {
    gap: 6px;
  }

  .add-set-btn, .remove-set-btn {
    padding: 7px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
  }

  .btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .empty-actions .btn {
    width: 100%;
  }

  .modal-footer .btn {
    flex: 1;
  }
}
