/* SpekFit — Premium Fitness & Activity Tracking Portal Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap');

:root {
  /* Core Palette — Clean Minimal Fitness Analytics */
  --primary: #FF6B00;
  --primary-hover: #E85D00;
  --primary-soft: rgba(255, 107, 0, 0.10);
  --primary-border: rgba(255, 107, 0, 0.25);

  --bg: #F8F9FC;
  --surface: #FFFFFF;
  --surface-subtle: #F3F5F9;
  --border: #E9EBF0;
  --border-strong: #D5D9E2;

  --text: #171717;
  --text-secondary: #737373;
  --muted: #737373;

  --success: #16A36A;
  --success-soft: rgba(22, 163, 106, 0.12);
  --info: #3685F5;
  --info-soft: rgba(54, 133, 245, 0.12);
  --purple: #805AD5;
  --purple-soft: rgba(128, 90, 213, 0.12);
  --danger: #DC2626;
  --danger-soft: rgba(220, 38, 38, 0.10);
  --warn-bg: #FFFBEB;
  --warn-border: #F59E0B;
  --warn-text: #B45309;
  --ok-bg: #ECFDF5;
  --ok-text: #065F46;
  --accent: #FF6B00;

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

  --shadow-xs: 0 1px 2px rgba(23, 23, 23, 0.03);
  --shadow-sm: 0 2px 8px -2px rgba(23, 23, 23, 0.05), 0 1px 3px rgba(23, 23, 23, 0.03);
  --shadow-md: 0 8px 24px -4px rgba(23, 23, 23, 0.06), 0 2px 6px -1px rgba(23, 23, 23, 0.04);
  --shadow-orange: 0 6px 16px -3px rgba(255, 107, 0, 0.35);

  --sidebar-width: 248px;
  --topbar-height: 70px;
}

[data-theme="dark"] {
  --bg: #0E1116;
  --surface: #161B22;
  --surface-subtle: #1F2631;
  --border: #28303D;
  --border-strong: #374151;
  --text: #F3F4F6;
  --text-secondary: #9CA3AF;
  --muted: #9CA3AF;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --warn-border: rgba(245, 158, 11, 0.4);
  --warn-text: #FBBF24;
  --ok-bg: rgba(22, 163, 106, 0.16);
  --ok-text: #34D399;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, .stat-num {
  font-family: "Manrope", "Inter", sans-serif;
  letter-spacing: -0.02em;
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* ============================================================================
   App Shell: Sidebar + Topbar + Main Canvas
   ============================================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 1.35rem 1rem 1.15rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.65rem 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.sidebar-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-family: "Manrope", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.sidebar-brand-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 0.85rem 0.75rem 0.3rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.16s ease;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  stroke-width: 2;
}

.nav-item:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: var(--shadow-orange);
}

.nav-item.active svg {
  color: #FFFFFF;
}

