@media (max-width: 700px) {
  body, .panel, .collapsible-body, .hero, .table, .card {
    font-size: 1.08em !important;
  }
  .btn, .btn-row button, .btn-small {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.1em;
    padding: 0.7em 1.2em;
    margin: 0.3em 0.2em;
    border-radius: 1.5em;
  }
  .btn-row {
    flex-direction: column;
    gap: 0.5em;
    align-items: stretch;
  }
  .stat-grid, .dashboard-grid, .summary-cards {
    flex-direction: column !important;
    gap: 1em !important;
  }
  .table, table {
    font-size: 0.98em;
    overflow-x: auto;
    display: block;
  }
  .topbar, .topnav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }
  .hero-actions, .btn-row {
    flex-wrap: wrap;
    gap: 0.5em;
  }
  input, select, textarea {
    font-size: 1.1em;
    min-height: 44px;
    padding: 0.6em 1em;
  }
}
:root {
  --dark-ink: #f5f5f5;
  --dark-muted: #bdbdbd;
  --dark-paper: #181a1b;
  --dark-accent: #4caf50;
  --dark-accent-strong: #388e3c;
  --dark-accent-soft: #263238;
  --dark-sunset: #ff9800;
  --dark-blue: #90caf9;
  --dark-border: rgba(245,245,245,0.12);
}

