/* RoburformaAI design system: dark precision theme (redesign A, 2026-10) */
:root {
  --bg-main: #0B0F14;
  --bg-card: #131A22;
  --bg-card-hover: #17202A;
  --border-color: #1F2833;
  --border-accent: #2DD4BF;

  --primary: #2DD4BF;
  --primary-hover: #5EEAD4;
  --primary-ink: #06231F;
  --accent-cyan: #38BDF8;
  --accent-emerald: #10B981;
  --accent-amber: #F5A524;
  --accent-rose: #F472B6;
  --accent-purple: #A78BFA;

  --text-main: #E8EDF2;
  --text-muted: #C2CCD6;
  --text-dim: #A9B4C0;

  --font-family: 'Geist', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', 'Segoe UI Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-main: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 2px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Modal Overlay & Cards */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #131A22;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  padding: 0 0 20px 0;
  overflow: hidden;
}

.modal-header-banner {
  background: #0F766E;
  color: #FFFFFF;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.modal-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
}

.lang-switcher {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm, 6px);
  padding: 3px 5px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SVG flags: flag emojis do not render on Windows (shown as "SE", "GB", "PL"). */
.lang-flag {
  display: block;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.15);
}

.lang-btn:hover {
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.lang-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
  border-color: #2DD4BF;
  box-shadow: 0 0 0 1px #2DD4BF;
}

.badge-v {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.modal-subtitle {
  color: #E0F2FE;
  font-size: 0.85rem;
  margin-top: 4px;
}

.modal-body {
  padding: 0 24px;
}

/* Login <-> register links (the tab bar above is hidden) */
.auth-switch {
  margin-top: 14px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted, #A9B4C0);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary, #60A5FA);
  text-decoration: underline;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #17202A;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--primary);
  color: var(--primary-ink);
}

/* Forms & Inputs */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.input-group input,
.input-group textarea,
.select-input {
  width: 100%;
  padding: 8px 12px;
  background: #131A22;
  border: 1px solid #2A3644;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
}

.input-group textarea {
  resize: vertical;
  min-height: 70px;
}

.input-group input:focus,
.input-group textarea:focus,
.select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2);
}

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

.input-row .input-group {
  flex: 1;
}

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

.consent-checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem !important;
  font-weight: 400 !important;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: pointer;
}

.consent-checkbox-label input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Remember Login Checkbox */
.login-remember-group {
  margin: -4px 0 16px 0;
}

.login-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.login-remember-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: var(--radius-sm);
  margin: 0;
}

.login-remember-label:hover {
  color: var(--text-main);
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #1F2833;
  color: var(--text-main);
  border: 1px solid #2A3644;
}

.btn-secondary:hover {
  background: #2A3644;
}

.btn-block {
  width: 100%;
  display: block;
}

.error-msg {
  margin-top: 15px;
  padding: 10px;
  background: #3A1A1D;
  border: 1px solid #5B2A2E;
  color: #FCA5A5;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.success-msg {
  margin-top: 15px;
  padding: 10px;
  background: #10302C;
  border: 1px solid #1B4A48;
  color: #6EE7B7;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* App Main Container */
.app-container {
  padding: 15px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header Bar (RoburformaAI Hub Header) */
.hub-header {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-main);
  margin-bottom: 12px;
}

.hub-title-group h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.hub-sync-status {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--accent-amber);
}

.hub-range-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.range-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-right: 2px;
}

.btn-range {
  background: #1F2833;
  color: var(--text-main);
  border: 1px solid #2A3644;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
  transition: all 0.15s ease;
}

.btn-range:hover {
  background: #2A3644;
}

.btn-range.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.hub-range-controls .btn {
  padding: 3px 9px;
  font-size: 0.75rem;
  line-height: 1.25;
}

/* Top Navigation Bar (COROS Style) */
.hub-navbar {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-main);
  margin-bottom: 15px;
}

.nav-tabs-left {
  display: flex;
  gap: 6px;
}

.nav-tab-btn {
  background: #1F2833;
  color: var(--text-main);
  border: 1px solid #2A3644;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.nav-tab-btn:hover {
  background: #2A3644;
}

.nav-tab-btn.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.nav-tab-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Navigation Dropdown Menu (Uppdatera / Logga mätningar) */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.dropdown-caret {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.nav-dropdown.open .dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 190px;
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.nav-dropdown-menu.hidden {
  display: none !important;
}

.nav-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nav-dropdown-menu .dropdown-item:hover {
  background: #17202A;
  color: var(--primary);
}

.nav-tabs-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-tag {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Summary Metric Cards Grid (3 Columns) */
.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

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

/* 4 Columns Grid (for Training + Weather - strictly 4 compact cards on a single row) */
.cards-row.cards-row-4,
.cards-row-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 15px !important;
  width: 100% !important;
}

/* Nutrition has three cards (Weight, Energy balance, Macros). */
.cards-row.cards-row-4.nutrition-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
@media (max-width: 768px) {
  .cards-row.cards-row-4.nutrition-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .cards-row.cards-row-4.nutrition-cards > .summary-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 440px) {
  .cards-row.cards-row-4.nutrition-cards { grid-template-columns: 1fr !important; }
}

/* Running and Cycling have five cards (the fifth is FTP). */
.cards-row.cards-row-4.sport-cards-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
@media (max-width: 1100px) {
  .cards-row.cards-row-4.sport-cards-5 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 768px) {
  .cards-row.cards-row-4.sport-cards-5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .cards-row.cards-row-4.sport-cards-5 > .summary-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 440px) {
  .cards-row.cards-row-4.sport-cards-5 { grid-template-columns: 1fr !important; }
}

.cards-row-4 .summary-card {
  padding: 10px 12px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  border-radius: var(--radius-sm) !important;
}

.cards-row-4 .summary-card h3 {
  font-size: 0.8rem !important;
  margin-bottom: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.cards-row-4 .summary-card .summary-value {
  font-size: 1.4rem !important;
  margin-bottom: 2px !important;
  line-height: 1.15 !important;
}

.cards-row-4 .summary-card .summary-status-header {
  font-size: 0.74rem !important;
  margin-bottom: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.cards-row-4 .summary-card .summary-subtext,
.cards-row-4 .summary-card #val-train-status-metrics {
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

@media (max-width: 768px) {
  .cards-row.cards-row-4,
  .cards-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
}

@media (max-width: 440px) {
  .cards-row.cards-row-4,
  .cards-row-4 {
    grid-template-columns: 1fr !important;
  }
}

.summary-card {
  position: relative;
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
}

.summary-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  padding-right: 30px;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.summary-status-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: #E8EDF2;
  margin-bottom: 6px;
}

.summary-trend {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.summary-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 2px;
}

.summary-source {
  font-size: 0.75rem;
  font-style: italic;
  color: #8A97A6;
  margin-top: 4px;
}

/* AI Recommendation Box in Card 1 */
.ai-advice-box {
  white-space: pre-line;
  font-size: 0.825rem;
  color: #D5DDE5;
  background: #131A22;
  border: 1px solid #1F2833;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  line-height: 1.45;
  margin-top: 6px;
}

/* Charts Grid (2 Columns x 4 Rows) */
.charts-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

@media (max-width: 1100px) {
  .charts-grid-2col {
    grid-template-columns: 1fr;
  }
}

.chart-card-box {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-main);
  position: relative;
}

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

.chart-card-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0;
}

.chart-card-box > h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

/* Info button strictly in the top-right of the chart card */
.chart-info-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: #17202A;
  border: 1px solid #2A3644;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #C2CCD6;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
  outline: none;
  z-index: 20;
}

.chart-info-btn:hover,
.chart-info-btn:focus-visible {
  background: #16233A;
  border-color: #3B82F6;
  color: #93C5FD;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  transform: scale(1.08);
}

.chart-regenerate-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.chart-regenerate-btn.spinning svg {
  animation: chartRegenerateSpin 0.9s linear infinite;
}

@keyframes chartRegenerateSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Info Popover / Tooltip Card */
.chart-info-popover {
  position: absolute;
  top: 46px;
  right: 16px;
  width: min(340px, calc(100% - 32px));
  background: #131A22;
  border: 1px solid #2A3644;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  padding: 14px 16px;
  z-index: 100;
  animation: fadeInChartPop 0.18s ease-out forwards;
}

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

.chart-info-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1F2833;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.chart-info-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #E8EDF2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-info-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #8A97A6;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.chart-info-close-btn:hover {
  color: #E8EDF2;
  background: #17202A;
}

.chart-info-popover-body {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #C2CCD6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-info-desc strong,
.chart-info-guidance strong {
  color: #E8EDF2;
}

.chart-canvas-wrapper {
  position: relative;
  height: 240px;
  width: 100%;
}

/* Data Table Card */
.table-card-box {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-main);
  margin-bottom: 15px;
}

.table-card-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-hr-zones-box {
  margin-top: 16px;
  margin-bottom: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: #131A22;
  font-weight: 600;
  color: var(--text-muted);
}

.data-table tr:hover {
  background: #17202A;
}

/* Workout lists: a sparkle marks a workout with an AI analysis (its start is the tooltip). */
.col-ai-analysis {
  white-space: nowrap;
  text-align: center;
}

.ai-analys-icon {
  font-size: 1.05rem;
  cursor: help;
}

/* Floating AI Coach Chat Bubble (Matching Soma Demo design & size) */
.floating-chat-bubble {
  position: fixed;
  right: 20px;
  top: 58%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 9999px;
  background: #10B981;
  color: #E8EDF2;
  border: none;
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.35), 0 4px 6px -4px rgba(16, 185, 129, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
}

.floating-chat-bubble:hover {
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 14px 20px -3px rgba(16, 185, 129, 0.45), 0 6px 8px -4px rgba(16, 185, 129, 0.3);
  background: #34D399;
}

.floating-chat-bubble:active {
  transform: translateY(-50%) scale(0.95);
}

.floating-chat-bubble.active {
  background: #243040;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.35);
}