/* Sidebar Promo / Goal Card */
.sidebar-promo {
  margin-top: 1rem;
  background: linear-gradient(180deg, var(--surface-subtle) 0%, rgba(54, 133, 245, 0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.95rem;
  text-align: center;
}

.sidebar-promo-art {
  width: 64px;
  height: 44px;
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.sidebar-promo h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.sidebar-promo p {
  margin: 0 0 0.75rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.sidebar-promo .btn-goal {
  display: inline-block;
  width: 100%;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.52rem 0.85rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-orange);
  transition: background 0.15s ease, transform 0.15s ease;
}

.sidebar-promo .btn-goal:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Main Content Wrapper */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  max-width: 520px;
}

.sidebar-toggle {
  display: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.topbar-search {
  position: relative;
  flex: 1;
}

.topbar-search svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 2.55rem;
  font-size: 0.88rem;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}

.user-menu-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem 0.25rem 0.3rem;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF6B00 0%, #F59E0B 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF6B00 0%, #3685F5 100%);
  padding: 3px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.avatar-lg-inner {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Manrope", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary);
}

.page-canvas {
  padding: 1.5rem 1.75rem 2.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ============================================================================
   Welcome Row & Date-Range Selector
   ============================================================================ */

.welcome-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.welcome-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.welcome-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.welcome-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.period-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  box-shadow: var(--shadow-xs);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.period-select-pill select {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
  padding: 0 0.25rem;
  width: auto;
  cursor: pointer;
}

.period-select-pill select:focus {
  outline: none;
}

/* ============================================================================
   Bento Grid & Cards
   ============================================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--info);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.card-link:hover {
  color: var(--primary);
}

/* 4 Metric Cards Row */
.metrics-bento-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon.orange { background: var(--primary-soft); color: var(--primary); }
.metric-icon.blue { background: var(--info-soft); color: var(--info); }
.metric-icon.green { background: var(--success-soft); color: var(--success); }
.metric-icon.purple { background: var(--purple-soft); color: var(--purple); }

.metric-label {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-card-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-value-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.metric-number {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-left: 0.15rem;
}

.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--success);
}

.metric-delta.down {
  color: var(--text-secondary);
}

.metric-sparkline {
  width: 96px;
  height: 40px;
  flex-shrink: 0;
}

/* Middle Bento Row: Latest Activity (7 cols) + Performance Trend (5 cols) */
.bento-mid-row {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.bento-mid-row > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.latest-activity-split {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 0.9rem;
  flex: 1;
  min-height: 265px;
}

.latest-cover {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(155deg, #1E293B 0%, #0F172A 55%, #334155 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  color: #FFFFFF;
  min-height: 255px;
}

.latest-cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.latest-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.35) 45%, rgba(15, 23, 42, 0.88) 100%);
  pointer-events: none;
}

.latest-cover-top,
.latest-cover-bottom {
  position: relative;
  z-index: 2;
}

.latest-cover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.activity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.latest-distance-big {
  font-family: "Manrope", sans-serif;
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.45rem;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.latest-distance-big span {
  font-size: 1.35rem;
  font-weight: 700;
  opacity: 0.92;
}

.latest-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.latest-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.latest-map-box {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  position: relative;
  min-height: 255px;
}

#latest-run-map {
  width: 100%;
  height: 100%;
  min-height: 255px;
}

/* Performance Trend Tabs */
.trend-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--surface-subtle);
  padding: 0.25rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.trend-tab {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trend-tab:hover {
  color: var(--text);
}

.trend-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.trend-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 205px;
}

/* Bottom Bento Row: Achievements + Weekly Summary + Recent Activities */
.bento-bottom-row {
  display: grid;
  grid-template-columns: 3.8fr 4.4fr 3.8fr;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.bento-bottom-row > .card {
  margin-bottom: 0;
}

/* Hexagonal Achievement Badges */
.badges-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  text-align: center;
  padding-top: 0.25rem;
}