body.dark-mode {
  background: linear-gradient(140deg, #181a1b 0%, #23272e 45%, #1a1d1f 100%);
  color: var(--dark-ink);
}
body.dark-mode .user-switch,
body.dark-mode .user-switch-label,
body.dark-mode .user-switch-select {
  color: var(--dark-ink);
  background: #23272e;
  border-color: var(--dark-border);
}
body.dark-mode .panel, body.dark-mode .collapsible-body, body.dark-mode .hero, body.dark-mode .table, body.dark-mode .card {
  background: #23272e !important;
  color: var(--dark-ink) !important;
}
body.dark-mode .btn {
  background: var(--dark-accent);
  color: #fff;
}
body.dark-mode .btn-blue { background: var(--dark-blue); color: #222; }
body.dark-mode .btn-green { background: var(--dark-accent); color: #fff; }
body.dark-mode .btn-red { background: #e57373; color: #fff; }
body.dark-mode .btn-orange { background: var(--dark-sunset); color: #fff; }
body.dark-mode .btn-purple { background: #b39ddb; color: #222; }
body.dark-mode .muted { color: var(--dark-muted) !important; }
body.dark-mode .topbar, body.dark-mode .topnav { background: #181a1b !important; color: var(--dark-ink) !important; }
body.dark-mode .popup { background: #23272e !important; color: var(--dark-ink) !important; }

@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --ink: #1a2327;
  --muted: #6b7a8a;
  --paper: #f8fafc;
  --accent: #4bbf73; /* uplifting green */
  --accent-strong: #2e8b57; /* deeper green */
  --accent-soft: #e6f7ee; /* soft mint */
  --sunset: #ffd166; /* warm gold */
  --blue: #4f8cff; /* friendly blue */
  --border: rgba(76, 191, 115, 0.13);
  --shadow: 0 18px 40px rgba(76, 191, 115, 0.08);
  --celebrate: #ffd166; /* gold for celebration */
  --celebrate-strong: #ffb700;
  --celebrate-soft: #fff7e6;
  --affirm: #4bbf73;
  --affirm-soft: #e6f7ee;
  --affirm-dark: #2e8b57;
  --gentle: #e3f0ff;
  --gentle-blue: #4f8cff;
}

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

/* Body */
body {
  font-family: 'Space Grotesk', 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(244, 182, 109, 0.25), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(31, 122, 79, 0.2), transparent 40%),
    linear-gradient(140deg, #f7f4ee 0%, #eef4ff 45%, #f5f9f1 100%);
  color: var(--ink);
  min-height: 100vh;
}

.user-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink);
}

.user-switch-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.user-switch-select {
  appearance: none;
  padding: 8px 28px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 10px 18px rgba(30, 27, 27, 0.06);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.user-switch-select:focus {
  outline: 2px solid rgba(31, 122, 79, 0.25);
  outline-offset: 2px;
}

.session-status {
  margin-top: 10px;
  font-weight: 600;
}

.inline-details {
  display: inline-block;
  margin-right: 8px;
}

.inline-details summary {
  list-style: none;
  cursor: pointer;
}

.inline-details summary::-webkit-details-marker {
  display: none;
}

.inline-details-body {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.inline-details-body p {
  margin-bottom: 6px;
}

.inline-details-body p:last-child {
  margin-bottom: 0;
}

.inline-form {
  display: inline-block;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.02em;
}

/* Dashboard Layout */
.body-dashboard {
  display: flex;
  gap: 24px;
  padding: 24px;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: linear-gradient(160deg, #1c1b1a 0%, #2a2a28 100%);
  color: #fefbf3;
  padding: 26px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.sidebar h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.25em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar a {
  display: block;
  color: #fefbf3;
  text-decoration: none;
  margin: 6px 0;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Sidebar Buttons */
.sidebar button {
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  background-color: #f4b66d;
  color: #1c1b1a;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.sidebar button:hover {
  background-color: #f0a44f;
  transform: translateY(-1px);
}

/* Inputs */
.sidebar input,
.sidebar select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95em;
  background: rgba(255, 255, 255, 0.08);
  color: #fefbf3;
}

/* Main Panel */
.main {
  flex: 1;
  background: var(--paper);
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.main h2 {
  color: var(--ink);
  margin-bottom: 18px;
  font-size: 2em;
}

/* Buttons (Global) */
.btn {
  display: inline-block;
  padding: 12px 18px;
  margin: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

/* Button palette handled in UI refresh section */

/* Progress Bar */
.progress-bar {
  width: 100%;
  background: rgba(30, 27, 27, 0.1);
  height: 20px;
  border-radius: 10px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #69c08f);
  width: 0%;
  transition: width 0.4s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .body-dashboard {
    flex-direction: column;
    padding: 12px;
  }
  .sidebar {
    width: 100%;
    margin-bottom: 18px;
  }
  .main {
    width: 100%;
    padding: 18px;
  }
  #weightList li {
    font-size: 12px;
  }
  #newWeight {
    font-size: 12px;
  }
  .weight-dropdown {
    font-size: 12px;
  }
}

/* Weight List Styling */
#weightList {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
}

#weightList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fefbf3;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

#weightList li span {
  flex: 1;
  text-align: left;
}

#weightList li button {
  background: transparent;
  color: #f4b66d;
  border: none;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease;
  margin-left: 10px;
}

#weightList li button:hover {
  color: #f09f3e;
}

#newWeight {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08);
  color: #fefbf3;
}

.weight-dropdown {
  padding: 6px 8px;
  font-size: 14px;
  margin-left: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.effort-scale {
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 10px;
    margin-top: 20px;
}

/* Celebrate Banner: uplifting, gold and green confetti */
.celebrate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 20px;
  background: linear-gradient(120deg, var(--celebrate-soft) 60%, var(--affirm-soft) 100%);
  border: 1.5px solid var(--celebrate);
  position: relative;
  overflow: hidden;
  margin: 22px 0 28px;
  box-shadow: 0 4px 24px rgba(255, 209, 102, 0.08);
}
.celebrate-banner::before,
.celebrate-banner::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--celebrate);
  animation: confetti 2.6s infinite ease-in-out;
  top: 10px;
}
.celebrate-banner::after {
  background: var(--affirm);
  animation-delay: 1.2s;
  left: 80%;
}
.celebrate-banner::before {
  left: 15%;
}
}

.smiley:hover {
    transform: scale(1.2);
}

/* Animations */
@keyframes growl {
    0%, 100% { transform: rotate(0deg); color: red; }
    25% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

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

.growl-effect {
    animation: growl 0.6s ease;
}

.bounce-effect {
    animation: bounce 0.6s ease;
}

.pulse-effect {
    animation: pulse 0.6s ease;
}

.growl-effect {
    animation: growl 0.5s ease;
}
@keyframes growl {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: red; }
    100% { transform: scale(1); }
}

.bounce-effect {
    animation: bounce 0.5s ease;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pulse-effect {
    animation: pulse 0.5s ease;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Phase 1 UI Refresh */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(251, 250, 246, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topnav a {
  text-decoration: none;
  color: var(--ink);
  margin-left: 18px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.topnav a:hover,
.topnav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.topnav a.logout-link {
  background: rgba(244, 182, 109, 0.2);
  color: #e8931d;
  margin-left: auto;
  order: 100;
}

.topnav a.logout-link:hover {
  background: rgba(244, 182, 109, 0.4);
  color: #c8700a;
}

.topnav .btn-small {
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.topnav .btn-small:hover {
  background: var(--accent);
  color: white;
}

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

.user-indicator {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.12);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

.body-hub .page,
.body-session .page {
  padding-top: 28px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 10px;
}

.hero.compact {
  align-items: flex-end;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 30px 0;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-card p {
  color: var(--muted);
  margin-bottom: 6px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

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

.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.control-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.control-card h3 {
  margin-bottom: 10px;
}

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

.control-input label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.filter input,
.search-bar input,
textarea,
select,
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.card-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.subpanel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.subpanel h3 {
  margin-bottom: 12px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.mini-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.95);
}

.mini-stat h4 {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.mini-stat p {
  font-size: 1.2rem;
  font-weight: 700;
}

.compact-table .table-row {
  grid-template-columns: 1.5fr 0.5fr;
}

.table-empty {
  color: var(--muted);
  text-align: center;
}

.table-empty td {
  text-align: center;
  color: var(--muted);
}

.collapsible {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0;
}

.collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.collapsible summary::-webkit-details-marker {
  display: none;
}

.collapsible summary h2 {
  margin: 0;
}

.collapsible summary .muted {
  margin-top: 6px;
}

.collapsible-body {
  padding: 0 20px 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 122, 79, 0.12);
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 0.85rem;
}

.notice {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.9);
}

.notice.success {
  background: rgba(31, 122, 79, 0.12);
  color: var(--accent-strong);
  border-color: rgba(31, 122, 79, 0.35);
}

.notice.error {
  background: rgba(216, 76, 63, 0.12);
  color: #8f2f27;
  border-color: rgba(216, 76, 63, 0.3);
}

.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.goal-rows {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.goal-note-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.7fr;
  gap: 12px;
  margin-bottom: 14px;
}

.goal-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
}

.goal-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.celebrate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(31, 122, 79, 0.18), rgba(244, 182, 109, 0.2));
  border: 1px solid rgba(31, 122, 79, 0.35);
  position: relative;
  overflow: hidden;
  margin: 18px 0 24px;
}

.celebrate-banner::before,
.celebrate-banner::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(244, 182, 109, 0.9);
  animation: confetti 2.6s infinite ease-in-out;
  top: 10px;
}

.celebrate-banner::after {
  background: rgba(31, 122, 79, 0.8);
  animation-delay: 1.2s;
  left: 80%;
}

.celebrate-banner::before {
  left: 15%;
}

@keyframes confetti {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { transform: translateY(18px) scale(1.2); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 0.6; }
}

.goal-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.compare-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--celebrate);
  color: #7a5a00;
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(255, 209, 102, 0.12);
}