.floating-chat-bubble .bubble-icon-chat,
.floating-chat-bubble .bubble-icon-close {
  display: flex;
  align-items: center;
  justify-content: center;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

/* Floating Chat Panel */
.floating-chat-panel {
  position: fixed;
  top: 70px;
  bottom: 24px;
  right: 76px;
  width: 440px;
  max-width: calc(100vw - 90px);
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  animation: floatingChatSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floatingChatSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.floating-chat-panel.hidden {
  display: none !important;
}

.floating-chat-header {
  padding: 10px 14px;
  background: #131A22;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.floating-chat-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-chat-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.floating-chat-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.floating-chat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-chat-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.floating-chat-close-btn:hover {
  color: var(--text-main);
  background: #1F2833;
}

.floating-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #131A22;
}

.floating-chat-body .quick-chips-row {
  padding: 8px 12px;
  border-bottom: 1px solid #1F2833;
  background: #131A22;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.floating-chat-body .chat-messages-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floating-chat-footer {
  padding: 10px 12px;
  background: #131A22;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .floating-chat-panel {
    top: 60px;
    bottom: 80px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
  .floating-chat-bubble {
    top: auto;
    bottom: 20px;
    right: 16px;
    transform: none;
  }
  .floating-chat-bubble:hover {
    transform: scale(1.08);
  }
  .floating-chat-bubble:active {
    transform: scale(0.95);
  }
}

/* AI Chat Window Modal / Panel */
.ai-chat-card-box {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  height: 650px;
  overflow: hidden;
}

.chat-controls-bar {
  padding: 12px 16px;
  background: #131A22;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6EE7B7;
  background: #10302C;
  border: 1px solid #1B4A48;
  border-radius: 999px;
  white-space: nowrap;
  cursor: default;
}

.btn-clear-chat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #131A22;
  border: 1px solid #5B2A2E;
  color: #F87171;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-chat:hover {
  background: #3A1A1D;
  border-color: #F87171;
  color: #FCA5A5;
}

.quick-chips-row {
  display: flex;
  gap: 6px;
}

.chip-btn {
  background: #131A22;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn:hover {
  background: #16233A;
  border-color: var(--primary);
  color: var(--primary);
}

.chat-messages-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #131A22;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg-row {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.chat-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-row.bot {
  align-self: flex-start;
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-section-header {
  margin: 12px 0 4px 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #E8EDF2;
  display: block;
}

.chat-msg-row.user .chat-msg-bubble {
  background: var(--primary);
  color: var(--primary-ink);
}

.chat-msg-row.bot .chat-msg-bubble {
  background: #131A22;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #131A22;
  border-top: 1px solid var(--border-color);
}

.key-box {
  font-family: var(--font-mono);
  background: #2E2414;
  border: 1px dashed #F59E0B;
  padding: 12px;
  border-radius: var(--radius-sm);
  color: #F5C76A;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  word-break: break-all;
  margin: 12px 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Danger Zone Card */
.danger-card-box {
  background: #3A1A1D !important;
  border: 1px solid #5B2A2E !important;
}

.danger-btn {
  background: #DC2626 !important;
  color: #FFFFFF !important;
  font-weight: 700;
}

.danger-btn:hover {
  background: #B91C1C !important;
}

/* --- DATAKÄLLOR (EXTERNA TJÄNSTER) --- */
.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 15px;
}

.ds-card {
  background: #131A22;
  border: 1px solid #1F2833;
  border-top: 4px solid #3A4756;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ds-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ds-logo-lockup {
  display: flex;
  align-items: center;
}

.ds-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ds-brand-icon {
  flex-shrink: 0;
  display: block;
}

.ds-brand-name {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.strava-text {
  font-family: var(--font-family);
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #FC4C02;
}

.garmin-text {
  font-family: var(--font-family);
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #5EEAD4;
}

.garmin-text .ds-subbrand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #A9B4C0;
  text-transform: uppercase;
}

.withings-text {
  font-family: var(--font-family);
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #E8EDF2;
}

.fitbit-text {
  font-family: var(--font-family);
  font-weight: 400;
  letter-spacing: -0.5px;
  color: #00B0B9;
  font-size: 1.35rem;
}

.whoop-text {
  font-family: var(--font-family);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1.5px;
  color: #E8EDF2;
}

.hevy-text {
  font-family: var(--font-family);
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #FF4500;
}

.mywhoosh-text {
  font-family: var(--font-family);
  font-weight: 900;
  letter-spacing: 0.8px;
  color: #FFFFFF;
}

.mywhoosh-accent {
  color: #F5A800;
}

.polar-text {
  font-family: var(--font-family);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #E01A22;
}

.coros-text {
  font-family: var(--font-family);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #FF5722;
}

.suunto-text {
  font-family: var(--font-family);
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #D8232A;
}

.telegram-text {
  font-family: var(--font-family);
  font-weight: 800;
  letter-spacing: 1px;
  color: #229ED9;
}

.ds-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.ds-card-head h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #E8EDF2;
  margin: 0;
}

.ds-desc {
  font-size: 0.82rem;
  color: #A9B4C0;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.ds-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #17202A;
  color: #A9B4C0;
  white-space: nowrap;
}

.ds-badge.connected {
  background: #10302C;
  color: #4ADE80;
}

.ds-steps {
  margin: 14px 0 10px 18px;
  padding: 0;
  font-size: 0.8rem;
  color: #C2CCD6;
  line-height: 1.6;
}

.ds-link {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5EEAD4;
  text-decoration: underline;
  margin-bottom: 12px;
}

.ds-field {
  margin-bottom: 10px;
}

.ds-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #D5DDE5;
  margin-bottom: 4px;
}

.ds-copy-row {
  display: flex;
  gap: 6px;
}

.ds-copy-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #2A3644;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: #131A22;
  color: #D5DDE5;
}

.ds-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ds-sync-info {
  margin-top: 10px;
  font-size: 0.78rem;
  color: #A9B4C0;
  font-style: italic;
}

.ds-status {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #D5DDE5;
  min-height: 1.1em;
}

.ds-mfa-row.hidden {
  display: none;
}