.hex-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.hex-medal {
  width: 66px;
  height: 74px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  color: #FFFFFF;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}

.hex-badge-item:hover .hex-medal {
  transform: scale(1.06);
}

.hex-medal.gold {
  background: linear-gradient(160deg, #F59E0B 0%, #B45309 100%);
}
.hex-medal.green {
  background: linear-gradient(160deg, #10B981 0%, #047857 100%);
}
.hex-medal.dark {
  background: linear-gradient(160deg, #334155 0%, #0F172A 100%);
}
.hex-medal.purple {
  background: linear-gradient(160deg, #8B5CF6 0%, #5B21B6 100%);
}
.hex-medal.blue {
  background: linear-gradient(160deg, #3B82F6 0%, #1D4ED8 100%);
}
.hex-medal.orange {
  background: linear-gradient(160deg, #FF6B00 0%, #C2410C 100%);
}
.hex-medal.locked {
  opacity: 0.48;
  filter: saturate(0.35);
}

.hex-medal-code {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.hex-badge-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

/* Weekly Summary Ring + Sparkline */
.weekly-summary-body {
  display: grid;
  grid-template-columns: 122px 1fr;
  gap: 1rem;
  align-items: center;
}

.goal-ring-wrap {
  position: relative;
  width: 118px;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-ring-text {
  position: absolute;
  text-align: center;
  line-height: 1.15;
}

.goal-ring-pct {
  display: block;
  font-family: "Manrope", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.goal-ring-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.weekly-stats-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.weekly-km-big {
  font-family: "Manrope", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
}

.weekly-km-target {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.weekly-days-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Compact Recent Activities List */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
}

.recent-item:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.recent-item-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.recent-run-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recent-run-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-run-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.recent-run-day {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

/* ============================================================================
   Shared Components: Grids, Stats, Tables, Badges, Buttons, Forms
   ============================================================================ */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  margin-bottom: 1.15rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  margin-bottom: 1.15rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.75rem;
}

.stat-item {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-family: "Manrope", sans-serif;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

td {
  text-align: left;
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

tbody tr:hover {
  background: var(--surface-subtle);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.badge-err { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-orange { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: transparent; }

.alert-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-err {
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--danger);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border: 1px solid rgba(22, 163, 106, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.52rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

button:hover, .btn:hover {
  background: var(--primary-hover);
  color: #FFFFFF;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

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

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.52rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.field { margin-bottom: 0.95rem; }
.field-error { color: var(--danger); font-size: 0.82rem; margin-top: 0.25rem; }

#run-map, #routes-explorer-map {
  width: 100%;
  height: 360px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.chart-box {
  position: relative;
  height: 230px;
  margin-bottom: 0.75rem;
}

.token-value { word-break: break-all; user-select: all; }
.nav-user { font-weight: 600; font-size: 0.85rem; color: var(--text); }

/* Sub-navigation tabs (used on Training / Settings) */
.subnav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.subnav-tab {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
}

.subnav-tab.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.3s ease;
}
.progress-fill.green { background: var(--success); }
.progress-fill.blue { background: var(--info); }
.progress-fill.purple { background: var(--purple); }

/* Responsive Breakpoints */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

@media (max-width: 1180px) {
  .metrics-bento-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bento-mid-row,
  .bento-bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
  .app-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  .topbar {
    padding: 0 1rem;
  }
  .page-canvas {
    padding: 1.1rem 1rem 2rem;
  }
}

@media (max-width: 640px) {
  .metrics-bento-row {
    grid-template-columns: 1fr;
  }
  .latest-activity-split {
    grid-template-columns: 1fr;
  }
  .badges-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .weekly-summary-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .welcome-title {
    font-size: 1.35rem;
  }
}

/* ============================================================================
   Authentication & OAuth Consent Split Screen
   ============================================================================ */

.auth-shell {
  min-height: calc(100vh - 2.5rem);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 0.25rem auto;
  max-width: 1160px;
}

.auth-showcase {
  position: relative;
  background: linear-gradient(155deg, #131822 0%, #0E1219 60%, #1C2331 100%);
  color: #FFFFFF;
  padding: 2.75rem 2.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-showcase-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
}

.auth-showcase-top,
.auth-showcase-mid,
.auth-showcase-bottom {
  position: relative;
  z-index: 2;
}

.auth-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 107, 0, 0.16);
  border: 1px solid rgba(255, 107, 0, 0.38);
  color: #FF8C38;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.15rem;
}

.auth-hero-title {
  font-family: "Manrope", sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  margin: 0 0 0.85rem;
}

.auth-hero-title span {
  color: #FF6B00;
}

.auth-hero-sub {
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
  margin: 0 0 1.75rem;
  max-width: 460px;
}

.auth-preview-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.auth-preview-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
}

.auth-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
}

.auth-panel {
  padding: 2.75rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  position: relative;
}

.auth-panel-inner {
  max-width: 390px;
  width: 100%;
  margin: 0 auto;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap svg.input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
  pointer-events: none;
}

.auth-input-wrap input {
  padding: 0.68rem 0.9rem 0.68rem 2.55rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-orange);
}

.auth-footer-meta {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    margin: 1rem auto;
  }
  .auth-showcase {
    display: none;
  }
  .auth-panel {
    padding: 2rem 1.5rem;
  }
}

/* ---------------------------------------------------------------- coach notes */
.note-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--surface);
}
.note-card.archived { opacity: 0.75; }
.note-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.note-meta { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.note-actions { display: flex; gap: 0.4rem; }
.note-actions form { margin: 0; }
.note-body { margin-top: 0.6rem; line-height: 1.55; }
.note-body > :first-child { margin-top: 0; }
.note-body > :last-child { margin-bottom: 0; }
.note-body ul, .note-body ol { margin: 0.35rem 0; padding-left: 1.25rem; }
.note-body li { margin: 0.15rem 0; }
.qa-block {
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
}
.qa-block .qa-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.qa-question { background: var(--surface-subtle); border: 1px solid var(--border); }
.qa-question .qa-label { color: var(--muted); }
.qa-answer { background: var(--primary-soft); border: 1px solid var(--primary-border); }
.qa-answer .qa-label { color: var(--primary); }
.qa-answer .note-body { margin-top: 0; }
.qa-waiting { color: var(--muted); font-style: italic; margin: 0; }

/* ---------------------------------------------------------------- connect guide */
.connect-guide pre {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin: 0.4rem 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.82rem;
}
.connect-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
}
.connect-option summary { cursor: pointer; }
.connect-option ol { margin: 0.6rem 0 0.2rem; padding-left: 1.25rem; line-height: 1.6; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; font-family: ui-monospace, monospace; }

/* ---------------------------------------------------------------- combined stream chart */
.stream-chart-box { height: 300px; }
.stream-toggles {
  display: grid;
  grid-template-columns: 70px repeat(4, minmax(0, 1fr));
  align-items: center;
  row-gap: 0.4rem;
  text-align: center;
  margin-top: 0.5rem;
}
.stream-toggle { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.stream-toggle-label { font-size: 0.85rem; font-weight: 600; }
.stream-pace .stream-toggle-label { color: #3685F5; }
.stream-hr .stream-toggle-label { color: #DC2626; }
.stream-cadence .stream-toggle-label { color: #C026D3; }
.stream-alt .stream-toggle-label { color: var(--muted); }
.stream-avg-label { font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 0.45rem; }
.stream-avg { font-weight: 600; border-top: 1px solid var(--border); padding-top: 0.45rem; }
.stream-avg small { font-weight: 400; color: var(--muted); }

.switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-strong); border-radius: 999px; transition: background 0.15s;
}
.switch-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s;
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:disabled + .switch-slider { opacity: 0.4; cursor: not-allowed; }
@media (max-width: 640px) {
  .stream-toggles { grid-template-columns: 44px repeat(4, minmax(0, 1fr)); font-size: 0.8rem; }
}

/* ------------------------------------------------------------------ training plan calendar */
.muted { color: var(--text-secondary); }
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.plan-main { min-width: 0; }
.plan-panel { position: sticky; top: calc(var(--topbar-height) + 1rem); max-height: calc(100vh - var(--topbar-height) - 2rem); overflow-y: auto; }
.plan-panel h4 { margin: 1rem 0 0.4rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.panel-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.7rem; margin-bottom: 0.5rem; background: var(--surface); }
.panel-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.panel-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.suggestion-card { border-color: var(--warn-border); background: var(--warn-bg); }
.diff-new { border-left: 3px solid var(--success); padding-left: 0.6rem; }
.diff-old { border-left: 3px solid var(--danger); padding-left: 0.6rem; color: var(--text-secondary); }
.diff-table { width: 100%; font-size: 0.82rem; }
.diff-table th, .diff-table td { padding: 0.25rem 0.4rem; vertical-align: top; white-space: normal; }
.diff-table tr.changed td:last-child { font-weight: 600; color: var(--success); }
.diff-table s { color: var(--danger); }

.plan-header-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; }
.plan-header-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: flex-start; }
.plan-current { margin: 0.8rem 0 0.5rem; }
.plan-focus { margin-top: 0.8rem; padding: 0.6rem 0.8rem; background: var(--primary-soft); border-radius: var(--radius-sm); }
.plan-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.8rem; }
.plan-history { list-style: none; padding: 0; margin: 0; }
.plan-history li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }

/* phase colours */
.phase-base { --phase: #3685F5; }
.phase-build { --phase: #FF6B00; }
.phase-peak { --phase: #DC2626; }
.phase-taper { --phase: #805AD5; }
.phase-race { --phase: #16A36A; }
.phase-recovery { --phase: #0EA5A4; }
.phase-maintenance { --phase: #737373; }
.phase-chip { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  color: var(--phase, var(--text)); background: color-mix(in srgb, var(--phase, #737373) 14%, transparent); }
.phase-timeline { position: relative; display: flex; height: 26px; border-radius: var(--radius-sm); overflow: hidden; margin-top: 0.4rem; }
.phase-seg { background: color-mix(in srgb, var(--phase) 22%, transparent); border-right: 2px solid var(--surface);
  display: flex; align-items: center; padding: 0 0.4rem; font-size: 0.72rem; font-weight: 700; color: var(--phase); overflow: hidden; white-space: nowrap; }
.phase-seg.current { background: color-mix(in srgb, var(--phase) 40%, transparent); }
.phase-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }

/* calendar grid */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.cal-nav-spacer { width: 2.2rem; }
.cal-grid { display: grid; grid-template-columns: 96px repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-align: center; padding: 0.2rem 0; }
.cal-week-info { font-size: 0.72rem; border-left: 4px solid var(--phase, transparent); padding: 0.3rem 0.4rem;
  background: color-mix(in srgb, var(--phase, transparent) 8%, transparent); border-radius: 4px; display: flex; flex-direction: column; gap: 0.15rem; }
.cal-week-phase { font-weight: 700; color: var(--phase, var(--text)); }
.cal-week-target { color: var(--text-secondary); }
button.cal-day { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; min-height: 92px; padding: 0.35rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 0.75rem; color: var(--text); overflow: hidden; }
button.cal-day:hover, button.cal-day:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-day.other-month { opacity: 0.45; }
.cal-day.past { background: var(--surface-subtle); }
.cal-day.today { border: 2px solid var(--primary); }
.cal-date { font-weight: 700; display: flex; align-items: center; gap: 0.3rem; }
.cal-item { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.25rem; padding: 1px 4px; border-radius: 4px; line-height: 1.3;
  border-left: 3px solid var(--wt, var(--border-strong)); background: color-mix(in srgb, var(--wt, #737373) 10%, transparent); }
.cal-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 100%; min-width: 0; font-weight: 600; }
.cal-item.suggestion .cal-item-name, .cal-item.moved .cal-item-name { flex-basis: auto; }
.cal-item-target { color: var(--text-secondary); white-space: nowrap; }
.cal-item.external { border-left-style: dashed; }
.cal-item.suggestion { --wt: var(--warn-border); background: var(--warn-bg); flex-wrap: nowrap; }
.cal-item.moved { color: var(--text-secondary); font-style: italic; }
.cal-item.run { --wt: var(--success); color: var(--ok-text); }
.mark { font-size: 0.68rem; font-weight: 800; }
.mark-err { color: var(--danger); }
.mark-ext { color: var(--text-secondary); font-weight: 600; }
.mark-sugg { color: var(--warn-border); }
.mark-done { color: var(--success); }
.mark-missed { color: var(--danger); }
.mark-extra { color: var(--info); }
.wt-easy { --wt: #3685F5; } .wt-long { --wt: #805AD5; } .wt-tempo { --wt: #FF6B00; } .wt-intervals { --wt: #DC2626; }
.wt-recovery { --wt: #0EA5A4; } .wt-race { --wt: #16A36A; } .wt-other { --wt: #737373; }
.panel-item[class*="wt-border-"] { border-left: 4px solid var(--wt, var(--border-strong)); }
.wt-border-easy { --wt: #3685F5; } .wt-border-long { --wt: #805AD5; } .wt-border-tempo { --wt: #FF6B00; } .wt-border-intervals { --wt: #DC2626; }
.wt-border-recovery { --wt: #0EA5A4; } .wt-border-race { --wt: #16A36A; } .wt-border-other { --wt: #737373; }
.revision-list { padding-left: 1.1rem; margin: 0.3rem 0; }
.revision-list li { margin-bottom: 0.4rem; }
.revision-list li.changed { background: var(--ok-bg); border-radius: 4px; padding: 0.2rem 0.3rem; }

/* phone: stacked week list instead of the grid */
.cal-list { display: none; }
.cal-list-week { border-left: 4px solid var(--phase, var(--border)); padding-left: 0.6rem; margin-bottom: 0.9rem; }
.cal-list-week-head { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.4rem; }
button.cal-list-day { min-height: 0; width: 100%; margin-bottom: 0.4rem; }

@media (max-width: 1180px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr); }
  .plan-panel { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .cal-grid { display: none; }
  .cal-list { display: block; }
}

/* flexible schedule */
.cal-item.skipped { opacity: 0.55; text-decoration: line-through; }
.mark-moved { color: var(--success); }
.mark-skipped { color: var(--warn-text); }
.workout-actions { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.move-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.skip-box summary { cursor: pointer; font-size: 0.82rem; color: var(--text-secondary); }
.skip-form { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.skip-form select, .skip-form input { width: auto; flex: 1 1 120px; padding: 0.3rem 0.4rem; font-size: 0.82rem; }
.skip-info { margin-top: 0.3rem; }