.btn-small {
  padding: 8px 12px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .goal-row {
    grid-template-columns: 1fr;
  }

  .goal-note-row {
    grid-template-columns: 1fr;
  }
}

.search-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

th {
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
}

td {
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

tbody tr td:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

tbody tr td:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.exercise-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  margin: 4px 6px 4px 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.routine-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.routine-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  background: rgba(31, 122, 79, 0.12);
  color: var(--accent-strong);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.routine-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routine-group h4 {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.routine-row.editing td {
  background: rgba(244, 182, 109, 0.15);
  border-color: rgba(244, 182, 109, 0.5);
}

.exercise-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
  margin: 12px 0 18px;
}

.exercise-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.85);
}

.exercise-group summary {
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
  list-style: none;
}

.exercise-group summary::-webkit-details-marker {
  display: none;
}

.exercise-group-body {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.section-title {
  font-size: 1rem;
  margin: 8px 0 10px;
}

.section-subtitle {
  margin-bottom: 12px;
}

.field-row {
  margin-bottom: 14px;
}

.selected-exercises {
  min-height: 120px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.75);
}

.edit-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(244, 182, 109, 0.2);
  color: #8a5a00;
  font-weight: 600;
  margin-bottom: 16px;
}

.create-section .btn-row {
  margin-top: 12px;
}

.exercise-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.exercise-input {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  margin-bottom: 12px;
}

.set-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.routine-section ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 20px;
}

.routine-section li {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  margin-bottom: 12px;
}

.progress-section table {
  margin-top: 10px;
}

.charts-section {
  margin-top: 24px;
}

.chart-container {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

.no-data {
  color: var(--muted);
}
.affirm {
  color: var(--affirm-dark);
  background: var(--affirm-soft);
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
  display: inline-block;
  margin: 4px 0;
}
.gentle {
  color: var(--gentle-blue);
  background: var(--gentle);
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 600;
  display: inline-block;
  margin: 4px 0;
}

.table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-head {
  background: rgba(31, 122, 79, 0.08);
  font-weight: 600;
}

.pagination {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination a {
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
}

.pagination a.active {
  background: var(--accent-strong);
}

.tag {
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.routine-board.empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}

.exercise-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.95);
}

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

.set-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(249, 250, 246, 0.9);
}

.set-cell {
  font-size: 0.95rem;
}

.status.done {
  color: var(--accent-strong);
  font-weight: 600;
}

.rest-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.btn {
  border: 1px solid transparent;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
}

.btn-blue:hover {
  background: #1f4bb0;
}

.btn-green {
  background: var(--accent);
  color: #fff;
}

.btn-green:hover {
  background: var(--accent-strong);
}

.btn-red {
  background: #d84c3f;
  color: #fff;
}

.btn-red:hover {
  background: #b33b32;
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .page {
    padding: 24px 20px 48px;
  }

  .hero-actions {
    width: 100%;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .set-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topnav a {
    margin-left: 0;
  }
}