/* Readiness breakdown under the recovery score (recovery_model.py) */
.readiness-details { margin: 6px 0 8px; font-size: 0.8rem; line-height: 1.45; color: #C2CCD6; }
.readiness-line { margin: 1px 0; }
.readiness-meta-line { color: #8A97A6; font-size: 11px; margin-bottom: 4px; line-height: 1.3; }
.readiness-meta { color: #A9B4C0; }
.readiness-stale { color: #8A97A6; font-style: italic; }
.readiness-flags { color: #F5C76A; font-weight: 600; }
.readiness-better { color: #6EE7B7; }
.readiness-worse { color: #FCA5A5; }
.readiness-extra { color: #C2CCD6; }
.readiness-pills { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.readiness-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: #C2CCD6;
  white-space: nowrap;
}
.readiness-pill.readiness-better { color: #5EEAD4; background: rgba(94, 234, 212, 0.1); }
.readiness-pill.readiness-worse { color: #F87171; background: rgba(248, 113, 113, 0.1); }
.readiness-pill.readiness-flags { color: #FBBF24; background: rgba(251, 191, 36, 0.1); }
.readiness-pill.readiness-stale { color: #8A97A6; font-style: italic; }
.training-form-basis { color: #8A97A6; font-size: 0.78rem; }

/* Nutrition page (nutrition_model.py) */
.nutrition-subtext { color: #C2CCD6; margin-top: 4px; }
.nutrition-subtext .nutrition-muted { color: #8A97A6; }
.nutrition-macros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; margin: 4px 0; font-size: 0.8rem; color: #E8EDF2; }
.nutrition-macros .nutrition-macro-value { font-weight: 700; }
.nutrition-macros .nutrition-macro-rate { color: #A9B4C0; font-size: 0.72rem; }
.nutrition-disclaimer { font-size: 0.78rem; color: #A9B4C0; line-height: 1.5; padding: 10px 12px; border-left: 3px solid #2A3644; background: rgba(0, 0, 0, 0.02); border-radius: 4px; }

/* Nutrition: goal, signals and food diary (nutrition_engine.py) */
.nutrition-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
.nutrition-row-3 .summary-card { padding: 10px 12px; min-width: 0; }
.nutrition-row-3.nutrition-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nutrition-row-3 .summary-card h3 { font-size: 0.8rem; margin-bottom: 6px; }
.nutrition-goal-form { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.nutrition-goal-form .select-input { flex: 1 1 120px; width: auto; padding: 6px 8px; font-size: 0.8rem; }
.nutrition-goal-form .btn { padding: 6px 12px; font-size: 0.8rem; }
.nutrition-signals { font-size: 0.8rem; line-height: 1.5; color: #D5DDE5; }
.nutrition-balance-signals { border-top: 1px solid #1F2833; margin-top: 8px; padding-top: 6px; }
.nutrition-balance-signals-title { font-size: 0.75rem; font-weight: 600; color: #C2CCD6; margin-bottom: 2px; }
.nutrition-info-subtitle { display: block; margin-top: 12px; }
.nutrition-signal { display: flex; gap: 6px; align-items: baseline; margin: 2px 0; }
.nutrition-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; display: inline-block; transform: translateY(-1px); }
.nutrition-note-warn { color: #F5C76A; }
.nutrition-note-bad { color: #FCA5A5; }
.nutrition-diary { margin-bottom: 15px; }
.nutrition-diary-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.nutrition-diary-header h3 { margin: 0; }
.nutrition-date-nav { display: flex; gap: 6px; align-items: center; }
.nutrition-date-nav .select-input { width: auto; padding: 6px 8px; }
.nutrition-date-nav .btn, .nutrition-diary-actions .btn { padding: 6px 10px; font-size: 0.8rem; }
.nutrition-diary-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.nutrition-coverage { font-size: 0.8rem; color: #C2CCD6; margin-bottom: 8px; }
.nutrition-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; margin-bottom: 12px; }
.nutrition-bar-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: #D5DDE5; margin-bottom: 2px; gap: 6px; }
.nutrition-bar { height: 7px; background: #1F2833; border-radius: 4px; overflow: hidden; }
.nutrition-bar > span { display: block; height: 100%; border-radius: 4px; }
.nutrition-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.nutrition-slot { border: 1px solid #1F2833; border-radius: 8px; padding: 8px 10px; min-width: 0; background: #131A22; }
.nutrition-slot.skipped { background: #131A22; color: #8A97A6; }
.nutrition-slot-header { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 0.85rem; margin-bottom: 4px; }
.nutrition-slot-kcal { color: #A9B4C0; font-size: 0.78rem; white-space: nowrap; }
.nutrition-meal { display: flex; gap: 6px; align-items: flex-start; font-size: 0.78rem; padding: 4px 0; border-top: 1px dashed #1F2833; }
.nutrition-meal-body { flex: 1; min-width: 0; }
.nutrition-meal-name { overflow-wrap: anywhere; color: #E8EDF2; }
.nutrition-meal-macros { color: #A9B4C0; font-size: 0.72rem; }
.nutrition-icon-btn { background: none; border: none; color: #8A97A6; cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0 2px; }
.nutrition-icon-btn:hover { color: #FCA5A5; }
.nutrition-slot-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.nutrition-slot-actions .btn { padding: 4px 8px; font-size: 0.75rem; }
.nutrition-add { border: 1px solid #1E3A5F; background: #131A22; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.nutrition-add.hidden { display: none; }
.nutrition-add-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.nutrition-add-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.nutrition-add-buttons .btn { padding: 6px 10px; font-size: 0.8rem; }
.nutrition-add-buttons .select-input { width: auto; flex: 1 1 160px; padding: 6px 8px; font-size: 0.8rem; }
.nutrition-add-status { font-size: 0.78rem; color: #C2CCD6; min-height: 1em; margin-bottom: 4px; }
.nutrition-items-table input { width: 100%; min-width: 48px; padding: 4px 6px; border: 1px solid #2A3644; border-radius: 4px; font-size: 0.8rem; }
.nutrition-items-table td:first-child input { min-width: 120px; }
.nutrition-add-footer { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; font-size: 0.8rem; }
.nutrition-add-total { color: #D5DDE5; font-weight: 600; }
.nutrition-checkbox { display: inline-flex; gap: 6px; align-items: center; margin-right: auto; }
.nutrition-drinks, .nutrition-presets { border-top: 1px solid #1F2833; padding-top: 8px; margin-top: 8px; font-size: 0.85rem; }
.nutrition-drinks-header { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.nutrition-drinks-hint { margin: 4px 0 6px; font-size: 0.8rem; color: var(--text-muted); }
.nutrition-muted-inline { color: #A9B4C0; font-size: 0.78rem; }
.nutrition-drink-buttons, .nutrition-preset-list, .nutrition-drink-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.nutrition-chip { display: inline-flex; gap: 4px; align-items: center; border: 1px solid #2A3644; background: #131A22; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; cursor: pointer; color: #E8EDF2; }
.nutrition-chip:hover { border-color: #2DD4BF; }
.nutrition-chip.static { cursor: default; background: #17202A; }
@media (max-width: 900px) {
  .nutrition-row-3, .nutrition-row-3.nutrition-row-2 { grid-template-columns: 1fr; }
  .nutrition-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .nutrition-slots { grid-template-columns: 1fr; }
}

/* Header and navigation wrap instead of overflowing on narrow screens:
   the range buttons and the seven tabs are wider than a phone. */
.hub-header, .hub-navbar { flex-wrap: wrap; gap: 8px; }
.hub-range-controls { flex-wrap: wrap; }
.nav-tabs-left { flex-wrap: wrap; }
@media (max-width: 768px) {
  .hub-header { padding: 10px 12px; }
  .hub-title-group h1 { font-size: 1.15rem; }
  .hub-range-controls { gap: 4px; width: 100%; }
  .range-label { width: 100%; margin-bottom: 2px; }
  .btn-range { padding: 3px 7px; font-size: 0.75rem; }
  .hub-navbar { padding: 6px 8px; }
  .nav-tabs-left { gap: 4px; width: 100%; }
  .nav-tab-btn { padding: 6px 9px; font-size: 0.78rem; gap: 4px; }
  .nav-tabs-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .user-tag { overflow-wrap: anywhere; min-width: 0; }
}

/* Info buttons on data cards (same popover as the charts) */
.has-info { position: relative; }
.has-info > .card-info-btn { position: absolute; top: 12px; right: 12px; z-index: 20; }
.has-info > h3, .has-info > h4, .has-info > .str-card-head, .has-info .nutrition-diary-header { padding-right: 32px; }
.cards-row-4 .summary-card.has-info { overflow: visible !important; }
.cards-row-4 .summary-card.has-info h3 { padding-right: 28px; }
.has-info .chart-info-popover { top: 44px; right: 12px; }
.chart-info-popover { max-height: min(70vh, 560px); overflow-y: auto; }
.chart-info-guidance ul { margin: 6px 0 6px 16px; padding: 0; }
.chart-info-guidance li { margin: 4px 0; line-height: 1.45; }
.chart-info-source { border-top: 1px dashed #1F2833; padding-top: 8px; }
.chart-info-source strong { color: #E8EDF2; }
.chart-info-source ul { margin: 4px 0 0 16px; padding: 0; }
.chart-info-source li { margin: 2px 0; }

/* --- Health sub-pages: Sleep, Stress, Recovery (static/health_pages.js) --- */
.hp-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
@media (max-width: 900px) { .hp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hp-value-sm { font-size: 1.35rem; }
.hp-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 12px; line-height: 1.4; }
.hp-signals { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.hp-signal { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); border-left-width: 4px; }
.hp-signal-name { font-size: 0.8rem; color: var(--text-muted); }
.hp-signal-value { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.hp-signal-base, .hp-signal-trend { font-size: 0.78rem; color: var(--text-muted); }
.hp-trend-better { border-left-color: #10B981; }
.hp-trend-better .hp-signal-trend { color: #34D399; }
.hp-trend-worse { border-left-color: #EF4444; }
.hp-trend-worse .hp-signal-trend { color: #F87171; }
.hp-trend-normal { border-left-color: #3A4756; }
.hp-trend-none { border-left-color: #1F2833; }
.hp-flags { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.85rem; color: #F5C76A; }
.hp-flags li { padding: 2px 0; }

/* --- Data source categories (GAR-3) --- */
.ds-categories { border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 10px 12px; margin: 12px 0 6px; }
.ds-categories legend { font-size: 0.85rem; font-weight: 700; color: var(--text-main); padding: 0 4px; }
.ds-cat-help { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 8px; line-height: 1.4; }
.ds-cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.ds-cat { display: flex; align-items: flex-start; gap: 7px; font-size: 0.84rem; color: var(--text-main); cursor: pointer; line-height: 1.35; }
.ds-cat input { width: auto; margin-top: 2px; }
.ds-cat.required { color: var(--text-muted); cursor: default; }
.ds-cat em { font-style: normal; font-size: 0.75rem; }
.ds-cat-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ds-cat-updated { font-size: 0.75rem; color: var(--text-muted); }
.ds-cat-single { font-size: 0.8rem; color: var(--text-muted); margin: 10px 0 4px; }

/* --- Training dropdown: current page in the menu --- */
.nav-dropdown-menu .dropdown-item.active { color: var(--primary); font-weight: 700; background: #16233A; }

/* --- Strength training page (static/strength.js) --- */
.str-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px; }
@media (max-width: 900px) { .str-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.str-stat-card { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.str-stat-card:hover, .str-stat-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.15); }
.str-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.str-card-head h3, .str-card-head h4 { margin-bottom: 0; }
.str-hint { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.str-close-btn { position: absolute; top: 10px; right: 14px; }
.str-select { max-width: 260px; font-size: 0.82rem; padding: 4px 8px; }

.str-seg { display: inline-flex; background: #17202A; border-radius: 8px; padding: 2px; }
.str-seg-btn { border: none; background: transparent; padding: 5px 12px; font-size: 0.8rem; border-radius: 6px; cursor: pointer; color: var(--text-muted); }
.str-seg-btn.active { background: #131A22; color: var(--text-main); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

.str-muscle-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 10px; }
@media (max-width: 900px) { .str-muscle-grid { grid-template-columns: 1fr; } }
.str-bodies { display: flex; justify-content: center; gap: 10px; }
.str-body { margin: 0; text-align: center; flex: 1; max-width: 190px; }
.str-body figcaption { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.str-body-svg { width: 100%; height: auto; display: block; }
.str-body-svg polygon[data-muscle] { cursor: default; }
.str-muscle-bars { display: flex; flex-direction: column; gap: 10px; }
.str-bar-row, .str-split-row { display: flex; flex-direction: column; gap: 4px; }
.str-split-row { margin-bottom: 10px; }
.str-bar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; }
.str-bar-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-bar-value { color: var(--text-muted); white-space: nowrap; }
.str-bar-track { display: flex; height: 7px; background: #17202A; border-radius: 4px; overflow: hidden; }
.str-bar-fill { height: 100%; }
.str-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.str-bar-legend { display: flex; gap: 14px; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.str-legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #2DD4BF; margin-right: 5px; vertical-align: middle; }
.str-legend-swatch.light { background: #115E59; }

.str-calendar { overflow-x: auto; padding-bottom: 4px; }
.str-cal-grid { display: flex; gap: 3px; min-width: max-content; }
.str-cal-col { display: flex; flex-direction: column; gap: 3px; }
.str-cal-cell { width: 12px; height: 12px; border-radius: 3px; background: #17202A; display: inline-block; }
.str-cal-cell.lvl1 { background: #115E59; }
.str-cal-cell.lvl2 { background: #2DD4BF; }
.str-cal-cell.future { background: transparent; }
.str-calendar-legend { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }
.str-calendar-legend span:first-child { margin-right: 4px; }
.str-calendar-legend span:last-child { margin-left: 4px; }

.str-week-details { margin-top: 10px; font-size: 0.85rem; }
.str-week-head { font-weight: 700; margin-bottom: 6px; color: var(--text-main); }
.str-week-row { padding: 4px 0; border-bottom: 1px solid var(--border-color); }

.str-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 4px; border: none; border-bottom: 1px solid var(--border-color); background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.str-list-row:hover { background: #131A22; }
.str-list-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.str-list-main strong { font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-spark { width: 60px; height: 20px; flex-shrink: 0; }
.str-recent { max-height: 520px; overflow-y: auto; }
.str-workout.open .dropdown-caret { transform: rotate(180deg); }
.str-workout-details { padding: 6px 8px 10px; background: #131A22; border-bottom: 1px solid var(--border-color); }
.str-ex { padding: 5px 0; }
.str-ex-title { font-size: 0.84rem; font-weight: 600; margin-bottom: 3px; }
.str-ex-sets { display: flex; flex-wrap: wrap; gap: 4px; }
.str-set { font-size: 0.76rem; background: #131A22; border: 1px solid var(--border-color); border-radius: 10px; padding: 1px 8px; color: #D5DDE5; }

/* Subnavigation for Strength tab */
.str-subnav { display: flex; gap: 10px; margin-bottom: 18px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.str-subnav-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.str-subnav-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Program cards */
.str-programs-list { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.str-program-card { background: #131A22; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.str-program-card:hover { box-shadow: var(--shadow-md); }
.str-program-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.str-program-title-area { display: flex; flex-direction: column; gap: 4px; }
.str-program-title-area h3 { margin: 0; font-size: 1.15rem; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.str-program-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.str-badge { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.str-badge-goal { background: #16233A; color: #93C5FD; border: 1px solid #1E3A5F; }
.str-badge-days { background: #10302C; color: #6EE7B7; border: 1px solid #1B4A48; }
.str-badge-synced { background: #2E2414; color: #F5C76A; border: 1px solid #4A3A1A; }
.str-badge-muscle { background: #17202A; color: #D5DDE5; }
.str-badge-equip { background: #241D3A; color: #C4B5FD; border: 1px solid #3B3160; }
.str-program-actions { display: flex; gap: 6px; align-items: center; }

.str-program-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.str-routine-day-card { background: #131A22; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 12px; }
.str-routine-day-card h4 { margin: 0 0 8px 0; font-size: 0.95rem; color: var(--text-main); border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.str-routine-ex-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.str-routine-ex-item { font-size: 0.84rem; display: flex; justify-content: space-between; align-items: center; background: #131A22; border: 1px solid var(--border-color); border-radius: 6px; padding: 6px 10px; }

/* Exercise Bank Grid */
.str-ex-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.str-filter-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.str-pill-btn { border: 1px solid var(--border-color); background: #131A22; color: var(--text-muted); padding: 4px 12px; border-radius: 16px; font-size: 0.8rem; cursor: pointer; transition: all 0.15s ease; }
.str-pill-btn:hover { background: #17202A; color: var(--text-main); }
.str-pill-btn.active { background: #0F766E; color: #FFFFFF; border-color: #2DD4BF; font-weight: 600; }
.str-ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.str-exercise-card { background: #131A22; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; cursor: pointer; transition: all 0.15s ease; display: flex; flex-direction: column; justify-content: space-between; }
.str-exercise-card:hover { border-color: #2DD4BF; box-shadow: 0 4px 12px rgba(45, 212, 191, 0.12); transform: translateY(-2px); }
.str-exercise-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.str-exercise-card-head h4 { margin: 0; font-size: 0.95rem; color: var(--text-main); font-weight: 600; }
.str-exercise-card-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; margin: 6px 0 10px; flex-grow: 1; }
.str-exercise-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-muted); border-top: 1px solid #1F2833; padding-top: 8px; }

/* Large modal dialogs */
.modal-card-lg { max-width: 720px; width: 95%; max-height: 90vh; overflow-y: auto; }
.str-builder-day { background: #131A22; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; margin-bottom: 14px; }
.str-builder-day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.str-builder-ex-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 30px; gap: 8px; align-items: center; margin-bottom: 6px; background: #131A22; border: 1px solid var(--border-color); border-radius: 6px; padding: 6px 8px; }
@media (max-width: 600px) { .str-builder-ex-row { grid-template-columns: 1fr 1fr; } }


/* GAR-5: intensity minutes and the watch's performance figures on the Training page */
.train-garmin-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 15px;
}
.train-garmin-row.hidden { display: none; }
@media (max-width: 1024px) {
  .train-garmin-row { grid-template-columns: 1fr; }
}
.im-progress {
  height: 8px;
  border-radius: 4px;
  background: #1F2833;
  overflow: hidden;
  margin: 6px 0 4px;
}
.im-progress-bar {
  height: 100%;
  width: 0;
  background: #F59E0B;
  transition: width 0.3s ease;
}
.im-progress-bar.met { background: #10B981; }
.im-chart { height: 120px; margin-top: 8px; }
.train-perf-list { font-size: 0.88rem; color: #D5DDE5; line-height: 1.5; }
.train-perf-list .perf-group { margin-top: 8px; }
.train-perf-list .perf-group:first-child { margin-top: 2px; }
.train-perf-list .perf-label { font-weight: 600; color: #E8EDF2; }
.train-perf-list .perf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.train-perf-list .perf-cell { background: #17202A; border-radius: 6px; padding: 4px 6px; text-align: center; }
.train-perf-list .perf-cell b { display: block; font-size: 0.95rem; color: #E8EDF2; }
.train-perf-list .perf-change.better { color: #10B981; }
.train-perf-list .perf-change.worse { color: #EF4444; }
.source-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  background: #16233A;
  color: #93C5FD;
}

/* Charts whose data the user has never synced are hidden - createChart. */
.chart-empty-hidden { display: none !important; }

/* --- Löpning and Cykel pages (static/sport.js) --- */
.sport-empty-text { font-size: 0.9rem; color: #C2CCD6; line-height: 1.5; }
.sport-records { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.sport-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px solid #1F2833; padding: 4px 0; }
.sport-row:last-child { border-bottom: none; }
.sport-row-label { color: #D5DDE5; }
.sport-row-value { font-weight: 700; color: #E8EDF2; white-space: nowrap; }
.sport-row-meta { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.sport-trend-up { color: #10B981; }
.sport-trend-down { color: #EF4444; }

/* Records and best sessions: list boxes as tall as a chart (canvas 240px), scrolling if longer. */
.sport-list { height: 240px; overflow-y: auto; padding-right: 4px; }
/* The watch's performance figures on the Löpning page, above the charts. */
.sport-perf-card { margin-bottom: 15px; }
.sport-perf-card.hidden { display: none; }

/* Meal photo in the "add meal" panel */
.nutrition-photo-preview { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.nutrition-photo-preview.hidden { display: none; }
.nutrition-photo-preview img { max-width: 160px; max-height: 120px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-color); }
.nutrition-photo-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; margin: 0; }

/* --- Detailed Workout Modal (Passdetaljer) --- */
.clickable-activity-row,
.clickable-sport-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-activity-row:hover,
.clickable-sport-row:hover {
  background-color: rgba(45, 212, 191, 0.08) !important;
}

.clickable-activity-row:focus-visible,
.clickable-sport-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.activity-modal-card {
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.activity-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #131A22;
}

.activity-modal-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.activity-modal-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 12px;
  background: rgba(45, 212, 191, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-modal-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.activity-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.activity-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.activity-modal-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* --- AI Workout Analysis & Improvement Tips Card --- */
.activity-modal-ai-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .activity-modal-ai-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.act-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.act-ai-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-ai-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3B82F6, #10B981);
  color: #FFFFFF;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.act-ai-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.act-ai-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.act-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-md, 8px);
  background: linear-gradient(135deg, #2563EB, #059669);
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.act-ai-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.act-ai-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.act-ai-btn.spinning .act-ai-btn-icon {
  display: inline-block;
  animation: spin 1s infinite linear;
}

.act-ai-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-main);
}

.act-ai-placeholder {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-md, 8px);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  color: var(--text-muted);
  font-size: 0.84rem;
}

[data-theme="dark"] .act-ai-placeholder {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(56, 189, 248, 0.3);
}

.act-ai-placeholder p {
  margin: 0;
}

.act-ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-style: italic;
}

.act-ai-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md, 8px);
  color: #EF4444;
  font-size: 0.84rem;
}

.act-ai-result {
  background: rgba(15, 23, 42, 0.75);
  border-radius: var(--radius-md, 8px);
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
  line-height: 1.6;
}

[data-theme="dark"] .act-ai-result {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
}

.act-ai-result strong {
  color: #38BDF8;
  font-weight: 600;
}

[data-theme="dark"] .act-ai-result strong {
  color: #38BDF8;
}

.act-ai-result em {
  color: var(--text-muted);
}

.act-ai-result h3,
.act-ai-result h4,
.act-ai-result .chat-section-header {
  margin: 12px 0 6px 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.act-ai-result h3:first-child,
.act-ai-result h4:first-child {
  margin-top: 0;
}

.act-ai-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .act-ai-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.act-ai-footer .btn {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
}

/* General Health AI Advice Cards & Formatting */
.gh-advice-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gh-advice-card {
  background: rgba(23, 34, 48, 0.75);
  border: 1px solid #2B3A4C;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.gh-advice-card:hover {
  border-color: #3B4D63;
}

.gh-advice-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.gh-advice-card-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.gh-advice-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #F8FAFC;
}

.gh-advice-card-body {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.7;
  color: #CBD5E1;
}

.gh-advice-focus-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 6px;
  padding: 12px 14px;
}

.gh-advice-step-badge {
  background: #FBBF24;
  color: #0F172A;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.gh-advice-disclaimer {
  margin-top: 6px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.activity-modal-photos {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
  scroll-behavior: smooth;
}

.activity-modal-photos::-webkit-scrollbar {
  height: 6px;
}

.activity-modal-photos::-webkit-scrollbar-thumb {
  background: #2A3644;
  border-radius: 3px;
}

.activity-modal-photo-img {
  width: 140px;
  height: 95px;
  min-width: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.activity-modal-photo-img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.act-ai-toggle-btn {
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #2DD4BF;
  transition: all 0.2s ease;
}

.act-ai-toggle-btn:hover,
.act-ai-toggle-btn.active {
  background: rgba(45, 212, 191, 0.2);
  border-color: #2DD4BF;
  color: #fff;
}

.act-hero-photo-wrap {
  position: relative;
  width: 100%;
  max-height: min(480px, 48vh);
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
  background: rgba(11, 15, 20, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.act-hero-photo {
  width: 100%;
  height: auto;
  max-height: min(480px, 48vh);
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.act-hero-photo:hover {
  transform: scale(1.01);
}

.act-photo-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(252, 82, 0, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.act-photo-gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
}

.act-photo-thumb-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  display: inline-block;
}

.act-photo-thumb {
  width: 80px;
  height: 80px;
  min-width: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.act-photo-thumb:hover,
.act-photo-thumb-link:hover .act-photo-thumb {
  transform: translateY(-2px);
  border-color: #FC5200;
}

.act-photo-thumb-link.active .act-photo-thumb {
  border-color: #FC5200;
  box-shadow: 0 0 8px rgba(252, 82, 0, 0.6);
}

.activity-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px;
  border-top: 1px solid var(--border-color);
  background: #131A22;
}

.activity-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 10px;
}

.activity-metric-box {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.activity-metric-box:hover {
  border-color: #2A3644;
}

.activity-metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.activity-metric-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 3px;
  line-height: 1.2;
}

.activity-metric-unit {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

.activity-section {
  border-top: 1px solid #1F2833;
  padding-top: 14px;
}

.activity-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Laps & Splits table */
.activity-splits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.activity-splits-table th {
  background: #17202A;
  color: var(--text-muted);
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
}

.activity-splits-table td {
  padding: 6px 10px;
  border-top: 1px solid #1F2833;
  color: var(--text-main);
}

.activity-splits-table tr:hover td {
  background: #131A22;
}

/* HR zones horizontal bar */
.activity-zones-bar {
  display: flex;
  height: 14px;
  border-radius: 9999px;
  overflow: hidden;
  background: #1F2833;
  margin-bottom: 8px;
}

.activity-zone-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.activity-zones-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.activity-zone-tag {
  display: flex;
  align-items: center;
  gap: 5px;
}

.activity-zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Training effect chips */
.activity-te-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.activity-te-card {
  flex: 1;
  min-width: 130px;
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.activity-te-val {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
}

.activity-te-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Weather & location widget */
.activity-weather-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #16233A;
  border: 1px solid #1E3A5F;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #0369A1;
  font-size: 0.88rem;
}

.activity-weather-icon {
  font-size: 1.6rem;
}

/* Exercise sets list */
.activity-sets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.activity-set-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

/* Modal loader */
.activity-modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid #1F2833;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- AI coach memory & feedback --- */
.coach-notes-list,
.coach-suggest-list { display: flex; flex-direction: column; gap: 8px; }
.coach-note-row,
.coach-suggest-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.coach-note-text { flex: 1; color: #E8EDF2; line-height: 1.35; }
.coach-suggest-text { flex: 1; min-width: 0; }
.coach-kind {
  flex-shrink: 0; padding: 2px 8px; border-radius: 9999px;
  background: #10302C; color: #6EE7B7; font-size: 0.72rem; font-weight: 600;
}
.coach-note-add { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.coach-note-add #coach-note-input { flex: 1; min-width: 180px; }
.coach-status { font-size: 0.8rem; color: #C2CCD6; margin-top: 6px; min-height: 1em; }
.activity-feedback-card {
  margin: 12px 0; padding: 12px; border: 1px solid #1F2833; border-radius: 10px; background: #131A22;
}
.act-feedback-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.act-feedback-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.act-feedback-row #act-rpe-comment { flex: 1; min-width: 160px; }
.act-feedback-pain { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 0.85rem; color: #A9B4C0; cursor: pointer; }
.ai-feedback { display: flex; gap: 6px; margin-top: 6px; font-size: 0.78rem; color: #A9B4C0; align-items: center; }
.ai-feedback-btn {
  border: none; background: transparent; cursor: pointer; font-size: 1rem; padding: 2px 4px; border-radius: 6px;
}
.ai-feedback-btn:hover { background: #17202A; }

/* --- Date of birth (LEG-14) --- */
.birth-date-row { display: flex; gap: 6px; }
.birth-date-row select { flex: 1; min-width: 0; }
.field-note { font-size: 0.75rem; color: #A9B4C0; margin: 4px 0 0; line-height: 1.35; }

/* --- Strength Programs, Exercise Library & Modals --- */
.str-subnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: #131A22;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.str-subnav-buttons,
.str-subnav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.str-subnav .btn.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

/* --- Profile Subnavigation & Subtabs --- */
.prof-subnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  background: #131A22;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.prof-subnav-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.prof-subnav .btn {
  font-size: 0.84rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.prof-subnav .btn.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.profile-subtab-view {
  animation: fadeIn 0.15s ease-in-out;
}

.profile-subtab-header {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-subtab-header h4 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 600;
}

.profile-subtab-header p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}


.str-programs-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.str-prog-card {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.str-prog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.str-prog-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.str-prog-card-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.str-ex-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.str-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.str-pill-btn {
  background: #17202A;
  border: 1px solid transparent;
  color: #C2CCD6;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.str-pill-btn:hover {
  background: #1F2833;
  color: #E8EDF2;
}

.str-pill-btn.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.str-ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.str-exercise-card {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

.str-exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #93C5FD;
}

.str-exercise-thumb-wrap {
  width: 100%;
  height: 140px;
  background: #131A22;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.str-exercise-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.str-exercise-card:hover .str-exercise-thumb-wrap img {
  transform: scale(1.04);
}

.str-exercise-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.str-exercise-card-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.str-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: capitalize;
}

.str-badge-muscle {
  background: #16233A;
  color: #93C5FD;
}

.str-badge-equip {
  background: #2E2414;
  color: #F5C76A;
}

.str-badge-level {
  background: #241D3A;
  color: #D8B4FE;
}

.str-exercise-card-desc {
  font-size: 0.8rem;
  color: #A9B4C0;
  margin: 6px 0 10px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.str-exercise-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: #8A97A6;
  border-top: 1px solid #1F2833;
  padding-top: 8px;
}

.str-modal-images-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.str-modal-img-box {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.str-modal-img-box img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.str-modal-img-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #A9B4C0;
  padding: 4px 8px;
  text-align: center;
  background: #131A22;
  width: 100%;
  border-top: 1px solid var(--border-color);
}

.str-steps-list {
  padding-left: 20px;
  margin: 6px 0 0 0;
  font-size: 0.86rem;
  color: #D5DDE5;
  line-height: 1.5;
}

.str-steps-list li {
  margin-bottom: 6px;
}

.str-builder-day {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.str-builder-day-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.str-builder-ex-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

@media (max-width: 640px) {
  .str-modal-images-row {
    grid-template-columns: 1fr;
  }
  .str-builder-ex-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Strength Tools, Barbell Visualizer & Recovery Suite (STR-1 - STR-8) --- */

/* Tabs inside Gym Tools Modal */
.str-tools-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.str-tools-nav-btn {
  background: #17202A;
  border: 1px solid transparent;
  color: #C2CCD6;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.str-tools-nav-btn:hover {
  background: #1F2833;
  color: #E8EDF2;
}

.str-tools-nav-btn.active {
  background: var(--primary);
  color: var(--primary-ink);
}

/* Barbell Visualizer (STR-1) */
.str-barbell-display {
  background: #243040;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.str-barbell-graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  position: relative;
  overflow-x: auto;
}

.str-bar-shaft {
  height: 14px;
  width: 120px;
  background: linear-gradient(180deg, #1F2833, #94A3B8, #64748B);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.str-bar-collar {
  width: 16px;
  height: 48px;
  background: linear-gradient(180deg, #2A3644, #64748B);
  border-radius: 3px;
  flex-shrink: 0;
}

.str-bar-sleeve {
  height: 22px;
  background: #475569;
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 3px;
  border-radius: 2px;
  min-width: 90px;
}

.str-bar-sleeve.sleeve-left {
  justify-content: flex-end;
}

.str-bar-sleeve.sleeve-right {
  justify-content: flex-start;
}

/* Color-coded Olympic plates */
.str-plate-disc {
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1;
  user-select: none;
  color: #FFFFFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

.plate-25 { width: 14px; height: 95px; background: #DC2626; }
.plate-20 { width: 13px; height: 90px; background: #2563EB; }
.plate-15 { width: 12px; height: 80px; background: #EAB308; color: #E8EDF2; }
.plate-10 { width: 11px; height: 70px; background: #16A34A; }
.plate-5  { width: 10px; height: 55px; background: #131A22; color: #E8EDF2; }
.plate-2_5 { width: 9px; height: 42px; background: #243040; }
.plate-1_25 { width: 8px; height: 34px; background: #94A3B8; }

.str-plate-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* 1RM & Warmup Tables (STR-2, STR-3) */
.str-calc-badge {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
}

.str-calc-sub {
  font-size: 0.8rem;
  color: #A9B4C0;
  text-align: center;
  margin-top: -4px;
  margin-bottom: 12px;
}

.str-table-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.str-table-mini th {
  background: #131A22;
  padding: 6px 10px;
  font-weight: 600;
  color: #C2CCD6;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.str-table-mini td {
  padding: 6px 10px;
  border-bottom: 1px solid #1F2833;
  color: #E8EDF2;
}

/* Muscle Recovery Status (STR-6) */
.str-recovery-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.str-rec-recovered {
  background: #10302C;
  color: #4ADE80;
  border: 1px solid #1B4A48;
}

.str-rec-recovering {
  background: #2E2414;
  color: #F5C76A;
  border: 1px solid #4A3A1A;
}

.str-rec-detraining {
  background: #17202A;
  color: #A9B4C0;
  border: 1px solid #2A3644;
}

.str-rec-progress {
  height: 6px;
  background: #1F2833;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 4px;
}

.str-rec-bar {
  height: 100%;
  transition: width 0.3s ease;
}

/* Program Templates Modal (STR-5) */
.str-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.str-tpl-card {
  background: #131A22;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}

.str-tpl-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* CSV Drag-and-Drop Area (STR-8) */
.str-csv-dropzone {
  border: 2px dashed #3A4756;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: #131A22;
  cursor: pointer;
  transition: all 0.2s ease;
}

.str-csv-dropzone:hover,
.str-csv-dropzone.dragover {
  border-color: var(--primary);
  background: #16233A;
}

/* Superset & Set Type Badges (STR-7) */
.str-superset-badge {
  background: #241D3A;
  color: #D8B4FE;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  border: 1px solid #D8B4FE;
}

.str-set-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.str-set-warmup { background: #2E2414; color: #F5C76A; }
.str-set-dropset { background: #1C2140; color: #A5B4FC; }
.str-set-failure { background: #3A1A1D; color: #FCA5A5; }

/* AI Onboarding Wizard (ONB-1 through ONB-7) */
.modal-card-onboarding {
  width: 95%;
  max-width: 680px;
  max-height: 90vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  animation: modalFadeIn 0.25s ease-out;
}

.onb-step-pill {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #E0E7FF;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
}

.onb-step-pill.active {
  background: #131A22;
  color: #93C5FD;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.onb-step-pill.completed {
  background: rgba(16, 185, 129, 0.35);
  color: #ECFDF5;
}

.onb-chat-bubble-coach {
  align-self: flex-start;
  background: #131A22;
  border: 1px solid #1F2833;
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #E8EDF2;
  max-width: 85%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.onb-chat-bubble-user {
  align-self: flex-end;
  background: #2563EB;
  border-radius: 12px 12px 2px 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #FFFFFF;
  max-width: 85%;
}

.onb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1C2140;
  color: #A5B4FC;
  border: 1px solid #2E3560;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
}

.onb-summary-item {
  background: #131A22;
  border: 1px solid #1F2833;
  border-radius: 6px;
  padding: 8px 12px;
}

.onb-summary-label {
  font-size: 0.75rem;
  color: #A9B4C0;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.onb-summary-val {
  font-weight: 600;
  color: #E8EDF2;
}

.onboarding-callout-banner {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.onboarding-callout-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -2px rgba(30, 58, 138, 0.25);
}

/* --- GAIT & BIOMECHANICS STYLES --- */
.gait-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 35px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.25s ease;
  cursor: pointer;
}

.gait-dropzone:hover,
.gait-dropzone.dragover {
  border-color: var(--accent, #10B981);
  background: rgba(16, 185, 129, 0.05);
}

.gait-dropzone.has-file {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.03);
}

.gait-status-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.gait-status-box.status-loading {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93C5FD;
}

.gait-status-box.status-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}

.gait-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent, #10B981);
  border-radius: 50%;
  animation: gait-spin 0.8s linear infinite;
}

@keyframes gait-spin {
  to { transform: rotate(360deg); }
}

.gait-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gait-badge.badge-green {
  background: rgba(16, 185, 129, 0.18);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.gait-badge.badge-blue {
  background: rgba(59, 130, 246, 0.18);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.gait-badge.badge-amber {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.gait-badge.badge-red {
  background: rgba(239, 68, 68, 0.18);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.gait-keyframe-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gait-keyframe-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.4);
}

.gait-keyframe-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.gait-keyframe-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gait-keyframe-img:hover {
  transform: scale(1.03);
}

.gait-keyframe-meta {
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #6F7D8C;
}

.gait-ai-advice-prose {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #D5DDE5;
}

.gait-ai-advice-prose p {
  margin: 0 0 12px 0;
}

.gait-ai-advice-prose p:last-child {
  margin-bottom: 0;
}

.gait-deterministic-advice h4 {
  margin: 12px 0 6px 0;
  font-size: 0.95rem;
  color: #8A97A6;
}

.gait-deterministic-advice ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #6F7D8C;
}

/* --- WORKOUT CALENDAR (Overview Page) --- */
.calendar-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-main);
  margin-bottom: 25px;
  transition: all 0.2s ease;
}

.calendar-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.calendar-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.calendar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #17202A;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calendar-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-month-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 140px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cal-filter-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #131A22;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-filter-chip:hover {
  background: #17202A;
  color: var(--text-main);
  border-color: #2A3644;
}

.cal-filter-chip.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(45, 212, 191, 0.25);
}

.calendar-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  text-align: center;
}

.cal-weekday-col {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 0;
  letter-spacing: 0.5px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cal-day-cell {
  min-height: 110px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
  position: relative;
}

.cal-day-cell:hover {
  border-color: #3A4756;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.cal-day-cell.cal-other-month {
  background: #131A22;
  opacity: 0.45;
}

.cal-day-cell.cal-today {
  border: 2px solid var(--primary);
  background: rgba(45, 212, 191, 0.02);
}

.cal-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cal-day-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-today .cal-day-num {
  background: var(--primary);
  color: var(--primary-ink);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cal-day-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
}

.cal-day-acts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 120px;
}

.cal-act-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid #64748B;
  background: #17202A;
  color: var(--text-main);
  text-align: left;
}

.cal-act-chip:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.cal-act-chip.cal-cat-running {
  border-left-color: #EF4444;
  background: #3A1A1D;
  color: #FCA5A5;
}

.cal-act-chip.cal-cat-cycling {
  border-left-color: #0284C7;
  background: #16233A;
  color: #93C5FD;
}

.cal-act-chip.cal-cat-strength {
  border-left-color: #8B5CF6;
  background: #241D3A;
  color: #C4B5FD;
}

.cal-act-chip.cal-cat-walking {
  border-left-color: #10B981;
  background: #10302C;
  color: #6EE7B7;
}

.cal-act-chip.cal-cat-other {
  border-left-color: #F59E0B;
  background: #2E2414;
  color: #F5C76A;
}

.cal-act-chip.cal-suggested-chip {
  border: 1px dashed #2DD4BF;
  border-left: 3px solid #2DD4BF;
  background: rgba(45, 212, 191, 0.12);
  color: #5EEAD4;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.15);
}

.cal-act-chip.cal-suggested-chip:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: #5EEAD4;
  transform: translateY(-1px);
}

/* Sessions booked by the AI personal trainer: dashed outline in the sport's colour. */
.cal-act-chip.cal-planned-chip {
  border-style: dashed;
  border-width: 1px 1px 1px 3px;
  border-color: currentColor;
  background: transparent;
}

.cal-act-chip.cal-planned-missed {
  opacity: 0.55;
  text-decoration: line-through;
}

/* Steps of a booked session in the workout modal */
.pt-steps-heading {
  font-size: 11.5px;
  font-weight: 600;
  color: #5EEAD4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.pt-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-step {
  border-left: 3px solid #475569;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.pt-step-warmup, .pt-step-cooldown { border-left-color: #3B82F6; }
.pt-step-main { border-left-color: #10B981; }
.pt-step-interval { border-left-color: #EF4444; }
.pt-step-exercise { border-left-color: #8B5CF6; }

.pt-step-note {
  border-left-color: #F59E0B;
  font-size: 12.5px;
  color: #FCD34D;
}

.pt-step-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.pt-step-facts {
  font-size: 12.5px;
  color: #99F6E4;
  margin-top: 2px;
}

.pt-step-cue {
  font-size: 12.5px;
  color: #CBD5E1;
  margin-top: 2px;
  line-height: 1.45;
}

.pt-step-more {
  margin-top: 6px;
  font-size: 12.5px;
  color: #CBD5E1;
}

.pt-step-more summary {
  cursor: pointer;
  color: #5EEAD4;
  font-weight: 600;
}

.pt-how {
  margin: 6px 0 4px 18px;
  padding: 0;
  line-height: 1.45;
}

.pt-more-row {
  margin-top: 3px;
  line-height: 1.45;
}

/* The AI trainer's strength programme on the Strength -> Workout Programs page */
.pt-program {
  border-color: rgba(45, 212, 191, 0.4);
  margin-bottom: 16px;
}

.pt-program-badge {
  background: #0D9488;
  color: #FFFFFF;
}

.pt-program-note {
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: #FCD34D;
}

.pt-program-upcoming h4,
.pt-program-card h4 {
  margin: 12px 0 8px;
  font-size: 0.95rem;
}

/* PT-50: Rules and evidence basis in workout modal */
.pt-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.pt-rule-item {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid #3B82F6;
  border-radius: 4px 8px 8px 4px;
  padding: 8px 12px;
}
.pt-rule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pt-rule-id {
  font-size: 13px;
  font-weight: 700;
  color: #93C5FD;
  font-family: monospace;
}
.pt-rule-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(59, 130, 246, 0.2);
  color: #93C5FD;
}
.pt-rule-badge-stark {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
}
.pt-rule-badge-måttlig, .pt-rule-badge-mattlig {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
}
.pt-rule-badge-praxis {
  background: rgba(139, 92, 246, 0.2);
  color: #C4B5FD;
}
.pt-rule-desc {
  font-size: 12.5px;
  color: #E5E7EB;
  line-height: 1.4;
}
.pt-rule-source {
  font-size: 11.5px;
  color: #9CA3AF;
  margin-top: 4px;
}


.pt-program-upcoming-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-program-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.cal-pt-tag {
  display: inline-block;
  padding: 1px 4px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid currentColor;
  border-radius: 3px;
  margin-right: 2px;
  vertical-align: middle;
}

.cal-ai-tag {
  display: inline-block;
  padding: 1px 4px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  background: #0D9488;
  color: #FFFFFF;
  border-radius: 3px;
  margin-right: 2px;
  vertical-align: middle;
}

.cal-today-highlight {
  animation: cal-pulse-highlight 2s ease-in-out;
}

@keyframes cal-pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
  50% { box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.4), 0 0 15px rgba(45, 212, 191, 0.3); }
}

.cal-act-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.cal-act-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.cal-act-meta {
  font-size: 0.7rem;
  opacity: 0.85;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .calendar-days-grid {
    gap: 4px;
  }
  .cal-day-cell {
    min-height: 90px;
    padding: 4px;
  }
  .cal-act-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  .calendar-weekdays-grid {
    font-size: 0.7rem;
  }
  .cal-day-cell {
    min-height: 75px;
    padding: 3px;
  }
  .cal-act-name {
    display: none;
  }
  .cal-act-chip {
    padding: 3px;
    justify-content: center;
  }
}

.clickable-metric {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.clickable-metric:hover {
  opacity: 0.8;
  transform: translateX(2px);
}

/* ==========================================================================
   Redesign A: dark precision theme (2026-10)
   Shell: sidebar (desktop) -> icon rail (tablets) -> bottom tab bar + "More"
   sheet (phones). The old top-bar markup is reused, so every page, menu item
   and action is still the same element with the same data-action.
   ========================================================================== */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/geist.woff2') format('woff2-variations'), url('/static/fonts/geist.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/geist-latin-ext.woff2') format('woff2-variations'), url('/static/fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/geist-mono.woff2') format('woff2-variations'), url('/static/fonts/geist-mono.woff2') format('woff2');
}

html { color-scheme: dark; }
/* form controls do not inherit the font by default */
button, input, select, textarea { font-family: inherit; }
body {
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
::selection { background: rgba(45, 212, 191, 0.3); }

/* --- Shell grid --------------------------------------------------------- */
.app-container:not(.hidden) {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "nav header" "nav main";
  max-width: none;
  padding: 0;
  min-height: 100vh;
}
.app-container > .hub-header { grid-area: header; }
.app-container > .hub-navbar { grid-area: nav; }
.app-container > .hub-main-content { grid-area: main; }

/* --- Header: date range (title only on phones) ------------------------- */
.hub-header {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 22px clamp(16px, 3vw, 40px) 8px;
  justify-content: flex-end;
  animation: hc-fade 0.5s ease-out both;
}
.hub-title-group { display: none; align-items: center; gap: 10px; }
.hub-title-group h1 { color: var(--text-main); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.hub-logo {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px; background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.hub-range-controls {
  gap: 2px; padding: 3px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px;
  max-width: 100%; overflow-x: auto; flex-wrap: nowrap;
}
.btn-range {
  background: transparent; border: 0; border-radius: 9px;
  min-height: 32px; padding: 0 12px;
  color: var(--text-dim); font-family: var(--font-family); font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}
.btn-range:hover { background: transparent; color: var(--text-main); }
.btn-range.active { background: #243040; color: var(--text-main); border-color: transparent; }

/* --- Sidebar ------------------------------------------------------------ */
.hub-navbar {
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  flex-wrap: nowrap; gap: 18px;
  padding: 22px 14px;
  margin: 0;
  background: #0E131A;
  border: 0; border-right: 1px solid var(--border-color); border-radius: 0;
  box-shadow: none;
  scrollbar-width: thin;
}
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.nav-brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--text-main); }
.hub-navbar .nav-tabs-left { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 14px; width: auto; }
.hub-navbar .nav-dropdown { display: flex; flex-direction: column; position: static; }

/* Group headings (accordion): the title on the left, a button on the right that opens the
   group (chevron down) and, once open, closes it again (chevron up). All groups start
   closed; navigation.js toggles nav-open on the group. */
.hub-navbar .nav-dropdown-toggle,
.hub-navbar .nav-dropdown-toggle:hover,
.hub-navbar .nav-dropdown-toggle.active {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 38px; padding: 0 6px 0 12px;
  background: transparent; border: 0; border-radius: 10px; box-shadow: none;
  color: #8A97A6; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  cursor: pointer;
}
.hub-navbar .nav-dropdown-toggle:hover { color: var(--text-main); }
/* the page that is open lives in this group */
.hub-navbar .nav-dropdown-toggle.active { color: #5EEAD4; }
.nav-group-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid #2A3644; background: #131A22; color: var(--text-dim);
  transition: transform 0.2s ease, background 0.18s, color 0.18s, border-color 0.18s;
}
.hub-navbar .nav-dropdown-toggle:hover .nav-group-btn { color: var(--text-main); border-color: #3A4756; }
.hub-navbar .nav-dropdown.nav-open .nav-group-btn { transform: rotate(180deg); background: #17202A; color: var(--primary); border-color: #1B4A48; }
.hub-navbar .nav-dropdown-menu,
.hub-navbar .nav-dropdown-menu.hidden { display: none !important; }
.hub-navbar .nav-dropdown.nav-open .nav-dropdown-menu { display: flex !important; animation: hc-fade 0.2s ease-out both; }
.hub-navbar .nav-dropdown-menu {
  flex-direction: column; gap: 2px;
  position: static; min-width: 0;
  background: transparent; border: 0; box-shadow: none;
  padding: 6px 0 0;
}
.hub-navbar .dropdown-item,
.hub-navbar .nav-single,
.hub-navbar .nav-logout {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  width: 100%; min-height: 40px; padding: 0 12px;
  background: transparent; border: 0; border-radius: 10px; box-shadow: none;
  color: var(--text-dim); font-family: var(--font-family); font-size: 14px; font-weight: 400;
  text-align: left; cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.hub-navbar .dropdown-item:hover,
.hub-navbar .nav-single:hover,
.hub-navbar .nav-logout:hover { background: #141C25; color: var(--text-main); }
.hub-navbar .nav-logout:hover { color: #FCA5A5; }
.hub-navbar .dropdown-item.active,
.hub-navbar .nav-single.active { background: #17202A; color: var(--text-main); font-weight: 500; border-color: transparent; }
.hub-navbar .dropdown-item.active .nav-ico,
.hub-navbar .nav-single.active .nav-ico { color: var(--primary); }
.nav-ico { flex: none; }

.hub-navbar .nav-tabs-right {
  margin-top: auto;
  flex-direction: column; align-items: stretch; gap: 10px;
  width: auto; flex-wrap: nowrap;
}
.nav-lang {
  display: flex; gap: 3px; padding: 3px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px;
}
.nav-lang .lang-btn {
  flex: 1; min-height: 34px;
  background: transparent; border: 0; border-radius: 9px;
  color: var(--text-dim); font-family: var(--font-family); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer; transition: background 0.18s, color 0.18s;
}
.nav-lang .lang-btn:hover { color: var(--text-main); }
.nav-lang .lang-btn.active { background: #243040; color: var(--text-main); }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 0 8px; min-width: 0; }
.nav-user .user-tag { font-size: 12px; font-weight: 500; color: #8A97A6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Content ------------------------------------------------------------ */
.hub-main-content {
  width: 100%; max-width: 1480px;
  padding: 12px clamp(16px, 3vw, 40px) 48px;
}

.summary-card,
.chart-card-box,
.table-card-box,
.calendar-card-box {
  border-radius: 14px;
  border-color: var(--border-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s;
}
.summary-card:hover,
.chart-card-box:hover,
.table-card-box:hover,
.calendar-card-box:hover { border-color: #2C3A49; }
@media (hover: hover) {
  .summary-card:hover { transform: translateY(-2px); }
}
.summary-value { letter-spacing: -0.02em; }

/* cards rise in, a few ms apart, each time a page is shown */
.content-tab:not(.hidden) .summary-card,
.content-tab:not(.hidden) .chart-card-box,
.content-tab:not(.hidden) .table-card-box,
.content-tab:not(.hidden) .calendar-card-box {
  animation: hc-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.content-tab:not(.hidden) :is(.summary-card, .chart-card-box, .table-card-box):nth-child(2) { animation-delay: 0.05s; }
.content-tab:not(.hidden) :is(.summary-card, .chart-card-box, .table-card-box):nth-child(3) { animation-delay: 0.1s; }
.content-tab:not(.hidden) :is(.summary-card, .chart-card-box, .table-card-box):nth-child(4) { animation-delay: 0.15s; }
.content-tab:not(.hidden) :is(.summary-card, .chart-card-box, .table-card-box):nth-child(n+5) { animation-delay: 0.2s; }

/* --- Buttons and inputs ------------------------------------------------- */
.btn { border-radius: 10px; transition: transform 0.12s, filter 0.2s, background 0.18s, color 0.18s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-secondary { background: #17202A; border-color: #2A3644; color: var(--text-main); }
.btn-secondary:hover { background: #1F2935; }
.tab-btn.active { color: var(--primary-ink); }

.input-group input,
.input-group textarea,
.select-input,
input[type="text"], input[type="number"], input[type="email"], input[type="password"],
input[type="date"], input[type="time"], input[type="search"], textarea, select {
  background-color: #0E131A;
  border-color: #2A3644;
  color: var(--text-main);
}
.input-group input:focus,
.input-group textarea:focus,
.select-input:focus,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.22);
  outline: none;
}
button:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.modal-overlay { background: rgba(5, 8, 12, 0.72); backdrop-filter: blur(4px); }
.modal-card { border: 1px solid #2A3644; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7); }

/* --- Floating coach (desktop) and phone tab bar ----------------------- */
.floating-chat-bubble { transition: transform 0.15s, filter 0.2s; top: auto !important; bottom: 24px; right: 24px !important; transform: none !important; }
.floating-chat-bubble:hover { filter: brightness(1.08); }
.floating-chat-panel { box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75); border-color: #2A3644; }

.mobile-tabbar, .mobile-nav-backdrop { display: none; }
.mtab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; padding: 0;
  background: transparent; border: 0;
  color: var(--text-dim); font-family: var(--font-family); font-size: 11px; font-weight: 500;
  cursor: pointer;
}
.mtab.active { color: #5EEAD4; }
#mtab-more .nav-ico { stroke-width: 3.2; }
.mtab-fab {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--primary); color: var(--primary-ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -8px rgba(45, 212, 191, 0.6);
  transition: transform 0.15s;
}
.mtab-coach:active .mtab-fab { transform: scale(0.94); }

/* --- Tablets: icon rail ------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1100px) {
  .app-container:not(.hidden) { grid-template-columns: 76px minmax(0, 1fr); }
  .hub-navbar { padding: 18px 10px; align-items: center; }
  .hub-navbar .nav-tabs-left, .hub-navbar .nav-tabs-right { align-items: center; }
  .hub-navbar .nav-dropdown-toggle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* the icon rail has no headings to click, so every group's icons are shown */
  .hub-navbar .nav-dropdown-menu,
  .hub-navbar .nav-dropdown-menu.hidden { display: flex !important; }
  .hub-navbar .nav-dropdown + .nav-dropdown,
  .hub-navbar .nav-dropdown-menu { border-top: 0; }
  .hub-navbar .nav-tabs-left { gap: 10px; }
  .hub-navbar .dropdown-item,
  .hub-navbar .nav-single,
  .hub-navbar .nav-logout { width: 48px; height: 44px; justify-content: center; padding: 0; }
  .hub-navbar .dropdown-item span,
  .hub-navbar .nav-single span,
  .hub-navbar .nav-logout span,
  .nav-brand-name,
  .nav-user .user-tag {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .nav-lang { flex-direction: column; width: 52px; }
  .nav-user { padding: 0; justify-content: center; }
}

/* --- Phones: bottom tab bar, the menu as a sheet ------------------------ */
@media (max-width: 767px) {
  .app-container:not(.hidden) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "header" "main";
  }
  .hub-header { padding: 16px 16px 6px; flex-direction: column; align-items: stretch; gap: 12px; }
  .hub-title-group { display: flex; }
  .hub-range-controls { width: 100%; }
  .btn-range { flex: 1; padding: 0 8px; }
  .hub-main-content { padding: 8px 16px calc(100px + env(safe-area-inset-bottom)); }

  .hub-navbar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    height: auto; max-height: 85vh;
    z-index: 1200;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid #2A3644; border-radius: 22px 22px 0 0;
    background: #121922;
    box-shadow: 0 -24px 60px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
  }
  body.mobile-nav-open .hub-navbar {
    transform: none; visibility: visible;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
  }
  .nav-brand { display: none; }
  .hub-navbar .nav-dropdown.nav-open .nav-dropdown-menu { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-navbar .nav-dropdown-toggle { min-height: 44px; }
  .hub-navbar .nav-tabs-left { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 8px; }
  .hub-navbar .nav-dropdown { grid-column: 1 / -1; }
  .hub-navbar .dropdown-item, .hub-navbar .nav-single { min-height: 46px; background: #17202A; }
  .hub-navbar .nav-tabs-right { margin-top: 6px; }
  body.mobile-nav-open .mobile-nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 1150;
    background: rgba(5, 8, 12, 0.6);
    animation: hc-fade 0.2s ease-out both;
  }
  body.mobile-nav-open { overflow: hidden; }

  .mobile-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    padding: 6px 4px calc(10px + env(safe-area-inset-bottom));
    background: rgba(14, 19, 26, 0.94);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
  }
  #floating-chat-bubble { display: none !important; }
  .floating-chat-panel { top: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 8px; right: 8px; z-index: 1120; }
}

/* Workout calendar, one-week mode on narrow screens: a list with one day per row */
.cal-day-weekday { font-size: 0.8rem; font-weight: 600; color: var(--text-main); text-transform: capitalize; margin-right: auto; }
.cal-week-mode .calendar-weekdays-grid { display: none; }
.cal-week-mode .calendar-month-name { text-transform: none; }
.cal-week-mode .calendar-days-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.cal-week-mode .cal-day-cell { min-height: 0; padding: 10px 12px; flex-direction: row; align-items: flex-start; gap: 12px; }
.cal-week-mode .cal-day-header { flex: 0 0 96px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cal-week-mode .cal-day-count { display: none; }
.cal-week-mode .cal-day-acts { flex: 1; min-width: 0; }
.cal-week-mode .cal-act-name { display: inline; }
.cal-week-mode .cal-act-meta { display: inline; }
.cal-week-mode .cal-act-chip { justify-content: flex-start; padding: 5px 8px; }

/* Feedback form (menu Other: report a bug / request a feature) */
.feedback-card { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; }
.feedback-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.feedback-title { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.015em; }
.feedback-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--text-dim); width: 44px; height: 44px; }
.feedback-x:hover { color: var(--text-main); }
.feedback-intro { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 16px; }
#form-feedback .input-group { margin-bottom: 12px; }
#form-feedback .input-group input, #form-feedback .input-group textarea, #form-feedback .select-input { width: 100%; }
#form-feedback textarea { resize: vertical; min-height: 0; }
.feedback-check { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-size: 0.88rem; color: var(--text-muted); cursor: pointer; }
.feedback-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.feedback-tech { margin-bottom: 10px; font-size: 0.82rem; color: var(--text-dim); }
.feedback-tech summary { cursor: pointer; }
.feedback-tech ul { margin: 6px 0 0 18px; word-break: break-word; }
.feedback-privacy { font-size: 0.78rem; color: #8A97A6; margin-bottom: 12px; }
.feedback-status { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #3A1A1D; color: #FCA5A5; font-size: 0.88rem; }
.feedback-status.feedback-ok { background: #10302C; color: #5EEAD4; }
.feedback-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.feedback-actions .btn { min-height: 44px; padding: 0 18px; }
@media (max-width: 560px) { #form-feedback .input-row { flex-direction: column; gap: 0; } }

/* Data sources: the page of one source (menu Data sources > <source>) */
.ds-provider-head { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 16px; }
.ds-provider-head h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-main); }
.ds-grid.ds-single { grid-template-columns: minmax(0, 760px); }

/* --- Today page (top of the health tab) -------------------------------- */
.today-head {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between;
  margin: 4px 0 20px;
  animation: hc-fade 0.5s ease-out both;
}
.today-date { font-size: 13px; color: #8A97A6; text-transform: uppercase; letter-spacing: 0.08em; }
.today-date::first-letter { text-transform: uppercase; }
.today-hello { margin-top: 6px; font-size: 32px; font-weight: 600; letter-spacing: -0.025em; color: var(--text-main); }
.today-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.today-sync {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-color);
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
  cursor: pointer; font-family: inherit; line-height: 1;
  transition: all 0.2s ease;
}
.today-sync:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
  color: var(--text-main);
  border-color: var(--primary, #2dd4bf);
}
.today-sync:active { transform: scale(0.97); }
.today-sync.today-syncing { opacity: 0.85; cursor: wait; pointer-events: none; }
.today-sync.today-syncing .today-live { background: #f59e0b; }
.today-live { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: hc-pulse 2.2s ease-out infinite; }
.today-ask { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; }

.today-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.today-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.today-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.today-grid-2b { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.today-grid .summary-card { margin: 0; padding: 22px; }

/* readiness hero */
.today-hero { border-radius: 16px; }
.today-hero-body { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.today-ring { position: relative; width: 168px; height: 168px; flex: none; }
.today-ring svg { width: 100%; height: 100%; }
.today-ring-arc { transition: stroke-dasharray 1.4s cubic-bezier(0.2, 0.8, 0.2, 1); animation: hc-ring 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s backwards; }
.today-ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: #8A97A6; text-transform: uppercase; letter-spacing: 0.08em;
}
.today-ring-num.summary-value { font-family: var(--font-mono); font-size: 46px; font-weight: 500; letter-spacing: -0.04em; line-height: 1.1; color: var(--text-main); }
.today-hero-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.today-hero-title.summary-status-header { padding-right: 28px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--text-main); margin: 0; line-height: 1.3; }
.today-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.today-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: #17202A; min-width: 0; }
.today-stat-label { font-size: 11px; color: #8A97A6; text-transform: uppercase; letter-spacing: 0.06em; }
.today-stat-val { font-family: var(--font-mono); font-size: 18px; font-weight: 500; color: var(--text-main); }
.today-stat-val small { font-size: 12px; color: #8A97A6; }
.today-stat-sub { font-size: 12px; color: #8A97A6; min-height: 1em; }
.today-good { color: #5EEAD4; }
.today-warn { color: #F5C76A; }
.today-details { margin-top: 2px; }
.today-details summary { cursor: pointer; font-size: 12px; color: var(--text-dim); list-style: revert; user-select: none; }
.today-details summary:hover { color: var(--text-main); }
.today-details .readiness-details {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  line-height: 1.35;
  color: #C2CCD6;
  max-height: 72px;
  overflow-y: auto;
}
.today-details .readiness-details::-webkit-scrollbar {
  width: 4px;
}
.today-details .readiness-details::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* coach recommendation */
.today-coach.summary-card {
  background: #10262A; border-color: #1B4A48; border-radius: 16px;
  gap: 14px;
  animation: hc-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s backwards, hc-glow 4s ease-in-out 1.2s infinite;
}
.today-coach-head { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: #99F6E4; text-transform: uppercase; letter-spacing: 0.08em; }
.today-coach-badge { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; }
.today-coach-text.ai-advice-box {
  background: transparent; border: 0; padding: 0; margin: 0;
  font-size: 13.5px; line-height: 1.5; color: #B9C6CF;
  max-height: 220px; overflow-y: auto;
}
.ai-advice-line {
  margin: 3px 0;
  line-height: 1.45;
}
.ai-advice-workout {
  margin: 5px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.28);
  color: #F0FDFA;
  font-weight: 500;
  font-size: 13px;
}
.ai-advice-focus {
  color: #A7F3D0;
  font-size: 13px;
}
.ai-advice-cal-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  color: #5EEAD4;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px dashed rgba(45, 212, 191, 0.4);
  transition: all 0.15s ease;
  user-select: none;
}
.ai-advice-cal-hint:hover {
  background: rgba(45, 212, 191, 0.2);
  color: #FFFFFF;
  border-color: #5EEAD4;
}
.today-coach-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.today-coach-actions .btn { min-height: 44px; padding: 0 16px; border-radius: 12px; }
.today-regen { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid #2B5E5A; }

/* small cards */
.today-card { gap: 14px; }
.today-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.today-head-right { display: inline-flex; align-items: center; gap: 10px; }
.today-info.chart-info-btn { position: static; }
.today-coach-head .today-info { margin-left: auto; }
.today-card-head h3 { margin: 0; padding: 0; font-size: 15px; font-weight: 600; color: var(--text-main); }
.today-meta { font-size: 12px; color: #8A97A6; }
.today-big { font-family: var(--font-mono); font-size: 26px; font-weight: 500; color: var(--text-main); letter-spacing: -0.02em; }
.today-accent { color: #5EEAD4; }
.today-cap { font-size: 12px; color: #8A97A6; }
.today-trio { display: flex; gap: 24px; }
.today-spark { width: 100%; height: 48px; display: block; }
.today-spark-ctl { stroke-dasharray: 100; animation: hc-draw 1.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both; }
.today-spark-atl { animation: hc-fade 1s ease-out 1.1s both; }
.today-link {
  align-self: flex-start; background: none; border: 0; padding: 0; cursor: pointer;
  font: 500 12px var(--font-family); color: #5EEAD4;
}
.today-link:hover { color: #99F6E4; text-decoration: underline; }
.today-stages { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: #1F2A35; }
.today-stages > div { transform-origin: left; animation: hc-growx 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s both; }
.today-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-dim); }
.today-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.today-kcal { display: flex; align-items: baseline; gap: 6px; }
.today-macros { display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--text-dim); }
.today-macro { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 10px; }
.today-meter { height: 6px; border-radius: 3px; background: #1F2A35; overflow: hidden; }
.today-meter-fill { height: 100%; border-radius: 3px; transform-origin: left; animation: hc-growx 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s both; }
.today-mono { font-family: var(--font-mono); color: var(--text-main); }

/* weekly load */
.today-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-bottom: 4px; }
.today-bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.today-bar-val { font-family: var(--font-mono); font-size: 10px; color: #8A97A6; }
.today-bar {
  width: 100%; max-width: 44px; border-radius: 6px 6px 2px 2px; background: #2A3A48;
  transform-origin: bottom; animation: hc-grow 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.today-bar-max { background: #F5A524; }
.today-bar-now { background: repeating-linear-gradient(135deg, #2DD4BF 0 6px, #1C8F82 6px 12px); }
.today-bar-lbl { font-size: 10px; color: #8A97A6; padding-top: 6px; border-top: 1px solid var(--border-color); width: 100%; text-align: center; }
.today-empty { margin: auto; font-size: 13px; color: #8A97A6; }

/* recent activities */
.today-acts { display: flex; flex-direction: column; gap: 2px; }
.today-act {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 10px; margin: 0 -10px; width: calc(100% + 20px);
  background: transparent; border: 0; border-radius: 12px; cursor: pointer;
  color: var(--text-main); text-align: left; font-family: var(--font-family);
  transition: background 0.18s;
}
.today-act:hover { background: #17202A; }
.today-act:hover .today-chev { transform: translateX(3px); opacity: 1; }
.today-badge {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; background: #1F2833; color: var(--text-dim);
}
.today-badge-run { background: #10302C; color: #5EEAD4; }
.today-badge-bike { background: #16233A; color: #93C5FD; }
.today-badge-str { background: #2E2414; color: #F5C76A; }
.today-badge-walk { background: #241D3A; color: #C4B5FD; }
.today-act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-act-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-act-when { font-size: 12px; color: #8A97A6; white-space: nowrap; }
.today-act-when::first-letter { text-transform: uppercase; }
.today-act-nums { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; }
.today-chev { flex: none; color: #8A97A6; opacity: 0.4; transition: transform 0.2s, opacity 0.2s; }

@keyframes hc-ring { from { stroke-dasharray: 0 440; } }
@keyframes hc-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes hc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes hc-growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hc-pulse { 0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(45, 212, 191, 0); } 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } }
@keyframes hc-glow { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 0 rgba(45, 212, 191, 0); } 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 32px -6px rgba(45, 212, 191, 0.35); } }

@media (max-width: 767px) {
  .today-hello { font-size: 24px; }
  .today-ask { display: none; }
  .today-ring { width: 132px; height: 132px; }
  .today-ring-num.summary-value { font-size: 36px; }
  .today-bars { gap: 6px; height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .today-ring-arc, .today-bar, .today-stages > div, .today-meter-fill, .today-spark-ctl, .today-live { animation: none !important; transition: none !important; }
}

@keyframes hc-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes hc-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Status line under the workout modal after sending a PT session to Garmin */
.pt-garmin-status {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #5EEAD4;
}

/* PT-41: weight curve line above the calendar */
.pt-weight-progress {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* PT-45: morning check-in above the calendar */
.pt-wellness { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: rgba(245, 158, 11, 0.08); }
.pt-wellness-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt-wellness-intro { margin: 4px 0 8px; font-size: 0.82rem; opacity: 0.8; }
.pt-wellness-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin: 4px 0; }
.pt-wellness-label { font-size: 0.85rem; }
.pt-wellness-label small { opacity: 0.65; }
.pt-wellness-scale { display: flex; gap: 4px; }
.pt-wellness-btn { min-width: 34px; min-height: 34px; border-radius: 6px; border: 1px solid rgba(148, 163, 184, 0.4); background: transparent; color: inherit; cursor: pointer; }
.pt-wellness-btn.active { background: #F59E0B; border-color: #F59E0B; color: #111; }
.pt-wellness-cycle { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.8rem; opacity: 0.85; }

/* PT-119: a past session on a day without data, and the "did you do it?" row */
.cal-act-chip.cal-planned-unknown { opacity: 0.75; border-style: dashed; }
.pt-confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; font-size: 0.85rem; }
